Mesa (master): mesa: fix some misc breakage caused by editing auto-generated files rather than the python generators

Brian Paul brianp at kemper.freedesktop.org
Mon Nov 10 21:49:39 UTC 2008


Module: Mesa
Branch: master
Commit: 59cc9739400c3a1654c069586070ff218993cd37
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=59cc9739400c3a1654c069586070ff218993cd37

Author: Brian Paul <brian.paul at tungstengraphics.com>
Date:   Mon Nov 10 14:42:02 2008 -0700

mesa: fix some misc breakage caused by editing auto-generated files rather than the python generators

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  |    2 ++
 src/mesa/glapi/gl_enums.py |   12 ++++++++----
 src/mesa/glapi/gl_table.py |    4 +++-
 src/mesa/main/enums.c      |   12 ++++++++----
 4 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h
index 7123156..f019aa6 100644
--- a/src/mesa/glapi/dispatch.h
+++ b/src/mesa/glapi/dispatch.h
@@ -28,6 +28,8 @@
 #if !defined( _DISPATCH_H_ )
 #  define _DISPATCH_H_
 
+
+#include "glapitable.h"
 /**
  * \file dispatch.h
  * Macros for handling GL dispatch tables.
diff --git a/src/mesa/glapi/gl_enums.py b/src/mesa/glapi/gl_enums.py
index 0e3c570..67fec79 100644
--- a/src/mesa/glapi/gl_enums.py
+++ b/src/mesa/glapi/gl_enums.py
@@ -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;
diff --git a/src/mesa/glapi/gl_table.py b/src/mesa/glapi/gl_table.py
index 7023a4b..55a3374 100644
--- a/src/mesa/glapi/gl_table.py
+++ b/src/mesa/glapi/gl_table.py
@@ -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.
  *
diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c
index a9c102e..4796f30 100644
--- a/src/mesa/main/enums.c
+++ b/src/mesa/main/enums.c
@@ -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;




More information about the mesa-commit mailing list