[PATCH resend xrandr] find_mode: Search for the mode closes to the specified rate

Jeremy Huddleston jeremyhu at apple.com
Sat May 21 17:46:14 PDT 2011


ping

Begin forwarded message:

> From: Jeremy Huddleston <jeremyhu at apple.com>
> Date: May 9, 2011 9:26:34 AM PDT
> To: Keith Packard <keithp at keithp.com>
> Cc: "X.Org Devel List" <xorg-devel at lists.freedesktop.org>
> Subject: [PATCH xrandr] find_mode: Search for the mode closes to the specified rate
> 
> Hey Keith,
> 
> clang found an issue in xrandr that I'd like you to review the fix for.  I'm fairly certain this is what you intended.
> 
> Thanks,
> Jeremy
> 
> For reference:
> http://people.freedesktop.org/~jeremyhu/analyzer/yuffie/20110509-0000/xrandr/report-gZOzCf.html#EndPath
> http://cgit.freedesktop.org/xorg/app/xrandr/commit/?id=d9aeb4a7544ad4a33f6f54bc46bff5cdf231a986
> 
> ---
> 
> From 9f1eb72eea2ba5375be9a2db1e193cda8a50a841 Mon Sep 17 00:00:00 2001
> From: Jeremy Huddleston <jeremyhu at apple.com>
> Date: Mon, 9 May 2011 09:21:29 -0700
> Subject: [PATCH] find_mode: Search for the mode closes to the specified rate
> 
> This was the intention of d9aeb4a7544ad4a33f6f54bc46bff5cdf231a986, but
> find_mode was still picking the first string match rather than the
> match with the closest refresh rate.
> 
> xrandr.c:740:3: warning: Value stored to 'bestDist' is never read
>                bestDist = dist;
>                ^          ~~~~
> 
> Found-by: clang static analyzer
> Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
> ---
> xrandr.c |    1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/xrandr.c b/xrandr.c
> index 564d4da..10d034d 100644
> --- a/xrandr.c
> +++ b/xrandr.c
> @@ -740,7 +740,6 @@ find_mode (name_t *name, double refresh)
> 		bestDist = dist;
> 		best = mode;
> 	    }
> -	    break;
> 	}
>     }
>     return best;
> -- 
> 1.7.4.4
> 
> 



More information about the xorg-devel mailing list