[MPlayer-dev-eng] [PATCH] Windows GUI with mingw64 and cygwin

Diego Biurrun diego at biurrun.de
Thu May 5 09:34:33 CEST 2011


On Wed, May 04, 2011 at 09:42:37PM +0000, Stephen Sheldon wrote:
> I also added a #include for process.h in gui/win32/interface.h, to satisfy
> the call to _beginthreadx.
> 
> The change in gui/win32/wincfg.c is to get around a recent change in the X11 gui.

Please put independent changes in different patches.

> With this fix for gfree/free, the Windows gui also works when compiled
> with cygwin, if you also apply the change mentioned in this email
> http://lists.mplayerhq.hu/pipermail/mplayer-cygwin/2010-June/003305.html.

Could you submit a patch for this?

> --- gui/win32/interface.c	(revision 33366)
> +++ gui/win32/interface.c	(working copy)
> @@ -22,6 +22,7 @@
>  
>  #include <windows.h>
> +#include <process.h>
>  #include "path.h"
>  #include "gui/interface.h"
>  #include "m_option.h"

Please add an empty line between system and local headers while you're at it.

> --- gui/win32/wincfg.c	(revision 33366)
> +++ gui/win32/wincfg.c	(working copy)
> @@ -56,7 +56,7 @@
>  
> -static m_config_t *gui_conf;
> +m_config_t *gui_conf;

Why?

> --- gui/interface.h	(revision 33366)
> +++ gui/interface.h	(working copy)
> @@ -93,13 +93,13 @@
>  
>  #define guiSetFilename(s, n) \
>      { \
> -        gfree((void **)&s); \
> +        free((void *)s); \
>          s = gstrdup(n); \
>      }
>  
>  #define guiSetDF(s, d, n) \
>      { \
> -        gfree((void **)&s); \
> +        free((void *)s); \
>          s = malloc(strlen(d) + strlen(n) + 5); \
>          sprintf(s, "%s/%s", d, n); \
>      }

The casts are unnecessary, free() takes a void* argument.

Diego


More information about the MPlayer-dev-eng mailing list