mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-04 05:58:08 +02:00
test: fix undefined behavior shifting signed integer in test
(cherry picked from commit d58d8d7518)
This commit is contained in:
parent
928d68d04a
commit
297ad945f5
1 changed files with 2 additions and 2 deletions
|
|
@ -4891,7 +4891,7 @@ test_nm_utils_is_power_of_two (void)
|
|||
if (i == -1)
|
||||
xyes = 0;
|
||||
else {
|
||||
xyes = (1LL << i);
|
||||
xyes = (((guint64) 1) << i);
|
||||
g_assert (xyes != 0);
|
||||
}
|
||||
|
||||
|
|
@ -4902,7 +4902,7 @@ again:
|
|||
* by randomly setting bits. */
|
||||
numbits = g_rand_int_range (rand, 1, 65);
|
||||
while (xno != ~((guint64) 0) && numbits > 0) {
|
||||
guint64 v = (1LL << g_rand_int_range (rand, 0, 64));
|
||||
guint64 v = (((guint64) 1) << g_rand_int_range (rand, 0, 64));
|
||||
|
||||
if ((xno | v) != xno) {
|
||||
xno |= v;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue