diff options
author | Thomas Haller <thaller@redhat.com> | 2017-04-17 13:19:36 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-04-17 13:19:47 +0200 |
commit | d58d8d7518d177dd4d73157c60274c3b650daacf (patch) | |
tree | 5573eb63a870abfe514d2855ab9542acd91477e0 | |
parent | bacb68f3f6f65fdcc5542d030a69cfbd1895dc62 (diff) | |
download | NetworkManager-d58d8d7518d177dd4d73157c60274c3b650daacf.tar.gz |
test: fix undefined behavior shifting signed integer in test
-rw-r--r-- | libnm-core/tests/test-general.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c index 0d6cb5322d..30f80303b6 100644 --- a/libnm-core/tests/test-general.c +++ b/libnm-core/tests/test-general.c @@ -4966,7 +4966,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); } @@ -4977,7 +4977,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; |