[PATCH xrandr] Split verbose mode printing into a helper function
Kenneth Graunke
kenneth at whitecape.org
Wed Apr 22 00:10:04 PDT 2015
On Thursday, April 09, 2015 11:18:58 AM Aaron Plattner wrote:
> Combine the two forms of verbose mode printing into a single function. Pass the
> 'current' and 'preferred' flags as arguments. This fixes the code that prints
> unassociated modes to print the flags as well.
>
> Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
> ---
> xrandr.c | 62 ++++++++++++++++++++++++++++++--------------------------------
> 1 file changed, 30 insertions(+), 32 deletions(-)
>
> diff --git a/xrandr.c b/xrandr.c
> index 8a345427a226..5be2167d724f 100644
> --- a/xrandr.c
> +++ b/xrandr.c
> @@ -566,7 +566,7 @@ mode_geometry (XRRModeInfo *mode_info, Rotation rotation,
>
> /* v refresh frequency in Hz */
> static double
> -mode_refresh (XRRModeInfo *mode_info)
> +mode_refresh (const XRRModeInfo *mode_info)
> {
> double rate;
> double vTotal = mode_info->vTotal;
> @@ -592,7 +592,7 @@ mode_refresh (XRRModeInfo *mode_info)
>
> /* h sync frequency in Hz */
> static double
> -mode_hsync (XRRModeInfo *mode_info)
> +mode_hsync (const XRRModeInfo *mode_info)
> {
> double rate;
>
> @@ -603,6 +603,30 @@ mode_hsync (XRRModeInfo *mode_info)
> return rate;
> }
>
> +static void print_verbose_mode (const XRRModeInfo *mode, Bool current,
> + Bool preferred)
> +{
Seems like maybe "static void" should be on its own line, but I'm not
familiar with the coding style in xrandr.
This looks correct to me, looks like a nice cleanup, and printing the
flags seems sensible (though I've never read xrandr code before).
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150422/dbf45842/attachment-0001.sig>
More information about the xorg-devel
mailing list