diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-01-05 22:46:24 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-01-05 22:46:24 +0100 |
commit | a261b72435d7d30dbe36529a51fc53f6ade34dff (patch) | |
tree | fde666b59abbe3bdf0ed574147344c0d25075b03 /nx-X11/programs/Xserver/hw/nxagent/Visual.c | |
parent | 0e2b7479cd4567128fbcd975e5376744d78cd416 (diff) | |
parent | adca0cc92abed6f7f6184b91d807a4befb80e856 (diff) | |
download | nx-libs-a261b72435d7d30dbe36529a51fc53f6ade34dff.tar.gz nx-libs-a261b72435d7d30dbe36529a51fc53f6ade34dff.tar.bz2 nx-libs-a261b72435d7d30dbe36529a51fc53f6ade34dff.zip |
Merge branch 'uli42-pr/code_cleanup' into 3.6.x
Attributes GH PR #869: https://github.com/ArcticaProject/nx-libs/pull/869
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; |