Remove _mesa_strcmp in favor of plain strcmp.

This commit is contained in:
Kenneth Graunke
2010-02-18 23:50:56 -08:00
committed by Kristian Høgsberg
parent 21d0c70b4b
commit 8d73aa6d1a
20 changed files with 39 additions and 53 deletions

View File

@@ -447,12 +447,12 @@ get_env_visual(Display *dpy, int scr, const char *varname)
sscanf( value, "%s %d", type, &depth ); sscanf( value, "%s %d", type, &depth );
if (_mesa_strcmp(type,"TrueColor")==0) xclass = TrueColor; if (strcmp(type,"TrueColor")==0) xclass = TrueColor;
else if (_mesa_strcmp(type,"DirectColor")==0) xclass = DirectColor; else if (strcmp(type,"DirectColor")==0) xclass = DirectColor;
else if (_mesa_strcmp(type,"PseudoColor")==0) xclass = PseudoColor; else if (strcmp(type,"PseudoColor")==0) xclass = PseudoColor;
else if (_mesa_strcmp(type,"StaticColor")==0) xclass = StaticColor; else if (strcmp(type,"StaticColor")==0) xclass = StaticColor;
else if (_mesa_strcmp(type,"GrayScale")==0) xclass = GrayScale; else if (strcmp(type,"GrayScale")==0) xclass = GrayScale;
else if (_mesa_strcmp(type,"StaticGray")==0) xclass = StaticGray; else if (strcmp(type,"StaticGray")==0) xclass = StaticGray;
if (xclass>-1 && depth>0) { if (xclass>-1 && depth>0) {
vis = get_visual( dpy, scr, depth, xclass ); vis = get_visual( dpy, scr, depth, xclass );

View File

@@ -330,7 +330,7 @@ glFBDevGetProcAddress( const char *procName )
}; };
const struct name_address *entry; const struct name_address *entry;
for (entry = functions; entry->name; entry++) { for (entry = functions; entry->name; entry++) {
if (_mesa_strcmp(entry->name, procName) == 0) { if (strcmp(entry->name, procName) == 0) {
return entry->func; return entry->func;
} }
} }

View File

