[PATCH xrandr] Split verbose mode printing into a helper function
Aaron Plattner
aplattner at nvidia.com
Wed Apr 22 07:40:57 PDT 2015
On 04/22/2015 12:10 AM, Kenneth Graunke wrote:
> 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.
Good catch.
> 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>
Thanks! I'll get it checked in with the style thing fixed.
--
Aaron
More information about the xorg-devel
mailing list