dmx: fix printf format argument warnings

Gets rid of these gcc 4.8 warnings:

dmxinit.c: In function ‘dmxErrorHandler’:
dmxinit.c:167:16: warning: format ‘%x’ expects argument of type ‘unsigned int’,
 but argument 3 has type ‘XID64’ [-Wformat=]
                ev->resourceid);
                ^
dmxinit.c:171:16: warning: format ‘%x’ expects argument of type ‘unsigned int’,
 but argument 3 has type ‘XID64’ [-Wformat=]
                ev->resourceid);
                ^
dmxinit.c:175:16: warning: format ‘%x’ expects argument of type ‘unsigned int’,
 but argument 3 has type ‘XID64’ [-Wformat=]
                ev->resourceid);
                ^
dmxinit.c:181:12: warning: format ‘%d’ expects argument of type ‘int’,
 but argument 3 has type ‘long unsigned int’ [-Wformat=]
            ev->serial);
            ^
dmxinit.c:183:12: warning: format ‘%d’ expects argument of type ‘int’,
 but argument 3 has type ‘long unsigned int’ [-Wformat=]
            dpy->request);
            ^
dmxinit.c: In function ‘InitOutput’:
dmxinit.c:637:9: warning: format ‘%d’ expects argument of type ‘int’,
 but argument 3 has type ‘long unsigned int’ [-Wformat=]
         dmxLog(dmxInfo, "Generation:         %d\n", dmxGeneration);
         ^

dmxprop.c: In function ‘dmxPropertyCheckOtherWindows’:
dmxprop.c:223:24: warning: format ‘%lu’ expects argument of type ‘long
 unsigned int’, but argument 4 has type ‘Window’ [-Wformat=]
                        dmxScreen->name, win, tp.value);
                        ^
dmxprop.c: In function ‘dmxPropertyWindow’:
dmxprop.c:364:16: warning: format ‘%lu’ expects argument of type ‘long
 unsigned int’, but argument 5 has type ‘Window’ [-Wformat=]
                other->index, other->name, other->scrnWin);
                ^
dmxprop.c:364:16: warning: format ‘%lu’ expects argument of type ‘long
 unsigned int’, but argument 8 has type ‘Window’ [-Wformat=]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit f358f0d50c)
This commit is contained in:
Alan Coopersmith 2014-12-12 19:09:36 -08:00 committed by Adam Jackson
parent d4b0ab8332
commit 43251c13d7
2 changed files with 9 additions and 9 deletions

View File

@ -164,23 +164,23 @@ dmxErrorHandler(Display * dpy, XErrorEvent * ev)
switch (ev->error_code) {
case BadValue:
dmxLog(dmxWarning, " Value: 0x%x\n",
ev->resourceid);
(unsigned int) ev->resourceid);
break;
case BadAtom:
dmxLog(dmxWarning, " AtomID: 0x%x\n",
ev->resourceid);
(unsigned int) ev->resourceid);
break;
default:
dmxLog(dmxWarning, " ResourceID: 0x%x\n",
ev->resourceid);
(unsigned int) ev->resourceid);
break;
}
/* Provide serial number information */
dmxLog(dmxWarning, " Failed serial number: %d\n",
ev->serial);
(unsigned int) ev->serial);
dmxLog(dmxWarning, " Current serial number: %d\n",
dpy->request);
(unsigned int) dpy->request);
return 0;
}
@ -634,7 +634,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
if (major > 0 && minor > 0)
year += 2000;
dmxLog(dmxInfo, "Generation: %d\n", dmxGeneration);
dmxLog(dmxInfo, "Generation: %lu\n", dmxGeneration);
dmxLog(dmxInfo, "DMX version: %d.%d.%02d%02d%02d (%s)\n",
major, minor, year, month, day, VENDOR_STRING);

View File

@ -220,7 +220,7 @@ dmxPropertyCheckOtherWindows(DMXScreenInfo * dmxScreen, Atom atom)
if (XGetTextProperty(dpy, win, &tp, atom) && tp.nitems) {
dmxLog(dmxDebug, "On %s/%lu: %s\n",
dmxScreen->name, win, tp.value);
dmxScreen->name, (unsigned long) win, tp.value);
if (!strncmp((char *) tp.value, (char *) id,
strlen((char *) id))) {
int idx;
@ -360,8 +360,8 @@ dmxPropertyWindow(DMXScreenInfo * dmxScreen)
dmxScreen->next = (other->next ? other->next : other);
other->next = (tmp ? tmp : dmxScreen);
dmxLog(dmxDebug, "%d/%s/%lu and %d/%s/%lu are on the same backend\n",
dmxScreen->index, dmxScreen->name, dmxScreen->scrnWin,
other->index, other->name, other->scrnWin);
dmxScreen->index, dmxScreen->name, (unsigned long) dmxScreen->scrnWin,
other->index, other->name, (unsigned long) other->scrnWin);
}
snprintf(buf, sizeof(buf), ".%d,%lu", dmxScreen->index,