glx: be explicit about when mapping X <> GLX visuals
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 6 Sep 2018 10:25:38 +0000 (11:25 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 1 Nov 2018 00:05:43 +0000 (00:05 +0000)
Write down both X and GLX visual types when mapping from one to the
other. Makes grepping through the code a tiny bit easier.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glx/glxext.c

index ca3bf9d027f6f56e6f1ff6bffb854995b0c750eb..cef81920356e8a69f7a27ef9239fb915611cbe42 100644 (file)
@@ -343,9 +343,12 @@ static GLint
 convert_from_x_visual_type(int visualType)
 {
    static const int glx_visual_types[] = {
-      GLX_STATIC_GRAY, GLX_GRAY_SCALE,
-      GLX_STATIC_COLOR, GLX_PSEUDO_COLOR,
-      GLX_TRUE_COLOR, GLX_DIRECT_COLOR
+      [StaticGray]  = GLX_STATIC_GRAY,
+      [GrayScale]   = GLX_GRAY_SCALE,
+      [StaticColor] = GLX_STATIC_COLOR,
+      [PseudoColor] = GLX_PSEUDO_COLOR,
+      [TrueColor]   = GLX_TRUE_COLOR,
+      [DirectColor] = GLX_DIRECT_COLOR,
    };
 
    if (visualType < ARRAY_SIZE(glx_visual_types))