[Mesa-dev] [PATCH 03/16] xmlconfig: remove GL type dependencies

Nicolai Hähnle nhaehnle at gmail.com
Fri Jun 30 12:45:44 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

---
 src/mesa/drivers/dri/common/xmlconfig.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c
index d464937..9bd587b 100644
--- a/src/mesa/drivers/dri/common/xmlconfig.c
+++ b/src/mesa/drivers/dri/common/xmlconfig.c
@@ -29,22 +29,20 @@
 
 #include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
 #include <expat.h>
 #include <fcntl.h>
 #include <math.h>
 #include <unistd.h>
 #include <errno.h>
-#include "main/imports.h"
-#include "utils.h"
 #include "xmlconfig.h"
 
 #undef GET_PROGRAM_NAME
 
 #if (defined(__GNU_LIBRARY__) || defined(__GLIBC__)) && !defined(__UCLIBC__)
 #    if !defined(__GLIBC__) || (__GLIBC__ < 2)
 /* These aren't declared in any libc5 header */
 extern char *program_invocation_name, *program_invocation_short_name;
 #    endif
 #    define GET_PROGRAM_NAME() program_invocation_short_name
@@ -325,21 +323,21 @@ parseValue(driOptionValue *v, driOptionType type, const XML_Char *string)
       case DRI_ENUM: /* enum is just a special integer */
       case DRI_INT:
         v->_int = strToI (string, &tail, 0);
         break;
       case DRI_FLOAT:
         v->_float = strToF (string, &tail);
         break;
       case DRI_STRING:
         free (v->_string);
         v->_string = strndup(string, STRING_CONF_MAXLEN);
-        return GL_TRUE;
+        return true;
     }
 
     if (tail == string)
         return false; /* empty string (or containing only white-space) */
   /* skip trailing white space */
     if (*tail)
         tail += strspn (tail, " \f\n\r\t\v");
     if (*tail)
         return false; /* something left over that is not part of value */
 
@@ -915,21 +913,21 @@ optConfEndElem(void *userData, const XML_Char *name)
         break;
       default:
         /* unknown element, warning was produced on start tag */;
     }
 }
 
 /** \brief Initialize an option cache based on info */
 static void
 initOptionCache(driOptionCache *cache, const driOptionCache *info)
 {
-    GLuint i, size = 1 << info->tableSize;
+    unsigned i, size = 1 << info->tableSize;
     cache->info = info->info;
     cache->tableSize = info->tableSize;
     cache->values = malloc((1<<info->tableSize) * sizeof (driOptionValue));
     if (cache->values == NULL) {
         fprintf (stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__);
         abort();
     }
     memcpy (cache->values, info->values,
             (1<<info->tableSize) * sizeof (driOptionValue));
     for (i = 0; i < size; ++i) {
@@ -1047,21 +1045,21 @@ driDestroyOptionInfo(driOptionCache *info)
             }
         }
         free(info->info);
     }
 }
 
 void
 driDestroyOptionCache(driOptionCache *cache)
 {
     if (cache->info) {
-        GLuint i, size = 1 << cache->tableSize;
+        unsigned i, size = 1 << cache->tableSize;
         for (i = 0; i < size; ++i) {
             if (cache->info[i].type == DRI_STRING)
                 free(cache->values[i]._string);
         }
     }
     free(cache->values);
 }
 
 unsigned char
 driCheckOption(const driOptionCache *cache, const char *name,
@@ -1097,16 +1095,16 @@ driQueryOptionf(const driOptionCache *cache, const char *name)
     uint32_t i = findOption (cache, name);
   /* make sure the option is defined and has the correct type */
     assert (cache->info[i].name != NULL);
     assert (cache->info[i].type == DRI_FLOAT);
     return cache->values[i]._float;
 }
 
 char *
 driQueryOptionstr(const driOptionCache *cache, const char *name)
 {
-    GLuint i = findOption (cache, name);
+    uint32_t i = findOption (cache, name);
   /* make sure the option is defined and has the correct type */
     assert (cache->info[i].name != NULL);
     assert (cache->info[i].type == DRI_STRING);
     return cache->values[i]._string;
 }
-- 
2.9.3



More information about the mesa-dev mailing list