[glib] GParam: make G_PARAM_USER_MASK unsigned
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] GParam: make G_PARAM_USER_MASK unsigned
- Date: Fri, 2 Dec 2016 19:11:29 +0000 (UTC)
commit 5e7eaaaaeead0925a9267515ad583357f44274b0
Author: Simon McVittie <smcv debian org>
Date: Thu Dec 1 17:06:15 2016 +0000
GParam: make G_PARAM_USER_MASK unsigned
UBSan considers left-shifting a negative number to be undefined
behaviour (per
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_081.html> it is
implementation-defined in C89, but according to
<https://llvm.org/bugs/show_bug.cgi?id=17490> it is undefined in C99).
Signed-off-by: Simon McVittie <smcv debian org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=775510
Reviewed-by: Colin Walters
gobject/gparam.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gobject/gparam.c b/gobject/gparam.c
index 472ea3d..f50793a 100644
--- a/gobject/gparam.c
+++ b/gobject/gparam.c
@@ -51,7 +51,7 @@
/* --- defines --- */
#define PARAM_FLOATING_FLAG 0x2
-#define G_PARAM_USER_MASK (~0 << G_PARAM_USER_SHIFT)
+#define G_PARAM_USER_MASK (~0U << G_PARAM_USER_SHIFT)
#define PSPEC_APPLIES_TO_VALUE(pspec, value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_PARAM_SPEC_VALUE_TYPE
(pspec)))
/* --- prototypes --- */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]