diff options
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Visual.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Visual.c | 55 |
1 files changed, 23 insertions, 32 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Visual.c b/nx-X11/programs/Xserver/hw/nxagent/Visual.c index a29560d43..6be82148f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Visual.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Visual.c @@ -64,19 +64,17 @@ Visual nxagentAlphaVisual; Visual *nxagentVisual(VisualPtr pVisual) { - XVisualInfo visual; - - int i; - - visual.class = pVisual->class; - visual.bits_per_rgb = pVisual->bitsPerRGBValue; - visual.colormap_size = pVisual->ColormapEntries; - visual.depth = pVisual->nplanes; - visual.red_mask = pVisual->redMask; - visual.green_mask = pVisual->greenMask; - visual.blue_mask = pVisual->blueMask; - - for (i = 0; i < nxagentNumVisuals; i++) + XVisualInfo visual = { + .class = pVisual->class, + .bits_per_rgb = pVisual->bitsPerRGBValue, + .colormap_size = pVisual->ColormapEntries, + .depth = pVisual->nplanes, + .red_mask = pVisual->redMask, + .green_mask = pVisual->greenMask, + .blue_mask = pVisual->blueMask + }; + + for (int i = 0; i < nxagentNumVisuals; i++) { if (nxagentCompareVisuals(visual, nxagentVisuals[i]) == 1) { @@ -89,9 +87,7 @@ Visual *nxagentVisual(VisualPtr pVisual) Visual *nxagentVisualFromID(ScreenPtr pScreen, VisualID visual) { - int i; - - for (i = 0; i < pScreen->numVisuals; i++) + for (int i = 0; i < pScreen->numVisuals; i++) { if (pScreen->visuals[i].vid == visual) { @@ -104,9 +100,7 @@ Visual *nxagentVisualFromID(ScreenPtr pScreen, VisualID visual) Colormap nxagentDefaultVisualColormap(Visual *visual) { - int i; - - for (i = 0; i < nxagentNumVisuals; i++) + for (int i = 0; i < nxagentNumVisuals; i++) { if (nxagentVisuals[i].visual == visual) { @@ -117,18 +111,16 @@ Colormap nxagentDefaultVisualColormap(Visual *visual) return None; } +#if 0 /* - * This is currently unused. It should serve - * the scope of matching a visual whenever - * a drawable has a different depth than the - * real display. + * This is currently unused. It should serve the scope of matching a + * visual whenever a drawable has a different depth than the real + * display. */ Visual *nxagentVisualFromDepth(ScreenPtr pScreen, int depth) { - int i; - - for (i = 0; i < pScreen->numVisuals; i++) + for (int i = 0; i < pScreen->numVisuals; i++) { if (pScreen->visuals[i].nplanes == depth) { @@ -138,11 +130,11 @@ Visual *nxagentVisualFromDepth(ScreenPtr pScreen, int depth) return NULL; } +#endif /* - * Create a fake 32 bits depth visual and - * initialize it based on the endianness - * of the remote display. + * Create a fake 32 bits depth visual and initialize it based on the + * endianness of the remote display. */ void nxagentInitAlphaVisual(void) @@ -150,9 +142,8 @@ void nxagentInitAlphaVisual(void) nxagentAlphaVisual.visualid = XAllocID(nxagentDisplay); /* - * Color masks are referred to bits inside - * the pixel. This is independent from the - * endianness. + * Color masks are referred to bits inside the pixel. This is + * independent from the endianness. */ nxagentAlphaVisual.red_mask = 0x00ff0000; |