|
|
f986aa |
From 215a01f1513f918e7295a8a477d4674f7b8085f0 Mon Sep 17 00:00:00 2001
|
|
|
f986aa |
From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
|
|
|
f986aa |
Date: Wed, 18 Jan 2017 08:52:23 +0100
|
|
|
f986aa |
Subject: [PATCH app/xrandr] xrandr: suppress misleading indentation warning
|
|
|
f986aa |
|
|
|
f986aa |
When printing out rotations, we print a space before any item other than
|
|
|
f986aa |
the first, and set `first = False` in each block where we print.
|
|
|
f986aa |
However, this is done in the same line as the conditional that checks if
|
|
|
f986aa |
first is set, which may give the impression that the assignment is also
|
|
|
f986aa |
under the conditional. This is not the case, and recent GCC warns about
|
|
|
f986aa |
this.
|
|
|
f986aa |
|
|
|
f986aa |
Move the assignment to after we print the value we want to print, which
|
|
|
f986aa |
(1) doesn't mislead about the indentation, and
|
|
|
f986aa |
(2) makes logical sense as the _next_ entry is what won't be the first.
|
|
|
f986aa |
|
|
|
f986aa |
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
|
|
|
f986aa |
---
|
|
|
f986aa |
xrandr.c | 6 ++++--
|
|
|
f986aa |
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
f986aa |
|
|
|
f986aa |
diff --git a/xrandr.c b/xrandr.c
|
|
|
f986aa |
index dcfdde0..2aad946 100644
|
|
|
f986aa |
--- a/xrandr.c
|
|
|
f986aa |
+++ b/xrandr.c
|
|
|
f986aa |
@@ -3703,14 +3703,16 @@ main (int argc, char **argv)
|
|
|
f986aa |
printf (" (");
|
|
|
f986aa |
for (i = 0; i < 4; i ++) {
|
|
|
f986aa |
if ((rotations >> i) & 1) {
|
|
|
f986aa |
- if (!first) printf (" "); first = False;
|
|
|
f986aa |
+ if (!first) printf (" ");
|
|
|
f986aa |
printf("%s", direction[i]);
|
|
|
f986aa |
+ first = False;
|
|
|
f986aa |
}
|
|
|
f986aa |
}
|
|
|
f986aa |
if (rotations & RR_Reflect_X)
|
|
|
f986aa |
{
|
|
|
f986aa |
- if (!first) printf (" "); first = False;
|
|
|
f986aa |
+ if (!first) printf (" ");
|
|
|
f986aa |
printf ("x axis");
|
|
|
f986aa |
+ first = False;
|
|
|
f986aa |
}
|
|
|
f986aa |
if (rotations & RR_Reflect_Y)
|
|
|
f986aa |
{
|
|
|
f986aa |
--
|
|
|
f986aa |
2.17.1
|
|
|
f986aa |
|