mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 03:30:09 +01:00
Returning TRUE for zero makes no sense. Obviously, zero is not a power
of two.
Also, the function is used to check whether a number has only one bit
(flag) set, so, an alternative name would be "has-one-bit-set", which
also should return FALSE for zero. All callers didn't really care for
the previous meaning "has-at-most-one-bit-set".
This also avoids the issue of checking (x >= 0), which causes
-Wtype-limits warnings for unsigned types. Which was avoided
by doing (x == 0 || x > 0), which caused -Wlogical-op warning,
which then was avoided (x == 0 || (x > 0 && 1)). Just don't.
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| certs | ||
| test-compare.c | ||
| test-crypto.c | ||
| test-general-enums.h | ||
| test-general.c | ||
| test-keyfile.c | ||
| test-secrets.c | ||
| test-setting-8021x.c | ||
| test-setting-bond.c | ||
| test-setting-dcb.c | ||
| test-settings-defaults.c | ||