[MPlayer-dev-eng] Four small patches addressing build problems (fwd)

Peter Breitenlohner peb at mppmu.mpg.de
Wed Dec 14 10:24:22 CET 2005


On Tue, 13 Dec 2005, Dominik 'Rathann' Mierzejewski wrote:

> On Wednesday, 07 December 2005 at 09:42, Peter Breitenlohner wrote:
>
>> 	Avoid gcc warnings:
>> 		'...' might be used uninitialized in this function
>>
>> 	I think, in this case 'H', 'N', 'D', and 'F' can indeed be
>> 	used unitialized, thus possibly causing all sorts of problems.
>>
> Resend without cosmetics (whitespace changes).
Here it is

> What does it actually do, remove one parenthesis?
Replace something like
  	if (expr_1) {
  	  ...
  	  create menu items H, N, D, and F
  	}
  	if (expr_2) {
  	  make menu items H, N, D, and F insensitive
  	}
by
  	if (expr_1) {
  	  ...
  	  create menu items H, N, D, and F
  	  if (expr_2) {
  	    make menu items H, N, D, and F insensitive
  	  }
  	}
I don't know if there can be situations where expr_1 is false but
expr_2 is true. If so, the originally code is buggy, otherwise the change
doesn't harm.

> This is due to broken libjpeg.
Yes, sort of. The actual culprit might be autoconf with the change in the
generated headers ("#define HAVE_STDDEF_H" for version<=2.13 vs. "#define
HAVE_STDDEF_H 1" for version>=2.49).

> We don't work around others' bugs.
Fair enough.

Peter Breitenlohner <peb at mppmu.mpg.de>
-------------- next part --------------
	Avoid gcc warnings:
		'...' might be used uninitialized in this function

	I think, in this case 'H', 'N', 'D', and 'F' can indeed be
	used unitialized, thus possibly causing all sorts of problems.

diff -ur MPlayer-1.0pre7try2.orig/Gui/mplayer/gtk/menu.c MPlayer-1.0pre7try2/Gui/mplayer/gtk/menu.c
--- MPlayer-1.0pre7try2.orig/Gui/mplayer/gtk/menu.c	2005-01-25 13:44:38.000000000 +0100
+++ MPlayer-1.0pre7try2/Gui/mplayer/gtk/menu.c	2005-12-14 09:16:18.000000000 +0100
@@ -594,8 +594,6 @@
     N=AddMenuCheckItem( window1, (const char*)normal_xpm, Menu,MSGTR_MENU_NormalSize"      ",b1,evNormalSize );
     D=AddMenuCheckItem( window1, (const char*)double_xpm, Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize );
     F=AddMenuCheckItem( window1, (const char*)fs_xpm, Menu,MSGTR_MENU_FullScreen,appMPlayer.subWindow.isFullScreen,evFullScreen );
-   }
-
   if ( !gtkShowVideoWindow && !guiIntfStruct.Playing )
    {
     gtk_widget_set_sensitive( H,FALSE );
@@ -603,6 +601,7 @@
     gtk_widget_set_sensitive( D,FALSE );
     gtk_widget_set_sensitive( F,FALSE );
    }
+   }
 
   AddSeparator( Menu );
   AddMenuItem( window1, (const char*)exit_xpm, Menu,MSGTR_MENU_Exit, evExit );


More information about the MPlayer-dev-eng mailing list