Commit b5b7a2d2 authored by Mike Gabriel's avatar Mike Gabriel

hw/nxagent/Screen.c: Cast proper types before handing values over to fprintf().

Amends the following compiler warnings: ``` Screen.c: In function ‘nxagentCreateIconWindow’: Screen.c:394:15: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘Window’ [-Wformat=] nxagentIconWindow); ^ Screen.c: In function ‘nxagentSetScreenSaverTime’: Screen.c:456:19: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘CARD32’ [-Wformat=] ScreenSaverTime, ScreenSaverInterval); ^ Screen.c:456:19: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘CARD32’ [-Wformat=] Screen.c:476:19: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘CARD32’ [-Wformat=] ScreenSaverTime, ScreenSaverInterval); ^ Screen.c:476:19: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘CARD32’ [-Wformat=] Screen.c: In function ‘nxagentOpenScreen’: Screen.c:1234:19: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘VisualID’ [-Wformat=] visuals[numVisuals].vid); ^ Screen.c:1274:23: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘VisualID’ [-Wformat=] depths[depthIndex].depth); ^ Screen.c:1282:17: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘VisualID’ [-Wformat=] defaultVisualIndex, visuals[defaultVisualIndex].vid); ^ Screen.c:1319:19: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘VisualID’ [-Wformat=] rootDepth, defaultVisual); ^ Screen.c:1336:19: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘VisualID’ [-Wformat=] rootDepth, defaultVisual); ^ Screen.c:1348:19: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘VisualID’ [-Wformat=] rootDepth, defaultVisual); ^ Screen.c:1357:19: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘VisualID’ [-Wformat=] rootDepth, defaultVisual); ^ Screen.c:1723:21: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘Window’ [-Wformat=] nxagentDefaultWindows[pScreen->myNum]); ^ Screen.c:1763:19: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘Window’ [-Wformat=] nxagentDefaultWindows[pScreen->myNum]); ^ Screen.c:1775:17: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘Window’ [-Wformat=] nxagentDefaultWindows[pScreen->myNum]); ^ Screen.c:1790:17: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘Window’ [-Wformat=] nxagentDefaultWindows[pScreen->myNum]); ^ Screen.c: In function ‘nxagentShadowAdaptDepth’: Screen.c:3189:14: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat=] pVisual -> red_mask, pVisual -> green_mask, pVisual -> blue_mask); ^ Screen.c:3189:14: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat=] Screen.c:3189:14: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ [-Wformat=] Screen.c:3198:15: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat=] redMask, greenMask, blueMask); ^ Screen.c:3198:15: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat=] Screen.c:3198:15: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ [-Wformat=] ```
parent ab50f84b
...@@ -391,8 +391,8 @@ Window nxagentCreateIconWindow() ...@@ -391,8 +391,8 @@ Window nxagentCreateIconWindow()
valuemask, &attributes); valuemask, &attributes);
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCreateIconWindow: Created new icon window with id [%ld].\n", fprintf(stderr, "nxagentCreateIconWindow: Created new icon window with id [%lu].\n",
nxagentIconWindow); (long unsigned int)nxagentIconWindow);
#endif #endif
/* /*
...@@ -454,7 +454,7 @@ void nxagentSetScreenSaverTime(void) ...@@ -454,7 +454,7 @@ void nxagentSetScreenSaverTime(void)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSetScreenSaverTime: ScreenSaverTime was [%lu], ScreenSaverInterval was [%lu].\n", fprintf(stderr, "nxagentSetScreenSaverTime: ScreenSaverTime was [%lu], ScreenSaverInterval was [%lu].\n",
ScreenSaverTime, ScreenSaverInterval); (long unsigned int)ScreenSaverTime, (long unsigned int)ScreenSaverInterval);
#endif #endif
/* /*
...@@ -474,7 +474,7 @@ void nxagentSetScreenSaverTime(void) ...@@ -474,7 +474,7 @@ void nxagentSetScreenSaverTime(void)
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSetScreenSaverTime: ScreenSaverTime now is [%lu], ScreenSaverInterval now is [%lu].\n", fprintf(stderr, "nxagentSetScreenSaverTime: ScreenSaverTime now is [%lu], ScreenSaverInterval now is [%lu].\n",
ScreenSaverTime, ScreenSaverInterval); (long unsigned int)ScreenSaverTime, (long unsigned int)ScreenSaverInterval);
#endif #endif
} }
...@@ -1232,7 +1232,7 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, ...@@ -1232,7 +1232,7 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
#if defined(DEBUG) || defined(DEBUG_COLORMAP) #if defined(DEBUG) || defined(DEBUG_COLORMAP)
fprintf(stderr, "Debug: Added visual [%lu].\n" , fprintf(stderr, "Debug: Added visual [%lu].\n" ,
visuals[numVisuals].vid); (long unsigned int)visuals[numVisuals].vid);
#endif #endif
for (j = 0; j < numDepths; j++) for (j = 0; j < numDepths; j++)
...@@ -1271,7 +1271,7 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, ...@@ -1271,7 +1271,7 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
#if defined(DEBUG) || defined(DEBUG_COLORMAP) #if defined(DEBUG) || defined(DEBUG_COLORMAP)
fprintf(stderr, "Debug: Registered visual [%lu] for depth [%d (%d)].\n" , fprintf(stderr, "Debug: Registered visual [%lu] for depth [%d (%d)].\n" ,
visuals[numVisuals].vid, depthIndex, (long unsigned int)visuals[numVisuals].vid, depthIndex,
depths[depthIndex].depth); depths[depthIndex].depth);
#endif #endif
...@@ -1280,7 +1280,7 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, ...@@ -1280,7 +1280,7 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
#if defined(DEBUG) || defined(DEBUG_COLORMAP) #if defined(DEBUG) || defined(DEBUG_COLORMAP)
fprintf(stderr, "Debug: Setting default visual [%d (%lu)].\n", fprintf(stderr, "Debug: Setting default visual [%d (%lu)].\n",
defaultVisualIndex, visuals[defaultVisualIndex].vid); defaultVisualIndex, (long unsigned int)visuals[defaultVisualIndex].vid);
fprintf(stderr, "Debug: Setting root depth [%d].\n", fprintf(stderr, "Debug: Setting root depth [%d].\n",
visuals[defaultVisualIndex].nplanes); visuals[defaultVisualIndex].nplanes);
...@@ -1316,8 +1316,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, ...@@ -1316,8 +1316,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
#if defined(DEBUG) || defined(DEBUG_COLORMAP) #if defined(DEBUG) || defined(DEBUG_COLORMAP)
fprintf(stderr, "nxagentOpenScreen: Before fbScreenInit numVisuals [%d] numDepths [%d] " fprintf(stderr, "nxagentOpenScreen: Before fbScreenInit numVisuals [%d] numDepths [%d] "
"rootDepth [%d] defaultVisual [%ld].\n", numVisuals, numDepths, "rootDepth [%d] defaultVisual [%lu].\n", numVisuals, numDepths,
rootDepth, defaultVisual); rootDepth, (long unsigned int)defaultVisual);
#endif #endif
if (monitorResolution < 1) if (monitorResolution < 1)
...@@ -1333,8 +1333,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, ...@@ -1333,8 +1333,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
#if defined(DEBUG) || defined(DEBUG_COLORMAP) #if defined(DEBUG) || defined(DEBUG_COLORMAP)
fprintf(stderr, "nxagentOpenScreen: After fbScreenInit numVisuals [%d] numDepths [%d] " fprintf(stderr, "nxagentOpenScreen: After fbScreenInit numVisuals [%d] numDepths [%d] "
"rootDepth [%d] defaultVisual [%ld].\n", numVisuals, numDepths, "rootDepth [%d] defaultVisual [%lu].\n", numVisuals, numDepths,
rootDepth, defaultVisual); rootDepth, (long unsigned int)defaultVisual);
#endif #endif
/* /*
...@@ -1345,8 +1345,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, ...@@ -1345,8 +1345,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
#if defined(DEBUG) || defined(DEBUG_COLORMAP) #if defined(DEBUG) || defined(DEBUG_COLORMAP)
fprintf(stderr, "nxagentOpenScreen: Before GLX numVisuals [%d] numDepths [%d] " fprintf(stderr, "nxagentOpenScreen: Before GLX numVisuals [%d] numDepths [%d] "
"rootDepth [%d] defaultVisual [%ld].\n", numVisuals, numDepths, "rootDepth [%d] defaultVisual [%lu].\n", numVisuals, numDepths,
rootDepth, defaultVisual); rootDepth, (long unsigned int)defaultVisual);
#endif #endif
nxagentInitGlxExtension(&visuals, &depths, &numVisuals, &numDepths, nxagentInitGlxExtension(&visuals, &depths, &numVisuals, &numDepths,
...@@ -1354,8 +1354,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, ...@@ -1354,8 +1354,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
#if defined(DEBUG) || defined(DEBUG_COLORMAP) #if defined(DEBUG) || defined(DEBUG_COLORMAP)
fprintf(stderr, "nxagentOpenScreen: After GLX numVisuals [%d] numDepths [%d] " fprintf(stderr, "nxagentOpenScreen: After GLX numVisuals [%d] numDepths [%d] "
"rootDepth [%d] defaultVisual [%ld].\n", numVisuals, numDepths, "rootDepth [%d] defaultVisual [%lu].\n", numVisuals, numDepths,
rootDepth, defaultVisual); rootDepth, (long unsigned int)defaultVisual);
#endif #endif
/* /*
...@@ -1721,7 +1721,7 @@ N/A ...@@ -1721,7 +1721,7 @@ N/A
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Using root window id [%ld].\n", fprintf(stderr, "nxagentOpenScreen: Using root window id [%ld].\n",
nxagentDefaultWindows[pScreen->myNum]); (long int)nxagentDefaultWindows[pScreen->myNum]);
#endif #endif
} }
...@@ -1761,7 +1761,7 @@ N/A ...@@ -1761,7 +1761,7 @@ N/A
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Created new default window with id [%ld].\n", fprintf(stderr, "nxagentOpenScreen: Created new default window with id [%ld].\n",
nxagentDefaultWindows[pScreen->myNum]); (long int)nxagentDefaultWindows[pScreen->myNum]);
#endif #endif
/* /*
...@@ -1773,7 +1773,7 @@ N/A ...@@ -1773,7 +1773,7 @@ N/A
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window withid [%ld].\n", fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window withid [%ld].\n",
nxagentDefaultWindows[pScreen->myNum]); (long int)nxagentDefaultWindows[pScreen->myNum]);
#endif #endif
XClassHint hint; XClassHint hint;
hint.res_name=malloc(strlen("X2GoAgent")+1); hint.res_name=malloc(strlen("X2GoAgent")+1);
...@@ -1788,7 +1788,7 @@ N/A ...@@ -1788,7 +1788,7 @@ N/A
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window withid [%ld].\n", fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window withid [%ld].\n",
nxagentDefaultWindows[pScreen->myNum]); (long int)nxagentDefaultWindows[pScreen->myNum]);
#endif #endif
XClassHint hint; XClassHint hint;
...@@ -3186,7 +3186,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height, ...@@ -3186,7 +3186,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height,
} }
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCorrectDepthShadow: Shadow redMask [%x] greenMask[%x] blueMask[%x].\n", fprintf(stderr, "nxagentCorrectDepthShadow: Shadow redMask [%lu] greenMask[%lu] blueMask[%lu].\n",
pVisual -> red_mask, pVisual -> green_mask, pVisual -> blue_mask); pVisual -> red_mask, pVisual -> green_mask, pVisual -> blue_mask);
#endif #endif
...@@ -3195,7 +3195,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height, ...@@ -3195,7 +3195,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height,
blueMask = nxagentShadowDisplay -> screens[0].root_visual[0].blue_mask; blueMask = nxagentShadowDisplay -> screens[0].root_visual[0].blue_mask;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCorrectDepthShadow: Master redMask [%x] greenMask[%x] blueMask[%x].\n", fprintf(stderr, "nxagentCorrectDepthShadow: Master redMask [%lu] greenMask[%lu] blueMask[%lu].\n",
redMask, greenMask, blueMask); redMask, greenMask, blueMask);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment