[PATCH xrandr 5/5] Cast XID to unsigned int to suppress a printf warning
Aaron Plattner
aplattner at nvidia.com
Wed Feb 6 14:38:36 PST 2013
Sorry I forgot about this in commit 138b6252c0cae6599b6c8a25ffa22ffe70f227c2.
That change introduced a warning:
xrandr.c|645 col 5| warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘XID’ [-Wformat]
Fix that by just casting the XID to unsigned int.
Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
---
xrandr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xrandr.c b/xrandr.c
index 7fb0b0b..adc11a6 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -642,7 +642,7 @@ print_name (const name_t *name)
{
name_kind_t kind = name->kind;
- if ((kind & name_xid)) return printf("XID 0x%x", name->xid);
+ if ((kind & name_xid)) return printf("XID 0x%x", (unsigned int)name->xid);
else if ((kind & name_string)) return printf("name %s", name->string);
else if ((kind & name_index)) return printf("index %d", name->index);
else return printf("unknown name");
--
1.7.12
More information about the xorg-devel
mailing list