[MPlayer-dev-eng] [PATCH] Avoid pointer cast warnings

Ingo Brückl ib at wupperonline.de
Mon Feb 17 19:56:57 CET 2014


Reimar Döffinger wrote on Mon, 17 Feb 2014 18:16:42 +0100:

> On Mon, Feb 17, 2014 at 04:03:03AM +0100, Ingo Brückl wrote:
>> So I assume this is necessary for 64-bit machines as well?

> No, if it's a constant the compiler figures it is ok, as far as I can
> tell.

Oh, I just thought because of your

--- mplayer.c	(revision 36857)
+++ mplayer.c	(revision 36858)
@@ -3061,7 +3061,7 @@
     if (use_gui) {
         guiInit();
         gui(GUI_SET_CONTEXT, mpctx);
-        gui(GUI_SET_STATE, (void *)(filename ? GUI_PLAY : GUI_STOP));
+        gui(GUI_SET_STATE, (void *)(intptr_t)(filename ? GUI_PLAY : GUI_STOP));
     }
 #endif

I wasn't quite sure about integer(?) constants, but the compiler makes a
difference then between

  gui(GUI_SET_STATE, (void *)(filename ? GUI_PLAY : GUI_STOP));

and

  gui(GUI_SET_STATE, (void *)GUI_PLAY);

Weird. In both cases, only / the same constants are involved.

> You don't have any 64 bit machine?

No. The X11/GTK GUI code compiles (even with a few more than the usual
compiler warning options) free of any warnings here. If not, I would have
fixed already.

Ingo


More information about the MPlayer-dev-eng mailing list