aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-10-31 01:28:18 +0100
committerUlrich Sibiller <uli42@gmx.de>2020-01-05 22:38:50 +0100
commit5db6217ccdb03f5841498f6c69e338da7f06c04b (patch)
treea41103a5c70c993cdccedaa510e160951cdba2f2 /nx-X11
parentbcca31996c07ee57d7507009b94e8d9c40a37a99 (diff)
downloadnx-libs-5db6217ccdb03f5841498f6c69e338da7f06c04b.tar.gz
nx-libs-5db6217ccdb03f5841498f6c69e338da7f06c04b.tar.bz2
nx-libs-5db6217ccdb03f5841498f6c69e338da7f06c04b.zip
Visual.c: code improvements/desginated initializers
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Visual.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Visual.c b/nx-X11/programs/Xserver/hw/nxagent/Visual.c
index a29560d43..ea73ce50e 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)
{
@@ -126,9 +120,7 @@ Colormap nxagentDefaultVisualColormap(Visual *visual)
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)
{