Blame SOURCES/0001-xrandr-suppress-misleading-indentation-warning.patch

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