checked sources of xorg-server 1.7.0 with static code analysis tool cppcheck

Alan Coopersmith Alan.Coopersmith at Sun.COM
Fri Oct 2 15:05:58 PDT 2009


Martin Ettl wrote:
> diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
> index 4920115..b07810a 100644
> --- a/hw/xfree86/dixmods/extmod/xf86vmode.c
> +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
> @@ -120,7 +120,7 @@ static int XF86VidModeEventBase = 0;
>  static void SXF86VidModeNotifyEvent();
>      xXF86VidModeNotifyEvent * /* from */,
>      xXF86VidModeNotifyEvent * /* to */
> -);
> +
>  
>  static RESTYPE EventType;	/* resource type for event masks */
>  

Shouldn't the ");" on the first line be deleted instead?   That appears to be
a multi-line C function prototype (in code not currently built), dropping
the trailing ); would leave those pointers dangling in the middle of whitespace.

Most of the other fixes appear reasonable, though some violate the compatibility
we've been keeping with pre-C99 compilers that require declarations before code.
(Not sure who that's for, but people keep moving them to fix it.)

-- 
	-Alan Coopersmith-           alan.coopersmith at sun.com
	 Sun Microsystems, Inc. - X Window System Engineering



More information about the xorg-devel mailing list