|
|
e09d503 |
From 5076baca314c08c118d55f353d0f54659e328c65 Mon Sep 17 00:00:00 2001
|
|
|
e09d503 |
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
|
|
|
e09d503 |
Date: Fri, 3 Feb 2017 23:37:57 +0900
|
|
|
e09d503 |
Subject: [PATCH 3/5] reset_strip: kill gcc7 -Wint-in-bool-context
|
|
|
e09d503 |
|
|
|
e09d503 |
gcc7 -Wall now warns:
|
|
|
e09d503 |
../../../hacks/glx/glmatrix.c: In function 'reset_strip':
|
|
|
e09d503 |
../../../hacks/glx/glmatrix.c:260:28: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context]
|
|
|
e09d503 |
!(random() % (GRID_SIZE-5)*5))
|
|
|
e09d503 |
~~~~~~~~~~~~~~~~~~~~~~~~~^~~
|
|
|
e09d503 |
|
|
|
e09d503 |
This warning means that the usage of "*5" is highly questionable
|
|
|
e09d503 |
because this multiplication does not change the result of boolean
|
|
|
e09d503 |
result (unless such multiplication overflows - which is undefined).
|
|
|
e09d503 |
|
|
|
e09d503 |
Judging from the comment above this line, perhaps parentheses are
|
|
|
e09d503 |
missing.
|
|
|
e09d503 |
---
|
|
|
e09d503 |
hacks/glx/glmatrix.c | 2 +-
|
|
|
e09d503 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
e09d503 |
|
|
|
e09d503 |
diff --git a/hacks/glx/glmatrix.c b/hacks/glx/glmatrix.c
|
|
|
e09d503 |
index 47069eb..c02d56c 100644
|
|
|
e09d503 |
--- a/hacks/glx/glmatrix.c
|
|
|
e09d503 |
+++ b/hacks/glx/glmatrix.c
|
|
|
e09d503 |
@@ -257,7 +257,7 @@ reset_strip (ModeInfo *mi, strip *s)
|
|
|
e09d503 |
if (do_clock &&
|
|
|
e09d503 |
!time_displayed_p &&
|
|
|
e09d503 |
(i < GRID_SIZE-5) && /* display approx. once per 5 strips */
|
|
|
e09d503 |
- !(random() % (GRID_SIZE-5)*5))
|
|
|
e09d503 |
+ !(random() % ((GRID_SIZE-5)*5)))
|
|
|
e09d503 |
{
|
|
|
e09d503 |
int j;
|
|
|
e09d503 |
char text[80];
|
|
|
e09d503 |
--
|
|
|
e09d503 |
2.11.1
|
|
|
e09d503 |
|