[MPlayer-dev-eng] [PATCH] signed-ness warning fix - x11_common.c

Rich Felker dalias at aerifal.cx
Fri May 5 17:20:16 CEST 2006


On Fri, May 05, 2006 at 10:50:49AM +0200, Pierre Lombard wrote:
> Hi,
> 
> The patch attached avoid some signed-ness (unsigned int < 0 = useless)
> 
> -- 
> Pierre Lombard
> GPG: 0x1AF0803C

> Index: libvo//x11_common.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
> retrieving revision 1.210
> diff -u -r1.210 x11_common.c
> --- libvo//x11_common.c	25 Apr 2006 21:36:02 -0000	1.210
> +++ libvo//x11_common.c	5 May 2006 08:49:23 -0000
> @@ -1598,7 +1598,7 @@
>      XEvent ev;
>  
>      if (mDisplay && xs_windowid &&
> -        ((time - time_last) > 30000 || (time - time_last) < 0))
> +        ((int)(time - time_last) > 30000 || (int) (time - time_last) < 0))

This patch just wastes instructions. The following would do the same
if the quantity is truly unsigned:

if (mDisplay && xs_windowid && (time - time_last) > 30000)

Rich




More information about the MPlayer-dev-eng mailing list