summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2026-03-10 22:43:34 +0300
committerAlexander Golubev <fatzer2@gmail.com>2026-03-11 21:36:53 +0300
commit709a2722bd05f6e4ed8aa1106874a14892b937d2 (patch)
tree843b1bd6f4e3cc24b0202cdbea9220980b83749b /src/tools
parentae09d05d07fb980ecc5c561cfcd6cadc0ba36b2c (diff)
downloadtqt-Fat-Zer/fix/tqlocale-warning.tar.gz
tqt-Fat-Zer/fix/tqlocale-warning.zip
Fix a -Wlogical-not-parentheses warningFat-Zer/fix/tqlocale-warning
The function returns the number of lowest zero bits of a 32-bit value and shifts the value by that number. By the time it reaches last condition x can be zero if and only if the passed value was zero and hence we can immediately return 32. Initially the condition were likely supposed to be `if (!(x & 1))` but in this particular case it's the same as `!x` and subjectively it makes more sense to just check if the number is zero. See discussion in the #264. See-also: https://mirror.git.trinitydesktop.org/gitea/TDE/tqt/pulls/264 Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/tqlocale.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/tqlocale.cpp b/src/tools/tqlocale.cpp
index e3ab4305d..cabc42ddf 100644
--- a/src/tools/tqlocale.cpp
+++ b/src/tools/tqlocale.cpp
@@ -4430,7 +4430,7 @@ static int lo0bits(ULong *y)
if (!(x & 1)) {
k++;
x >>= 1;
- if (!x & 1)
+ if (!x) // At this point x is zero if and only if the *y was zero
return 32;
}
*y = x;