[glib] Fix constant type to match assigned variable type
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Fix constant type to match assigned variable type
- Date: Wed, 19 Dec 2012 19:28:43 +0000 (UTC)
commit 1fec9ac47d157ca28c4efc1c18e5dd98bc39332b
Author: Daniel Macks <dmacks netspace org>
Date: Thu Nov 29 10:33:47 2012 -0500
Fix constant type to match assigned variable type
Some compilers assume a literal value is a certain byte-length without
checking the type to which it is being assigned, giving a compile-time
warning: a default of 'long' is a mismatch when assigning to a guint64
when the latter is a 'long long'. Use one of glib's standard macros to
specify the type of the constant to match the variable type.
https://bugzilla.gnome.org/show_bug.cgi?id=688829
glib/tests/utils.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glib/tests/utils.c b/glib/tests/utils.c
index 9c89bde..1e4fbbc 100644
--- a/glib/tests/utils.c
+++ b/glib/tests/utils.c
@@ -225,8 +225,8 @@ test_swap (void)
g_assert_cmpint (GUINT32_SWAP_LE_BE (a32), ==, b32);
- a64 = 0xaaaaaaaabbbbbbbb;
- b64 = 0xbbbbbbbbaaaaaaaa;
+ a64 = G_GUINT64_CONSTANT(0xaaaaaaaabbbbbbbb);
+ b64 = G_GUINT64_CONSTANT(0xbbbbbbbbaaaaaaaa);
g_assert_cmpint (GUINT64_SWAP_LE_BE (a64), ==, b64);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]