mesa: fix some misc breakage caused by editing auto-generated files rather than the...
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 10 Nov 2008 21:42:02 +0000 (14:42 -0700)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 10 Nov 2008 21:42:02 +0000 (14:42 -0700)
Specifically:
  #include "glapitable.h" in src/mesa/main/glapi/dispatch.h
  Call _mesa_bsearch() in src/mesa/main/enums.c.

src/mesa/glapi/dispatch.h
src/mesa/glapi/gl_enums.py
src/mesa/glapi/gl_table.py
src/mesa/main/enums.c

index 712315608529e660587d66235e71df214779db37..f019aa6aafeb31fac194162290657fd02352aad3 100644 (file)
@@ -28,6 +28,8 @@
 #if !defined( _DISPATCH_H_ )
 #  define _DISPATCH_H_
 
+
+#include "glapitable.h"
 /**
  * \file dispatch.h
  * Macros for handling GL dispatch tables.
index 0e3c57042a65d2caa3052bab9a52eb18ec3d11ac..67fec7968a97d56b8900cf0dbc01321f771184c6 100644 (file)
@@ -96,8 +96,10 @@ const char *_mesa_lookup_enum_by_nr( int nr )
 {
    unsigned * i;
 
-   i = (unsigned *)bsearch( & nr, reduced_enums, Elements(reduced_enums),
-                            sizeof(reduced_enums[0]), (cfunc) compar_nr );
+   i = (unsigned *) _mesa_bsearch(& nr, reduced_enums,
+                                  Elements(reduced_enums),
+                                  sizeof(reduced_enums[0]),
+                                  (cfunc) compar_nr);
 
    if ( i != NULL ) {
       return & enum_string_table[ all_enums[ *i ].offset ];
@@ -114,8 +116,10 @@ int _mesa_lookup_enum_by_name( const char *symbol )
    enum_elt * f = NULL;
 
    if ( symbol != NULL ) {
-      f = (enum_elt *)bsearch( symbol, all_enums, Elements(all_enums),
-                              sizeof( enum_elt ), (cfunc) compar_name );
+      f = (enum_elt *) _mesa_bsearch(symbol, all_enums,
+                                     Elements(all_enums),
+                                     sizeof( enum_elt ),
+                                     (cfunc) compar_name);
    }
 
    return (f != NULL) ? f->n : -1;
index 7023a4b71a329fd749c67f98e22bcd8db2de69ec..55a33748aed344203cd023813a660710c4975b25 100644 (file)
@@ -78,7 +78,9 @@ class PrintRemapTable(gl_XML.gl_print_base):
 
 
        def printRealHeader(self):
-               print """/**
+               print """
+#include "glapitable.h"
+/**
  * \\file dispatch.h
  * Macros for handling GL dispatch tables.
  *
index a9c102e4f2df47ee02c7d34793afbc3b427b6c6e..4796f3027ad2e61d4f158e48d3a714d3a58c0147 100644 (file)
@@ -4866,8 +4866,10 @@ const char *_mesa_lookup_enum_by_nr( int nr )
 {
    unsigned * i;
 
-   i = (unsigned *)bsearch( & nr, reduced_enums, Elements(reduced_enums),
-                            sizeof(reduced_enums[0]), (cfunc) compar_nr );
+   i = (unsigned *) _mesa_bsearch(& nr, reduced_enums,
+                                  Elements(reduced_enums),
+                                  sizeof(reduced_enums[0]),
+                                  (cfunc) compar_nr);
 
    if ( i != NULL ) {
       return & enum_string_table[ all_enums[ *i ].offset ];
@@ -4884,8 +4886,10 @@ int _mesa_lookup_enum_by_name( const char *symbol )
    enum_elt * f = NULL;
 
    if ( symbol != NULL ) {
-      f = (enum_elt *)bsearch( symbol, all_enums, Elements(all_enums),
-                              sizeof( enum_elt ), (cfunc) compar_name );
+      f = (enum_elt *) _mesa_bsearch(symbol, all_enums,
+                                     Elements(all_enums),
+                                     sizeof( enum_elt ),
+                                     (cfunc) compar_name);
    }
 
    return (f != NULL) ? f->n : -1;