[Mesa-dev] [RFC PATCH 3/4] mesa: Drop _mesa_bsearch() wrapper.

Matt Turner mattst88 at gmail.com
Mon Sep 22 11:22:42 PDT 2014


---
 src/mapi/glapi/gen/gl_enums.py |  8 ++++----
 src/mesa/main/imports.c        | 17 -----------------
 src/mesa/main/imports.h        |  4 ----
 3 files changed, 4 insertions(+), 25 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_enums.py b/src/mapi/glapi/gen/gl_enums.py
index 0214932..35919d6 100644
--- a/src/mapi/glapi/gen/gl_enums.py
+++ b/src/mapi/glapi/gen/gl_enums.py
@@ -82,10 +82,10 @@ const char *_mesa_lookup_enum_by_nr( int nr )
 
    STATIC_ASSERT(sizeof(enum_string_table) < (1 << 16));
 
-   elt = _mesa_bsearch(& nr, enum_string_table_offsets,
-                       Elements(enum_string_table_offsets),
-                       sizeof(enum_string_table_offsets[0]),
-                       (cfunc) compar_nr);
+   elt = bsearch(& nr, enum_string_table_offsets,
+                 Elements(enum_string_table_offsets),
+                 sizeof(enum_string_table_offsets[0]),
+                 (cfunc) compar_nr);
 
    if (elt != NULL) {
       return &enum_string_table[elt->offset];
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 75db685..281fe25 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -489,23 +489,6 @@ _mesa_half_to_float(GLhalfARB val)
 
 
 /**********************************************************************/
-/** \name Sort & Search */
-/*@{*/
-
-/**
- * Wrapper for bsearch().
- */
-void *
-_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, 
-               int (*compar)(const void *, const void *) )
-{
-   return bsearch(key, base, nmemb, size, compar);
-}
-
-/*@}*/
-
-
-/**********************************************************************/
 /** \name Environment vars */
 /*@{*/
 
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 59fd19c..bd44525 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -537,10 +537,6 @@ _mesa_half_is_negative(GLhalfARB h)
    return h & 0x8000;
 }
 
-extern void *
-_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, 
-               int (*compar)(const void *, const void *) );
-
 extern char *
 _mesa_getenv( const char *var );
 
-- 
1.8.5.5



More information about the mesa-dev mailing list