Blob Blame Raw
From 5076baca314c08c118d55f353d0f54659e328c65 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Fri, 3 Feb 2017 23:37:57 +0900
Subject: [PATCH 3/5] reset_strip: kill gcc7 -Wint-in-bool-context

gcc7 -Wall now warns:
../../../hacks/glx/glmatrix.c: In function 'reset_strip':
../../../hacks/glx/glmatrix.c:260:28: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context]
  !(random() % (GRID_SIZE-5)*5))
   ~~~~~~~~~~~~~~~~~~~~~~~~~^~~

This warning means that the usage of "*5" is highly questionable
because this multiplication does not change the result of boolean
result (unless such multiplication overflows - which is undefined).

Judging from the comment above this line, perhaps parentheses are
missing.
---
 hacks/glx/glmatrix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hacks/glx/glmatrix.c b/hacks/glx/glmatrix.c
index 47069eb..c02d56c 100644
--- a/hacks/glx/glmatrix.c
+++ b/hacks/glx/glmatrix.c
@@ -257,7 +257,7 @@ reset_strip (ModeInfo *mi, strip *s)
     if (do_clock &&
         !time_displayed_p &&
         (i < GRID_SIZE-5) &&   /* display approx. once per 5 strips */
-	!(random() % (GRID_SIZE-5)*5))
+	!(random() % ((GRID_SIZE-5)*5)))
       {
 	int j;
 	char text[80];
-- 
2.11.1