Mesa (master): Remove _mesa_strncmp in favor of plain strncmp.

Kristian Høgsberg krh at kemper.freedesktop.org
Fri Feb 19 14:40:59 UTC 2010


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Feb 18 23:50:57 2010 -0800

Remove _mesa_strncmp in favor of plain strncmp.

---

 src/mesa/main/imports.c               |    7 -------
 src/mesa/main/imports.h               |    3 ---
 src/mesa/shader/nvfragparse.c         |    6 +++---
 src/mesa/shader/nvvertparse.c         |    6 +++---
 src/mesa/shader/prog_parameter.c      |    2 +-
 src/mesa/shader/slang/slang_compile.c |    2 +-
 6 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index a48f05c..4c5e99f 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -841,13 +841,6 @@ _mesa_getenv( const char *var )
 /** \name String */
 /*@{*/
 
-/** Wrapper around strncmp() */
-int
-_mesa_strncmp( const char *s1, const char *s2, size_t n )
-{
-   return strncmp(s1, s2, n);
-}
-
 /**
  * Implemented using _mesa_malloc() and strcpy.
  * Note that NULL is handled accordingly.
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 867bce7..3c8f734 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -611,9 +611,6 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size,
 extern char *
 _mesa_getenv( const char *var );
 
-extern int
-_mesa_strncmp( const char *s1, const char *s2, size_t n );
-
 extern char *
 _mesa_strdup( const char *s );
 
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c
index 661e7a2..79b2e59 100644
--- a/src/mesa/shader/nvfragparse.c
+++ b/src/mesa/shader/nvfragparse.c
@@ -224,7 +224,7 @@ MatchInstruction(const GLubyte *token)
    result.suffixes = 0;
 
    for (inst = Instructions; inst->name; inst++) {
-      if (_mesa_strncmp((const char *) token, inst->name, 3) == 0) {
+      if (strncmp((const char *) token, inst->name, 3) == 0) {
          /* matched! */
          int i = 3;
          result = *inst;
@@ -1495,11 +1495,11 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget,
    _mesa_set_program_error(ctx, -1, NULL);
 
    /* check the program header */
-   if (_mesa_strncmp((const char *) programString, "!!FP1.0", 7) == 0) {
+   if (strncmp((const char *) programString, "!!FP1.0", 7) == 0) {
       target = GL_FRAGMENT_PROGRAM_NV;
       parseState.pos = programString + 7;
    }
-   else if (_mesa_strncmp((const char *) programString, "!!FCP1.0", 8) == 0) {
+   else if (strncmp((const char *) programString, "!!FCP1.0", 8) == 0) {
       /* fragment / register combiner program - not supported */
       _mesa_set_program_error(ctx, 0, "Invalid fragment program header");
       _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV(bad header)");
diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c
index a983c3d..cd5b57f 100644
--- a/src/mesa/shader/nvvertparse.c
+++ b/src/mesa/shader/nvvertparse.c
@@ -1313,18 +1313,18 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget,
    _mesa_set_program_error(ctx, -1, NULL);
 
    /* check the program header */
-   if (_mesa_strncmp((const char *) programString, "!!VP1.0", 7) == 0) {
+   if (strncmp((const char *) programString, "!!VP1.0", 7) == 0) {
       target = GL_VERTEX_PROGRAM_NV;
       parseState.pos = programString + 7;
       parseState.isStateProgram = GL_FALSE;
    }
-   else if (_mesa_strncmp((const char *) programString, "!!VP1.1", 7) == 0) {
+   else if (strncmp((const char *) programString, "!!VP1.1", 7) == 0) {
       target = GL_VERTEX_PROGRAM_NV;
       parseState.pos = programString + 7;
       parseState.isStateProgram = GL_FALSE;
       parseState.isVersion1_1 = GL_TRUE;
    }
-   else if (_mesa_strncmp((const char *) programString, "!!VSP1.0", 8) == 0) {
+   else if (strncmp((const char *) programString, "!!VSP1.0", 8) == 0) {
       target = GL_VERTEX_STATE_PROGRAM_NV;
       parseState.pos = programString + 8;
       parseState.isStateProgram = GL_TRUE;
diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c
index b0ccf7b..435e6ce 100644
--- a/src/mesa/shader/prog_parameter.c
+++ b/src/mesa/shader/prog_parameter.c
@@ -537,7 +537,7 @@ _mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList,
       /* name is not null-terminated, use nameLen */
       for (i = 0; i < (GLint) paramList->NumParameters; i++) {
          if (paramList->Parameters[i].Name &&
-	     _mesa_strncmp(paramList->Parameters[i].Name, name, nameLen) == 0
+	     strncmp(paramList->Parameters[i].Name, name, nameLen) == 0
              && strlen(paramList->Parameters[i].Name) == (size_t)nameLen)
             return i;
       }
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 1a2c391..41d51cd 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -65,7 +65,7 @@ static GLboolean
 legal_identifier(slang_atom name)
 {
    /* "gl_" is a reserved prefix */
-   if (_mesa_strncmp((char *) name, "gl_", 3) == 0) {
+   if (strncmp((char *) name, "gl_", 3) == 0) {
       return GL_FALSE;
    }
    return GL_TRUE;




More information about the mesa-commit mailing list