@@ -1579,7 +1579,7 @@ OSMesaGetProcAddress( const char *funcName )
{ {
int i; int i;
for (i = 0; functions[i].Name; i++) { for (i = 0; functions[i].Name; i++) {
if (_mesa_strcmp(functions[i].Name, funcName) == 0) if (strcmp(functions[i].Name, funcName) == 0)
return functions[i].Function; return functions[i].Function;
} }
return _glapi_get_proc_address(funcName); return _glapi_get_proc_address(funcName);

View File

@@ -926,7 +926,6 @@ EXPORTS
_mesa_store_texsubimage1d _mesa_store_texsubimage1d
_mesa_store_texsubimage2d _mesa_store_texsubimage2d
_mesa_store_texsubimage3d _mesa_store_texsubimage3d
_mesa_strcmp
_mesa_test_proxy_teximage _mesa_test_proxy_teximage
_mesa_reference_framebuffer _mesa_reference_framebuffer
_mesa_update_framebuffer_visual _mesa_update_framebuffer_visual

View File

@@ -72,7 +72,6 @@ EXPORTS
_mesa_store_texsubimage1d _mesa_store_texsubimage1d
_mesa_store_texsubimage2d _mesa_store_texsubimage2d
_mesa_store_texsubimage3d _mesa_store_texsubimage3d
_mesa_strcmp
_mesa_test_proxy_teximage _mesa_test_proxy_teximage
_mesa_Viewport _mesa_Viewport
_mesa_meta_CopyColorSubTable _mesa_meta_CopyColorSubTable

View File

@@ -621,12 +621,12 @@ get_env_visual(Display *dpy, int scr, const char *varname)
sscanf( value, "%s %d", type, &depth ); sscanf( value, "%s %d", type, &depth );
if (_mesa_strcmp(type,"TrueColor")==0) xclass = TrueColor; if (strcmp(type,"TrueColor")==0) xclass = TrueColor;
else if (_mesa_strcmp(type,"DirectColor")==0) xclass = DirectColor; else if (strcmp(type,"DirectColor")==0) xclass = DirectColor;
else if (_mesa_strcmp(type,"PseudoColor")==0) xclass = PseudoColor; else if (strcmp(type,"PseudoColor")==0) xclass = PseudoColor;
else if (_mesa_strcmp(type,"StaticColor")==0) xclass = StaticColor; else if (strcmp(type,"StaticColor")==0) xclass = StaticColor;
else if (_mesa_strcmp(type,"GrayScale")==0) xclass = GrayScale; else if (strcmp(type,"GrayScale")==0) xclass = GrayScale;
else if (_mesa_strcmp(type,"StaticGray")==0) xclass = StaticGray; else if (strcmp(type,"StaticGray")==0) xclass = StaticGray;
if (xclass>-1 && depth>0) { if (xclass>-1 && depth>0) {
vis = get_visual( dpy, scr, depth, xclass ); vis = get_visual( dpy, scr, depth, xclass );

View File

@@ -70,7 +70,7 @@ typedef int (*cfunc)(const void *, const void *);
*/ */
static int compar_name( const char *a, const enum_elt *b ) static int compar_name( const char *a, const enum_elt *b )
{ {
return _mesa_strcmp( a, & enum_string_table[ b->offset ] ); return strcmp( a, & enum_string_table[ b->offset ] );
} }
/** /**

View File

@@ -152,7 +152,6 @@ def PrintTail():
print '\t_mesa_store_texsubimage1d' print '\t_mesa_store_texsubimage1d'
print '\t_mesa_store_texsubimage2d' print '\t_mesa_store_texsubimage2d'
print '\t_mesa_store_texsubimage3d' print '\t_mesa_store_texsubimage3d'
print '\t_mesa_strcmp'
print '\t_mesa_test_proxy_teximage' print '\t_mesa_test_proxy_teximage'
print '\t_mesa_Viewport' print '\t_mesa_Viewport'
print '\t_mesa_meta_CopyColorSubTable' print '\t_mesa_meta_CopyColorSubTable'

View File

@@ -5181,7 +5181,7 @@ typedef int (*cfunc)(const void *, const void *);
*/ */
static int compar_name( const char *a, const enum_elt *b ) static int compar_name( const char *a, const enum_elt *b )
{ {
return _mesa_strcmp( a, & enum_string_table[ b->offset ] ); return strcmp( a, & enum_string_table[ b->offset ] );
} }
/** /**

View File

@@ -498,7 +498,7 @@ set_extension( GLcontext *ctx, const char *name, GLboolean state )
} }
for (i = 0 ; i < Elements(default_extensions) ; i++) { for (i = 0 ; i < Elements(default_extensions) ; i++) {
if (_mesa_strcmp(default_extensions[i].name, name) == 0) { if (strcmp(default_extensions[i].name, name) == 0) {
if (default_extensions[i].flag_offset) { if (default_extensions[i].flag_offset) {
GLboolean *enabled = base + default_extensions[i].flag_offset; GLboolean *enabled = base + default_extensions[i].flag_offset;
*enabled = state; *enabled = state;
@@ -560,7 +560,7 @@ _mesa_extension_is_enabled( GLcontext *ctx, const char *name )
GLuint i; GLuint i;
for (i = 0 ; i < Elements(default_extensions) ; i++) { for (i = 0 ; i < Elements(default_extensions) ; i++) {
if (_mesa_strcmp(default_extensions[i].name, name) == 0) { if (strcmp(default_extensions[i].name, name) == 0) {
return extension_enabled(ctx, i); return extension_enabled(ctx, i);
} }
} }

View File

@@ -841,13 +841,6 @@ _mesa_getenv( const char *var )
/** \name String */ /** \name String */
/*@{*/ /*@{*/
/** Wrapper around strcmp() */
int
_mesa_strcmp( const char *s1, const char *s2 )
{
return strcmp(s1, s2);
}
/** Wrapper around strncmp() */ /** Wrapper around strncmp() */
int int
_mesa_strncmp( const char *s1, const char *s2, size_t n ) _mesa_strncmp( const char *s1, const char *s2, size_t n )

View File

@@ -611,9 +611,6 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size,
extern char * extern char *
_mesa_getenv( const char *var ); _mesa_getenv( const char *var );
extern int
_mesa_strcmp( const char *s1, const char *s2 );
extern int extern int
_mesa_strncmp( const char *s1, const char *s2, size_t n ); _mesa_strncmp( const char *s1, const char *s2, size_t n );

View File

@@ -802,7 +802,7 @@ Parse_FragReg(struct parse_state *parseState, GLint *tempRegNum)
RETURN_ERROR; RETURN_ERROR;
} }
for (j = 0; InputRegisters[j]; j++) { for (j = 0; InputRegisters[j]; j++) {
if (_mesa_strcmp((const char *) token, InputRegisters[j]) == 0) { if (strcmp((const char *) token, InputRegisters[j]) == 0) {
*tempRegNum = j; *tempRegNum = j;
parseState->inputsRead |= (1 << j); parseState->inputsRead |= (1 << j);
break; break;
@@ -835,13 +835,13 @@ Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum)
RETURN_ERROR; RETURN_ERROR;
/* try to match an output register name */ /* try to match an output register name */
if (_mesa_strcmp((char *) token, "COLR") == 0 || if (strcmp((char *) token, "COLR") == 0 ||
_mesa_strcmp((char *) token, "COLH") == 0) { strcmp((char *) token, "COLH") == 0) {
/* note that we don't distinguish between COLR and COLH */ /* note that we don't distinguish between COLR and COLH */
*outputRegNum = FRAG_RESULT_COLOR; *outputRegNum = FRAG_RESULT_COLOR;
parseState->outputsWritten |= (1 << FRAG_RESULT_COLOR); parseState->outputsWritten |= (1 << FRAG_RESULT_COLOR);
} }
else if (_mesa_strcmp((char *) token, "DEPR") == 0) { else if (strcmp((char *) token, "DEPR") == 0) {
*outputRegNum = FRAG_RESULT_DEPTH; *outputRegNum = FRAG_RESULT_DEPTH;
parseState->outputsWritten |= (1 << FRAG_RESULT_DEPTH); parseState->outputsWritten |= (1 << FRAG_RESULT_DEPTH);
} }
@@ -868,8 +868,8 @@ Parse_MaskedDstReg(struct parse_state *parseState,
if (!Peek_Token(parseState, token)) if (!Peek_Token(parseState, token))
RETURN_ERROR; RETURN_ERROR;
if (_mesa_strcmp((const char *) token, "RC") == 0 || if (strcmp((const char *) token, "RC") == 0 ||
_mesa_strcmp((const char *) token, "HC") == 0) { strcmp((const char *) token, "HC") == 0) {
/* a write-only register */ /* a write-only register */
dstReg->File = PROGRAM_WRITE_ONLY; dstReg->File = PROGRAM_WRITE_ONLY;
if (!Parse_DummyReg(parseState, &idx)) if (!Parse_DummyReg(parseState, &idx))

View File

@@ -403,7 +403,7 @@ Parse_ParamReg(struct parse_state *parseState, struct prog_src_register *srcReg)
srcReg->File = PROGRAM_ENV_PARAM; srcReg->File = PROGRAM_ENV_PARAM;
srcReg->Index = reg; srcReg->Index = reg;
} }
else if (_mesa_strcmp((const char *) token, "A0") == 0) { else if (strcmp((const char *) token, "A0") == 0) {
/* address register "A0.x" */ /* address register "A0.x" */
if (!Parse_AddrReg(parseState)) if (!Parse_AddrReg(parseState))
RETURN_ERROR; RETURN_ERROR;
@@ -487,7 +487,7 @@ Parse_AttribReg(struct parse_state *parseState, GLint *tempRegNum)
} }
else { else {
for (j = 0; InputRegisters[j]; j++) { for (j = 0; InputRegisters[j]; j++) {
if (_mesa_strcmp((const char *) token, InputRegisters[j]) == 0) { if (strcmp((const char *) token, InputRegisters[j]) == 0) {
*tempRegNum = j; *tempRegNum = j;
break; break;
} }
@@ -531,7 +531,7 @@ Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum)
/* try to match an output register name */ /* try to match an output register name */
for (j = start; OutputRegisters[j]; j++) { for (j = start; OutputRegisters[j]; j++) {
if (_mesa_strcmp((const char *) token, OutputRegisters[j]) == 0) { if (strcmp((const char *) token, OutputRegisters[j]) == 0) {
*outputRegNum = j; *outputRegNum = j;
break; break;
} }

View File

@@ -215,7 +215,7 @@ _mesa_add_named_constant(struct gl_program_parameter_list *paramList,
pvals[1] == values[1] && pvals[1] == values[1] &&
pvals[2] == values[2] && pvals[2] == values[2] &&
pvals[3] == values[3] && pvals[3] == values[3] &&
_mesa_strcmp(paramList->Parameters[pos].Name, name) == 0) { strcmp(paramList->Parameters[pos].Name, name) == 0) {
/* Same name and value is already in the param list - reuse it */ /* Same name and value is already in the param list - reuse it */
return pos; return pos;
} }
@@ -325,7 +325,7 @@ _mesa_use_uniform(struct gl_program_parameter_list *paramList,
for (i = 0; i < paramList->NumParameters; i++) { for (i = 0; i < paramList->NumParameters; i++) {
struct gl_program_parameter *p = paramList->Parameters + i; struct gl_program_parameter *p = paramList->Parameters + i;
if ((p->Type == PROGRAM_UNIFORM || p->Type == PROGRAM_SAMPLER) && if ((p->Type == PROGRAM_UNIFORM || p->Type == PROGRAM_SAMPLER) &&
_mesa_strcmp(p->Name, name) == 0) { strcmp(p->Name, name) == 0) {
p->Used = GL_TRUE; p->Used = GL_TRUE;
/* Note that large uniforms may occupy several slots so we're /* Note that large uniforms may occupy several slots so we're
* not done searching yet. * not done searching yet.
@@ -529,7 +529,7 @@ _mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList,
/* name is null-terminated */ /* name is null-terminated */
for (i = 0; i < (GLint) paramList->NumParameters; i++) { for (i = 0; i < (GLint) paramList->NumParameters; i++) {
if (paramList->Parameters[i].Name && if (paramList->Parameters[i].Name &&
_mesa_strcmp(paramList->Parameters[i].Name, name) == 0) strcmp(paramList->Parameters[i].Name, name) == 0)
return i; return i;
} }
} }

View File

@@ -128,7 +128,7 @@ _mesa_lookup_uniform(const struct gl_uniform_list *list, const char *name)
{ {
GLuint i; GLuint i;
for (i = 0; list && i < list->NumUniforms; i++) { for (i = 0; list && i < list->NumUniforms; i++) {
if (!_mesa_strcmp(list->Uniforms[i].Name, name)) { if (!strcmp(list->Uniforms[i].Name, name)) {
return i; return i;
} }
} }

View File

@@ -1020,7 +1020,7 @@ slang_substitute(slang_assemble_ctx *A, slang_operation *oper,
GLuint i; GLuint i;
v = _slang_variable_locate(oper->locals, id, GL_TRUE); v = _slang_variable_locate(oper->locals, id, GL_TRUE);
if (!v) { if (!v) {
if (_mesa_strcmp((char *) oper->a_id, "__notRetFlag")) if (strcmp((char *) oper->a_id, "__notRetFlag"))
_mesa_problem(NULL, "var %s not found!\n", (char *) oper->a_id); _mesa_problem(NULL, "var %s not found!\n", (char *) oper->a_id);
return; return;
} }
@@ -1658,7 +1658,7 @@ slang_find_asm_info(const char *name)
{ {
GLuint i; GLuint i;
for (i = 0; AsmInfo[i].Name; i++) { for (i = 0; AsmInfo[i].Name; i++) {
if (_mesa_strcmp(AsmInfo[i].Name, name) == 0) { if (strcmp(AsmInfo[i].Name, name) == 0) {
return AsmInfo + i; return AsmInfo + i;
} }
} }
@@ -2317,7 +2317,7 @@ _slang_is_vec_mat_type(const char *name)
}; };
int i; int i;
for (i = 0; vecmat_types[i]; i++) for (i = 0; vecmat_types[i]; i++)
if (_mesa_strcmp(name, vecmat_types[i]) == 0) if (strcmp(name, vecmat_types[i]) == 0)
return GL_TRUE; return GL_TRUE;
return GL_FALSE; return GL_FALSE;
} }
@@ -5224,7 +5224,7 @@ _slang_codegen_function(slang_assemble_ctx * A, slang_function * fun)
slang_ir_node *n; slang_ir_node *n;
GLboolean success = GL_TRUE; GLboolean success = GL_TRUE;
if (_mesa_strcmp((char *) fun->header.a_name, "main") != 0) { if (strcmp((char *) fun->header.a_name, "main") != 0) {
/* we only really generate code for main, all other functions get /* we only really generate code for main, all other functions get
* inlined or codegen'd upon an actual call. * inlined or codegen'd upon an actual call.
*/ */

View File

@@ -2563,8 +2563,7 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit,
{ {
slang_function *func; slang_function *func;
success = parse_function(C, &o, 1, &func); success = parse_function(C, &o, 1, &func);
if (success && if (success && strcmp((char *) func->header.a_name, "main") == 0) {
_mesa_strcmp((char *) func->header.a_name, "main") == 0) {
/* found main() */ /* found main() */
mainFunc = func; mainFunc = func;
} }

View File

@@ -698,7 +698,7 @@ slang_print_function(const slang_function *f, GLboolean body)
GLuint i; GLuint i;
#if 0 #if 0
if (_mesa_strcmp((char *) f->header.a_name, "main") != 0) if (strcmp((char *) f->header.a_name, "main") != 0)
return; return;
#endif #endif

View File

@@ -32,7 +32,7 @@
#define static_assert(expr) do { int _array[(expr) ? 1 : -1]; (void) _array[0]; } while (0) #define static_assert(expr) do { int _array[(expr) ? 1 : -1]; (void) _array[0]; } while (0)
#define slang_string_compare(str1, str2) _mesa_strcmp (str1, str2) #define slang_string_compare(str1, str2) strcmp (str1, str2)
#define slang_string_copy(dst, src) strcpy (dst, src) #define slang_string_copy(dst, src) strcpy (dst, src)
#define slang_string_length(str) strlen (str) #define slang_string_length(str) strlen (str)