From 21d0c70b4b1c18dc1c3ac7d0fbd8a903d60f8be7 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:55 -0800 Subject: Remove _mesa_strlen in favor of plain strlen. --- src/mesa/shader/nvfragparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/shader/nvfragparse.c') diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 8ee7c930626..b219dfa6e77 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -378,7 +378,7 @@ Peek_Token(struct parse_state *parseState, GLubyte *token) parseState->pos += (-i); return GL_FALSE; } - len = (GLint)_mesa_strlen((const char *) token); + len = (GLint) strlen((const char *) token); parseState->pos += (i - len); return GL_TRUE; } -- cgit v1.2.3 From 8d73aa6d1ae6e89bb2cd8f52f5586d569a4b6eeb Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:56 -0800 Subject: Remove _mesa_strcmp in favor of plain strcmp. --- src/gallium/state_trackers/glx/xlib/glx_api.c | 12 ++++++------ src/mesa/drivers/fbdev/glfbdev.c | 2 +- src/mesa/drivers/osmesa/osmesa.c | 2 +- src/mesa/drivers/windows/gdi/mesa.def | 3 +-- src/mesa/drivers/windows/icd/mesa.def | 1 - src/mesa/drivers/x11/fakeglx.c | 12 ++++++------ src/mesa/glapi/gl_enums.py | 2 +- src/mesa/glapi/mesadef.py | 1 - src/mesa/main/enums.c | 2 +- src/mesa/main/extensions.c | 4 ++-- src/mesa/main/imports.c | 7 ------- src/mesa/main/imports.h | 3 --- src/mesa/shader/nvfragparse.c | 12 ++++++------ src/mesa/shader/nvvertparse.c | 6 +++--- src/mesa/shader/prog_parameter.c | 6 +++--- src/mesa/shader/prog_uniform.c | 2 +- src/mesa/shader/slang/slang_codegen.c | 8 ++++---- src/mesa/shader/slang/slang_compile.c | 3 +-- src/mesa/shader/slang/slang_print.c | 2 +- src/mesa/shader/slang/slang_utility.h | 2 +- 20 files changed, 39 insertions(+), 53 deletions(-) (limited to 'src/mesa/shader/nvfragparse.c') diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index 7e86e68b682..971b6e71cb8 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -447,12 +447,12 @@ get_env_visual(Display *dpy, int scr, const char *varname) sscanf( value, "%s %d", type, &depth ); - if (_mesa_strcmp(type,"TrueColor")==0) xclass = TrueColor; - else if (_mesa_strcmp(type,"DirectColor")==0) xclass = DirectColor; - else if (_mesa_strcmp(type,"PseudoColor")==0) xclass = PseudoColor; - else if (_mesa_strcmp(type,"StaticColor")==0) xclass = StaticColor; - else if (_mesa_strcmp(type,"GrayScale")==0) xclass = GrayScale; - else if (_mesa_strcmp(type,"StaticGray")==0) xclass = StaticGray; + if (strcmp(type,"TrueColor")==0) xclass = TrueColor; + else if (strcmp(type,"DirectColor")==0) xclass = DirectColor; + else if (strcmp(type,"PseudoColor")==0) xclass = PseudoColor; + else if (strcmp(type,"StaticColor")==0) xclass = StaticColor; + else if (strcmp(type,"GrayScale")==0) xclass = GrayScale; + else if (strcmp(type,"StaticGray")==0) xclass = StaticGray; if (xclass>-1 && depth>0) { vis = get_visual( dpy, scr, depth, xclass ); diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 1a56b2395fa..51bd23575fd 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -330,7 +330,7 @@ glFBDevGetProcAddress( const char *procName ) }; const struct name_address *entry; for (entry = functions; entry->name; entry++) { - if (_mesa_strcmp(entry->name, procName) == 0) { + if (strcmp(entry->name, procName) == 0) { return entry->func; } } diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index bac8a9ef142..1c469b15bf0 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1579,7 +1579,7 @@ OSMesaGetProcAddress( const char *funcName ) { int 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 _glapi_get_proc_address(funcName); diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index a31dc55e3fa..10e4c4a9c79 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -926,7 +926,6 @@ EXPORTS _mesa_store_texsubimage1d _mesa_store_texsubimage2d _mesa_store_texsubimage3d - _mesa_strcmp _mesa_test_proxy_teximage _mesa_reference_framebuffer _mesa_update_framebuffer_visual @@ -966,4 +965,4 @@ EXPORTS _tnl_InvalidateState _tnl_run_pipeline _tnl_program_string - _tnl_RasterPos \ No newline at end of file + _tnl_RasterPos diff --git a/src/mesa/drivers/windows/icd/mesa.def b/src/mesa/drivers/windows/icd/mesa.def index 25ac08a2f0f..c4b9bff30d9 100644 --- a/src/mesa/drivers/windows/icd/mesa.def +++ b/src/mesa/drivers/windows/icd/mesa.def @@ -72,7 +72,6 @@ EXPORTS _mesa_store_texsubimage1d _mesa_store_texsubimage2d _mesa_store_texsubimage3d - _mesa_strcmp _mesa_test_proxy_teximage _mesa_Viewport _mesa_meta_CopyColorSubTable diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 3b8c41b9183..fd6d71317b2 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -621,12 +621,12 @@ get_env_visual(Display *dpy, int scr, const char *varname) sscanf( value, "%s %d", type, &depth ); - if (_mesa_strcmp(type,"TrueColor")==0) xclass = TrueColor; - else if (_mesa_strcmp(type,"DirectColor")==0) xclass = DirectColor; - else if (_mesa_strcmp(type,"PseudoColor")==0) xclass = PseudoColor; - else if (_mesa_strcmp(type,"StaticColor")==0) xclass = StaticColor; - else if (_mesa_strcmp(type,"GrayScale")==0) xclass = GrayScale; - else if (_mesa_strcmp(type,"StaticGray")==0) xclass = StaticGray; + if (strcmp(type,"TrueColor")==0) xclass = TrueColor; + else if (strcmp(type,"DirectColor")==0) xclass = DirectColor; + else if (strcmp(type,"PseudoColor")==0) xclass = PseudoColor; + else if (strcmp(type,"StaticColor")==0) xclass = StaticColor; + else if (strcmp(type,"GrayScale")==0) xclass = GrayScale; + else if (strcmp(type,"StaticGray")==0) xclass = StaticGray; if (xclass>-1 && depth>0) { vis = get_visual( dpy, scr, depth, xclass ); diff --git a/src/mesa/glapi/gl_enums.py b/src/mesa/glapi/gl_enums.py index acaa06ab37e..adb0ca526ce 100644 --- a/src/mesa/glapi/gl_enums.py +++ b/src/mesa/glapi/gl_enums.py @@ -70,7 +70,7 @@ typedef int (*cfunc)(const void *, const void *); */ 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 ] ); } /** diff --git a/src/mesa/glapi/mesadef.py b/src/mesa/glapi/mesadef.py index 342c9cde460..8df04143f36 100644 --- a/src/mesa/glapi/mesadef.py +++ b/src/mesa/glapi/mesadef.py @@ -152,7 +152,6 @@ def PrintTail(): print '\t_mesa_store_texsubimage1d' print '\t_mesa_store_texsubimage2d' print '\t_mesa_store_texsubimage3d' - print '\t_mesa_strcmp' print '\t_mesa_test_proxy_teximage' print '\t_mesa_Viewport' print '\t_mesa_meta_CopyColorSubTable' diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 1d495b7ae58..fc7f8beb50e 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -5181,7 +5181,7 @@ typedef int (*cfunc)(const void *, const void *); */ 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 ] ); } /** diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 6449f39c7f7..9b0b5f06fc7 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -498,7 +498,7 @@ set_extension( GLcontext *ctx, const char *name, GLboolean state ) } 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) { GLboolean *enabled = base + default_extensions[i].flag_offset; *enabled = state; @@ -560,7 +560,7 @@ _mesa_extension_is_enabled( GLcontext *ctx, const char *name ) GLuint 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); } } diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index dc24ea0740b..a48f05c5361 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 strcmp() */ -int -_mesa_strcmp( const char *s1, const char *s2 ) -{ - return strcmp(s1, s2); -} - /** Wrapper around strncmp() */ int _mesa_strncmp( const char *s1, const char *s2, size_t n ) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index f66cf0d6f90..867bce763cc 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_strcmp( const char *s1, const char *s2 ); - extern int _mesa_strncmp( const char *s1, const char *s2, size_t n ); diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index b219dfa6e77..661e7a2a7e3 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -802,7 +802,7 @@ Parse_FragReg(struct parse_state *parseState, GLint *tempRegNum) RETURN_ERROR; } 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; parseState->inputsRead |= (1 << j); break; @@ -835,13 +835,13 @@ Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum) RETURN_ERROR; /* try to match an output register name */ - if (_mesa_strcmp((char *) token, "COLR") == 0 || - _mesa_strcmp((char *) token, "COLH") == 0) { + if (strcmp((char *) token, "COLR") == 0 || + strcmp((char *) token, "COLH") == 0) { /* note that we don't distinguish between COLR and COLH */ *outputRegNum = 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; parseState->outputsWritten |= (1 << FRAG_RESULT_DEPTH); } @@ -868,8 +868,8 @@ Parse_MaskedDstReg(struct parse_state *parseState, if (!Peek_Token(parseState, token)) RETURN_ERROR; - if (_mesa_strcmp((const char *) token, "RC") == 0 || - _mesa_strcmp((const char *) token, "HC") == 0) { + if (strcmp((const char *) token, "RC") == 0 || + strcmp((const char *) token, "HC") == 0) { /* a write-only register */ dstReg->File = PROGRAM_WRITE_ONLY; if (!Parse_DummyReg(parseState, &idx)) diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 90f795ab16a..a983c3ddcf3 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -403,7 +403,7 @@ Parse_ParamReg(struct parse_state *parseState, struct prog_src_register *srcReg) srcReg->File = PROGRAM_ENV_PARAM; srcReg->Index = reg; } - else if (_mesa_strcmp((const char *) token, "A0") == 0) { + else if (strcmp((const char *) token, "A0") == 0) { /* address register "A0.x" */ if (!Parse_AddrReg(parseState)) RETURN_ERROR; @@ -487,7 +487,7 @@ Parse_AttribReg(struct parse_state *parseState, GLint *tempRegNum) } else { 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; break; } @@ -531,7 +531,7 @@ Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum) /* try to match an output register name */ 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; break; } diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 0c52c254b52..b0ccf7bd8a8 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -215,7 +215,7 @@ _mesa_add_named_constant(struct gl_program_parameter_list *paramList, pvals[1] == values[1] && pvals[2] == values[2] && 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 */ return pos; } @@ -325,7 +325,7 @@ _mesa_use_uniform(struct gl_program_parameter_list *paramList, for (i = 0; i < paramList->NumParameters; i++) { struct gl_program_parameter *p = paramList->Parameters + i; if ((p->Type == PROGRAM_UNIFORM || p->Type == PROGRAM_SAMPLER) && - _mesa_strcmp(p->Name, name) == 0) { + strcmp(p->Name, name) == 0) { p->Used = GL_TRUE; /* Note that large uniforms may occupy several slots so we're * not done searching yet. @@ -529,7 +529,7 @@ _mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList, /* name is null-terminated */ for (i = 0; i < (GLint) paramList->NumParameters; i++) { if (paramList->Parameters[i].Name && - _mesa_strcmp(paramList->Parameters[i].Name, name) == 0) + strcmp(paramList->Parameters[i].Name, name) == 0) return i; } } diff --git a/src/mesa/shader/prog_uniform.c b/src/mesa/shader/prog_uniform.c index cdfe158deb2..a831ce8cb66 100644 --- a/src/mesa/shader/prog_uniform.c +++ b/src/mesa/shader/prog_uniform.c @@ -128,7 +128,7 @@ _mesa_lookup_uniform(const struct gl_uniform_list *list, const char *name) { GLuint 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; } } diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index fe4bddf9ad2..2280ceb9ee8 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1020,7 +1020,7 @@ slang_substitute(slang_assemble_ctx *A, slang_operation *oper, GLuint i; v = _slang_variable_locate(oper->locals, id, GL_TRUE); 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); return; } @@ -1658,7 +1658,7 @@ slang_find_asm_info(const char *name) { GLuint 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; } } @@ -2317,7 +2317,7 @@ _slang_is_vec_mat_type(const char *name) }; int 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_FALSE; } @@ -5224,7 +5224,7 @@ _slang_codegen_function(slang_assemble_ctx * A, slang_function * fun) slang_ir_node *n; 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 * inlined or codegen'd upon an actual call. */ diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 65842ac0c8f..1a2c39104b8 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2563,8 +2563,7 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit, { slang_function *func; success = parse_function(C, &o, 1, &func); - if (success && - _mesa_strcmp((char *) func->header.a_name, "main") == 0) { + if (success && strcmp((char *) func->header.a_name, "main") == 0) { /* found main() */ mainFunc = func; } diff --git a/src/mesa/shader/slang/slang_print.c b/src/mesa/shader/slang/slang_print.c index 98c7877534f..6efc5b7826f 100644 --- a/src/mesa/shader/slang/slang_print.c +++ b/src/mesa/shader/slang/slang_print.c @@ -698,7 +698,7 @@ slang_print_function(const slang_function *f, GLboolean body) GLuint i; #if 0 - if (_mesa_strcmp((char *) f->header.a_name, "main") != 0) + if (strcmp((char *) f->header.a_name, "main") != 0) return; #endif diff --git a/src/mesa/shader/slang/slang_utility.h b/src/mesa/shader/slang/slang_utility.h index 10071f2c174..2c0d0bcbb2a 100644 --- a/src/mesa/shader/slang/slang_utility.h +++ b/src/mesa/shader/slang/slang_utility.h @@ -32,7 +32,7 @@ #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_length(str) strlen (str) -- cgit v1.2.3 From 9d9afe9393fde99858ddf40e478bc16cf44e60dc Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:57 -0800 Subject: 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(-) (limited to 'src/mesa/shader/nvfragparse.c') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index a48f05c5361..4c5e99fbbeb 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 867bce763cc..3c8f734e367 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 661e7a2a7e3..79b2e5989c1 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 a983c3ddcf3..cd5b57ff74a 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 b0ccf7bd8a8..435e6ceb093 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 1a2c39104b8..41d51cd98a5 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; -- cgit v1.2.3 From 60b0cae412029e53654f38d0de151908f1feb310 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:58 -0800 Subject: Remove _mesa_atoi in favor of plain atoi. --- src/gallium/state_trackers/glx/xlib/glx_api.c | 4 ++-- src/mesa/drivers/x11/fakeglx.c | 4 ++-- src/mesa/main/imports.c | 9 +-------- src/mesa/main/imports.h | 3 --- src/mesa/shader/nvfragparse.c | 6 +++--- src/mesa/shader/nvvertparse.c | 10 +++++----- src/mesa/shader/shader_api.c | 2 +- 7 files changed, 14 insertions(+), 24 deletions(-) (limited to 'src/mesa/shader/nvfragparse.c') diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index 971b6e71cb8..e3b52f521b2 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -280,7 +280,7 @@ default_depth_bits(void) int zBits; const char *zEnv = _mesa_getenv("MESA_GLX_DEPTH_BITS"); if (zEnv) - zBits = _mesa_atoi(zEnv); + zBits = atoi(zEnv); else zBits = DEFAULT_SOFTWARE_DEPTH_BITS; return zBits; @@ -292,7 +292,7 @@ default_alpha_bits(void) int aBits; const char *aEnv = _mesa_getenv("MESA_GLX_ALPHA_BITS"); if (aEnv) - aBits = _mesa_atoi(aEnv); + aBits = atoi(aEnv); else aBits = 0; return aBits; diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index fd6d71317b2..075b9a1e5f6 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -378,7 +378,7 @@ default_depth_bits(void) int zBits; const char *zEnv = _mesa_getenv("MESA_GLX_DEPTH_BITS"); if (zEnv) - zBits = _mesa_atoi(zEnv); + zBits = atoi(zEnv); else zBits = DEFAULT_SOFTWARE_DEPTH_BITS; return zBits; @@ -390,7 +390,7 @@ default_alpha_bits(void) int aBits; const char *aEnv = _mesa_getenv("MESA_GLX_ALPHA_BITS"); if (aEnv) - aBits = _mesa_atoi(aEnv); + aBits = atoi(aEnv); else aBits = 0; return aBits; diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 4c5e99fbbeb..2a0952c7afc 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -860,13 +860,6 @@ _mesa_strdup( const char *s ) } } -/** Wrapper around atoi() */ -int -_mesa_atoi(const char *s) -{ - return atoi(s); -} - /** Wrapper around strtod() */ double _mesa_strtod( const char *s, char **end ) @@ -982,7 +975,7 @@ output_if_debug(const char *prefixString, const char *outputString, * set *to any value*. */ #ifdef DEBUG - debug = (env != NULL && _mesa_atoi(env) == 0) ? 0 : 1; + debug = (env != NULL && atoi(env) == 0) ? 0 : 1; #else debug = (env != NULL) ? 1 : 0; #endif diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 3c8f734e367..124642178c7 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -614,9 +614,6 @@ _mesa_getenv( const char *var ); extern char * _mesa_strdup( const char *s ); -extern int -_mesa_atoi( const char *s ); - extern double _mesa_strtod( const char *s, char **end ); diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 79b2e5989c1..ff3a921777f 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -580,7 +580,7 @@ Parse_TextureImageId(struct parse_state *parseState, imageSrc[2] != 'X') { RETURN_ERROR1("Expected TEX# source"); } - unit = _mesa_atoi((const char *) imageSrc + 3); + unit = atoi((const char *) imageSrc + 3); if ((unit < 0 || unit > MAX_TEXTURE_IMAGE_UNITS) || (unit == 0 && (imageSrc[3] != '0' || imageSrc[4] != 0))) { RETURN_ERROR1("Invalied TEX# source index"); @@ -717,7 +717,7 @@ Parse_TempReg(struct parse_state *parseState, GLint *tempRegNum) RETURN_ERROR1("Expected R## or H##"); if (IsDigit(token[1])) { - GLint reg = _mesa_atoi((const char *) (token + 1)); + GLint reg = atoi((const char *) (token + 1)); if (token[0] == 'H') reg += 32; if (reg >= MAX_NV_FRAGMENT_PROGRAM_TEMPS) @@ -768,7 +768,7 @@ Parse_ProgramParamReg(struct parse_state *parseState, GLint *regNum) if (IsDigit(token[0])) { /* a numbered program parameter register */ - GLint reg = _mesa_atoi((const char *) token); + GLint reg = atoi((const char *) token); if (reg >= MAX_NV_FRAGMENT_PROGRAM_PARAMS) RETURN_ERROR1("Invalid constant program number"); *regNum = reg; diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index cd5b57ff74a..630de7c2d7e 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -309,7 +309,7 @@ Parse_TempReg(struct parse_state *parseState, GLint *tempRegNum) RETURN_ERROR1("Expected R##"); if (IsDigit(token[1])) { - GLint reg = _mesa_atoi((char *) (token + 1)); + GLint reg = atoi((char *) (token + 1)); if (reg >= MAX_NV_VERTEX_PROGRAM_TEMPS) RETURN_ERROR1("Bad temporary register name"); *tempRegNum = reg; @@ -363,7 +363,7 @@ Parse_AbsParamReg(struct parse_state *parseState, GLint *regNum) if (IsDigit(token[0])) { /* a numbered program parameter register */ - GLint reg = _mesa_atoi((char *) token); + GLint reg = atoi((char *) token); if (reg >= MAX_NV_VERTEX_PROGRAM_PARAMS) RETURN_ERROR1("Bad program parameter number"); *regNum = reg; @@ -397,7 +397,7 @@ Parse_ParamReg(struct parse_state *parseState, struct prog_src_register *srcReg) /* a numbered program parameter register */ GLint reg; (void) Parse_Token(parseState, token); - reg = _mesa_atoi((char *) token); + reg = atoi((char *) token); if (reg >= MAX_NV_VERTEX_PROGRAM_PARAMS) RETURN_ERROR1("Bad program parameter number"); srcReg->File = PROGRAM_ENV_PARAM; @@ -423,7 +423,7 @@ Parse_ParamReg(struct parse_state *parseState, struct prog_src_register *srcReg) RETURN_ERROR; if (IsDigit(token[0])) { - const GLint k = _mesa_atoi((char *) token); + const GLint k = atoi((char *) token); if (sign == '-') { if (k > 64) RETURN_ERROR1("Bad address offset"); @@ -480,7 +480,7 @@ Parse_AttribReg(struct parse_state *parseState, GLint *tempRegNum) RETURN_ERROR1("Only v[0] accessible in vertex state programs"); if (IsDigit(token[0])) { - GLint reg = _mesa_atoi((char *) token); + GLint reg = atoi((char *) token); if (reg >= MAX_NV_VERTEX_PROGRAM_INPUTS) RETURN_ERROR1("Bad vertex attribute register name"); *tempRegNum = reg; diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index c3b49ed4d4b..44310d2e612 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1385,7 +1385,7 @@ _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name) location = _mesa_lookup_uniform(shProg->Uniforms, newName); if (location >= 0) { - const GLint element = _mesa_atoi(c + 1); + const GLint element = atoi(c + 1); if (element > 0) { /* get type of the uniform array element */ struct gl_program_parameter *p; -- cgit v1.2.3 From c7ac486261ad30ef654f6d0b1608da4e8483cd40 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:59 -0800 Subject: Remove _mesa_memcpy in favor of plain memcpy. This may break the SUNOS4 build, but it's no longer relevant. --- src/gallium/state_trackers/glx/xlib/glx_api.c | 4 +- src/mesa/drivers/common/driverfuncs.c | 2 +- src/mesa/drivers/common/meta.c | 12 +++--- src/mesa/drivers/dri/fb/fb_dri.c | 6 +-- src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c | 6 +-- src/mesa/drivers/dri/r300/r300_draw.c | 4 +- src/mesa/drivers/dri/r300/r300_vertprog.c | 2 +- src/mesa/drivers/dri/r600/r700_render.c | 4 +- .../drivers/dri/radeon/radeon_buffer_objects.c | 6 +-- src/mesa/drivers/dri/unichrome/via_tex.c | 4 +- src/mesa/drivers/fbdev/glfbdev.c | 2 +- src/mesa/drivers/windows/gdi/mesa.def | 1 - src/mesa/drivers/windows/icd/mesa.def | 1 - src/mesa/drivers/x11/fakeglx.c | 4 +- src/mesa/glapi/mesadef.py | 1 - src/mesa/main/attrib.c | 2 +- src/mesa/main/bitset.h | 2 +- src/mesa/main/bufferobj.c | 8 ++-- src/mesa/main/colortab.c | 2 +- src/mesa/main/dlist.c | 10 ++--- src/mesa/main/extensions.c | 6 +-- src/mesa/main/image.c | 48 +++++++++++----------- src/mesa/main/imports.c | 15 +------ src/mesa/main/imports.h | 5 +-- src/mesa/main/macros.h | 2 +- src/mesa/main/renderbuffer.c | 24 +++++------ src/mesa/main/shaders.c | 4 +- src/mesa/main/syncobj.c | 2 +- src/mesa/main/texgetimage.c | 6 +-- src/mesa/main/texstore.c | 2 +- src/mesa/shader/arbprogram.c | 2 +- src/mesa/shader/nvfragparse.c | 2 +- src/mesa/shader/nvvertparse.c | 2 +- src/mesa/shader/prog_instruction.c | 2 +- src/mesa/shader/program.c | 2 +- src/mesa/shader/program_parse.tab.c | 2 +- src/mesa/shader/program_parse.y | 2 +- src/mesa/shader/shader_api.c | 2 +- src/mesa/shader/slang/slang_compile_operation.c | 6 +-- src/mesa/shader/slang/slang_link.c | 2 +- src/mesa/shader/slang/slang_mem.c | 2 +- src/mesa/shader/slang/slang_utility.c | 4 +- src/mesa/state_tracker/st_cb_bufferobjects.c | 2 +- src/mesa/swrast/s_blend.c | 2 +- src/mesa/swrast/s_copypix.c | 14 +++---- src/mesa/swrast/s_drawpix.c | 2 +- src/mesa/swrast/s_span.c | 16 ++++---- src/mesa/swrast/s_stencil.c | 8 ++-- src/mesa/tnl/t_vertex.c | 2 +- src/mesa/tnl/t_vertex_generic.c | 6 +-- src/mesa/vbo/vbo_exec_api.c | 20 ++++----- src/mesa/vbo/vbo_exec_draw.c | 16 ++++---- src/mesa/vbo/vbo_save_api.c | 20 ++++----- src/mesa/vf/vf.c | 2 +- 54 files changed, 159 insertions(+), 178 deletions(-) (limited to 'src/mesa/shader/nvfragparse.c') diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index e3b52f521b2..9093a0eae9f 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -1020,7 +1020,7 @@ glXChooseVisual( Display *dpy, int screen, int *list ) /* create a new vishandle - the cached one may be stale */ xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { - _mesa_memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); + memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } return xmvis->vishandle; } @@ -1809,7 +1809,7 @@ glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ) /* create a new vishandle - the cached one may be stale */ xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { - _mesa_memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); + memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } return xmvis->vishandle; #endif diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 49d4aaedb03..4f6f0836779 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -120,7 +120,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->FreeTexImageData = _mesa_free_texture_image_data; driver->MapTexture = NULL; driver->UnmapTexture = NULL; - driver->TextureMemCpy = _mesa_memcpy; + driver->TextureMemCpy = memcpy; driver->IsTextureResident = NULL; driver->UpdateTexturePalette = NULL; diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 7116d920f7a..4dd2293b24e 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -493,12 +493,12 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state) if (state & META_TRANSFORM) { GLuint activeTexture = ctx->Texture.CurrentUnit; - _mesa_memcpy(save->ModelviewMatrix, ctx->ModelviewMatrixStack.Top->m, - 16 * sizeof(GLfloat)); - _mesa_memcpy(save->ProjectionMatrix, ctx->ProjectionMatrixStack.Top->m, - 16 * sizeof(GLfloat)); - _mesa_memcpy(save->TextureMatrix, ctx->TextureMatrixStack[0].Top->m, - 16 * sizeof(GLfloat)); + memcpy(save->ModelviewMatrix, ctx->ModelviewMatrixStack.Top->m, + 16 * sizeof(GLfloat)); + memcpy(save->ProjectionMatrix, ctx->ProjectionMatrixStack.Top->m, + 16 * sizeof(GLfloat)); + memcpy(save->TextureMatrix, ctx->TextureMatrixStack[0].Top->m, + 16 * sizeof(GLfloat)); save->MatrixMode = ctx->Transform.MatrixMode; /* set 1:1 vertex:pixel coordinate transform */ _mesa_ActiveTextureARB(GL_TEXTURE0); diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index f37241dd69a..0675bb9894f 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -511,10 +511,8 @@ fbSwapBuffers( __DRIdrawable *dPriv ) ASSERT(backBuffer); for (i = 0; i < dPriv->h; i++) { - _mesa_memcpy(tmp, (char *) backBuffer + offset, - currentPitch); - _mesa_memcpy((char *) frontBuffer + offset, tmp, - currentPitch); + memcpy(tmp, (char *) backBuffer + offset, currentPitch); + memcpy((char *) frontBuffer + offset, tmp, currentPitch); offset += currentPitch; } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c index 1118b96de12..5906ad6d396 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c @@ -72,7 +72,7 @@ nouveau_bufferobj_data(GLcontext *ctx, GLenum target, GLsizeiptrARB size, if (data) { nouveau_bo_map(nbo->bo, NOUVEAU_BO_WR); - _mesa_memcpy(nbo->bo->map, data, size); + memcpy(nbo->bo->map, data, size); nouveau_bo_unmap(nbo->bo); } @@ -87,7 +87,7 @@ nouveau_bufferobj_subdata(GLcontext *ctx, GLenum target, GLintptrARB offset, struct nouveau_bufferobj *nbo = to_nouveau_bufferobj(obj); nouveau_bo_map(nbo->bo, NOUVEAU_BO_WR); - _mesa_memcpy(nbo->bo->map + offset, data, size); + memcpy(nbo->bo->map + offset, data, size); nouveau_bo_unmap(nbo->bo); } @@ -99,7 +99,7 @@ nouveau_bufferobj_get_subdata(GLcontext *ctx, GLenum target, GLintptrARB offset, struct nouveau_bufferobj *nbo = to_nouveau_bufferobj(obj); nouveau_bo_map(nbo->bo, NOUVEAU_BO_RD); - _mesa_memcpy(data, nbo->bo->map + offset, size); + memcpy(data, nbo->bo->map + offset, size); nouveau_bo_unmap(nbo->bo); } diff --git a/src/mesa/drivers/dri/r300/r300_draw.c b/src/mesa/drivers/dri/r300/r300_draw.c index 3efa0e3a163..282c0e18bca 100644 --- a/src/mesa/drivers/dri/r300/r300_draw.c +++ b/src/mesa/drivers/dri/r300/r300_draw.c @@ -177,7 +177,7 @@ static void r300SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer radeon_bo_map(r300->ind_buf.bo, 1); assert(r300->ind_buf.bo->ptr != NULL); dst_ptr = ADD_POINTERS(r300->ind_buf.bo->ptr, r300->ind_buf.bo_offset); - _mesa_memcpy(dst_ptr, src_ptr, size); + memcpy(dst_ptr, src_ptr, size); radeon_bo_unmap(r300->ind_buf.bo); r300->ind_buf.is_32bit = (mesa_ind_buf->type == GL_UNSIGNED_INT); @@ -314,7 +314,7 @@ static void r300AlignDataToDword(GLcontext *ctx, const struct gl_client_array *i int i; for (i = 0; i < count; ++i) { - _mesa_memcpy(dst_ptr, src_ptr, input->StrideB); + memcpy(dst_ptr, src_ptr, input->StrideB); src_ptr += input->StrideB; dst_ptr += dst_stride; } diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 3a8d5fb7454..efdcdb78486 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -235,7 +235,7 @@ static struct r300_vertex_program *build_program(GLcontext *ctx, vp = _mesa_calloc(sizeof(*vp)); vp->Base = _mesa_clone_vertex_program(ctx, mesa_vp); - _mesa_memcpy(&vp->key, wanted_key, sizeof(vp->key)); + memcpy(&vp->key, wanted_key, sizeof(vp->key)); rc_init(&compiler.Base); compiler.Base.Debug = (RADEON_DEBUG & RADEON_VERTS) ? GL_TRUE : GL_FALSE; diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 8f14af7472c..fdd02fac237 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -594,7 +594,7 @@ static void r700AlignDataToDword(GLcontext *ctx, for (i = 0; i < count; ++i) { - _mesa_memcpy(dst_ptr, src_ptr, input->StrideB); + memcpy(dst_ptr, src_ptr, input->StrideB); src_ptr += input->StrideB; dst_ptr += dst_stride; } @@ -855,7 +855,7 @@ static void r700SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer assert(context->ind_buf.bo->ptr != NULL); dst_ptr = ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); - _mesa_memcpy(dst_ptr, src_ptr, size); + memcpy(dst_ptr, src_ptr, size); radeon_bo_unmap(context->ind_buf.bo); context->ind_buf.is_32bit = (mesa_ind_buf->type == GL_UNSIGNED_INT); diff --git a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c index 99d3ec7005e..bc5915d3e43 100644 --- a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c +++ b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c @@ -114,7 +114,7 @@ radeonBufferData(GLcontext * ctx, if (data != NULL) { radeon_bo_map(radeon_obj->bo, GL_TRUE); - _mesa_memcpy(radeon_obj->bo->ptr, data, size); + memcpy(radeon_obj->bo->ptr, data, size); radeon_bo_unmap(radeon_obj->bo); } @@ -145,7 +145,7 @@ radeonBufferSubData(GLcontext * ctx, radeon_bo_map(radeon_obj->bo, GL_TRUE); - _mesa_memcpy(radeon_obj->bo->ptr + offset, data, size); + memcpy(radeon_obj->bo->ptr + offset, data, size); radeon_bo_unmap(radeon_obj->bo); } @@ -165,7 +165,7 @@ radeonGetBufferSubData(GLcontext * ctx, radeon_bo_map(radeon_obj->bo, GL_FALSE); - _mesa_memcpy(data, radeon_obj->bo->ptr + offset, size); + memcpy(data, radeon_obj->bo->ptr + offset, size); radeon_bo_unmap(radeon_obj->bo); } diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index 917f9754669..a64f093326f 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -951,11 +951,11 @@ void viaInitTextureFuncs(struct dd_function_table * functions) * Note that this function is currently disabled in via_tris.c too. */ if (getenv("VIA_NO_SSE")) - functions->TextureMemCpy = _mesa_memcpy; + functions->TextureMemCpy = memcpy; else functions->TextureMemCpy = via_sse_memcpy; #else - functions->TextureMemCpy = _mesa_memcpy; + functions->TextureMemCpy = memcpy; #endif functions->UpdateTexturePalette = 0; diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 51bd23575fd..49002512aa3 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -742,7 +742,7 @@ glFBDevSwapBuffers( GLFBDevBufferPtr buffer ) ASSERT(frontrb->Base.Data); ASSERT(backrb->Base.Data); - _mesa_memcpy(frontrb->Base.Data, backrb->Base.Data, buffer->size); + memcpy(frontrb->Base.Data, backrb->Base.Data, buffer->size); } diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index 10e4c4a9c79..f82db88bc53 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -899,7 +899,6 @@ EXPORTS _mesa_init_renderbuffer _mesa_initialize_context _mesa_make_current - _mesa_memcpy _mesa_memset _mesa_new_array_object _mesa_new_framebuffer diff --git a/src/mesa/drivers/windows/icd/mesa.def b/src/mesa/drivers/windows/icd/mesa.def index c4b9bff30d9..06c384d8b0c 100644 --- a/src/mesa/drivers/windows/icd/mesa.def +++ b/src/mesa/drivers/windows/icd/mesa.def @@ -54,7 +54,6 @@ EXPORTS _mesa_init_driver_functions _mesa_initialize_context _mesa_make_current - _mesa_memcpy _mesa_memset _mesa_new_buffer_object _mesa_new_texture_object diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 075b9a1e5f6..291e90c822d 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1383,7 +1383,7 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list ) /* create a new vishandle - the cached one may be stale */ xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { - _mesa_memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); + memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } return xmvis->vishandle; #endif @@ -2162,7 +2162,7 @@ Fake_glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ) /* create a new vishandle - the cached one may be stale */ xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { - _mesa_memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); + memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } return xmvis->vishandle; #endif diff --git a/src/mesa/glapi/mesadef.py b/src/mesa/glapi/mesadef.py index 8df04143f36..c7e2c086f77 100644 --- a/src/mesa/glapi/mesadef.py +++ b/src/mesa/glapi/mesadef.py @@ -134,7 +134,6 @@ def PrintTail(): print '\t_mesa_init_default_imports' print '\t_mesa_initialize_context' print '\t_mesa_make_current' - print '\t_mesa_memcpy' print '\t_mesa_memset' print '\t_mesa_new_buffer_object' print '\t_mesa_new_texture_object' diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 3fbdba2b3fe..881644cdaf2 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -432,7 +432,7 @@ _mesa_PushAttrib(GLbitfield mask) _mesa_lock_context_textures(ctx); /* copy/save the bulk of texture state here */ - _mesa_memcpy(&texstate->Texture, &ctx->Texture, sizeof(ctx->Texture)); + memcpy(&texstate->Texture, &ctx->Texture, sizeof(ctx->Texture)); /* Save references to the currently bound texture objects so they don't * accidentally get deleted while referenced in the attribute stack. diff --git a/src/mesa/main/bitset.h b/src/mesa/main/bitset.h index f2709abc9fd..5463c0a3c9e 100644 --- a/src/mesa/main/bitset.h +++ b/src/mesa/main/bitset.h @@ -47,7 +47,7 @@ /* bitset operations */ -#define BITSET_COPY(x, y) _mesa_memcpy( (x), (y), sizeof (x) ) +#define BITSET_COPY(x, y) memcpy( (x), (y), sizeof (x) ) #define BITSET_EQUAL(x, y) (_mesa_memcmp( (x), (y), sizeof (x) ) == 0) #define BITSET_ZERO(x) _mesa_memset( (x), 0, sizeof (x) ) #define BITSET_ONES(x) _mesa_memset( (x), 0xff, sizeof (x) ) diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index dabb1386ca4..c735661dc2c 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -339,7 +339,7 @@ _mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size, bufObj->Usage = usage; if (data) { - _mesa_memcpy( bufObj->Data, data, size ); + memcpy( bufObj->Data, data, size ); } return GL_TRUE; @@ -378,7 +378,7 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, ASSERT(size + offset <= bufObj->Size); if (bufObj->Data) { - _mesa_memcpy( (GLubyte *) bufObj->Data + offset, data, size ); + memcpy( (GLubyte *) bufObj->Data + offset, data, size ); } } @@ -408,7 +408,7 @@ _mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, (void) ctx; (void) target; if (bufObj->Data && ((GLsizeiptrARB) (size + offset) <= bufObj->Size)) { - _mesa_memcpy( data, (GLubyte *) bufObj->Data + offset, size ); + memcpy( data, (GLubyte *) bufObj->Data + offset, size ); } } @@ -530,7 +530,7 @@ _mesa_copy_buffer_subdata(GLcontext *ctx, GL_WRITE_ONLY, dst); if (srcPtr && dstPtr) - _mesa_memcpy(dstPtr + writeOffset, srcPtr + readOffset, size); + memcpy(dstPtr + writeOffset, srcPtr + readOffset, size); ctx->Driver.UnmapBuffer(ctx, GL_COPY_READ_BUFFER, src); ctx->Driver.UnmapBuffer(ctx, GL_COPY_WRITE_BUFFER, dst); diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 5ede76c1fb1..1c12fb00fab 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -684,7 +684,7 @@ _mesa_GetColorTable( GLenum target, GLenum format, } break; case GL_RGBA: - _mesa_memcpy(rgba, table->TableF, 4 * table->Size * sizeof(GLfloat)); + memcpy(rgba, table->TableF, 4 * table->Size * sizeof(GLfloat)); break; default: _mesa_problem(ctx, "bad table format in glGetColorTable"); diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 683d062bb95..ea0d13b8906 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -4793,7 +4793,7 @@ save_LoadProgramNV(GLenum target, GLuint id, GLsizei len, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); return; } - _mesa_memcpy(programCopy, program, len); + memcpy(programCopy, program, len); n[1].e = target; n[2].ui = id; n[3].i = len; @@ -4820,7 +4820,7 @@ save_RequestResidentProgramsNV(GLsizei num, const GLuint * ids) _mesa_error(ctx, GL_OUT_OF_MEMORY, "glRequestResidentProgramsNV"); return; } - _mesa_memcpy(idCopy, ids, num * sizeof(GLuint)); + memcpy(idCopy, ids, num * sizeof(GLuint)); n[1].i = num; n[2].data = idCopy; } @@ -4991,7 +4991,7 @@ save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramNamedParameter4fNV"); return; } - _mesa_memcpy(nameCopy, name, len); + memcpy(nameCopy, name, len); n[1].ui = id; n[2].i = len; n[3].data = nameCopy; @@ -5090,7 +5090,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); return; } - _mesa_memcpy(programCopy, string, len); + memcpy(programCopy, string, len); n[1].e = target; n[2].e = format; n[3].i = len; @@ -6201,7 +6201,7 @@ memdup(const void *src, GLsizei bytes) { void *b = bytes >= 0 ? _mesa_malloc(bytes) : NULL; if (b) - _mesa_memcpy(b, src, bytes); + memcpy(b, src, bytes); return b; } diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 9b0b5f06fc7..f24baf5acdc 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -579,9 +579,9 @@ append(const char *a, const char *b) char *s = _mesa_calloc(aLen + bLen + 1); if (s) { if (a) - _mesa_memcpy(s, a, aLen); + memcpy(s, a, aLen); if (b) - _mesa_memcpy(s + aLen, b, bLen); + memcpy(s + aLen, b, bLen); s[aLen + bLen] = '\0'; } if (a) @@ -694,7 +694,7 @@ _mesa_make_extension_string( GLcontext *ctx ) for (i = 0 ; i < Elements(default_extensions) ; i++) { if (extension_enabled(ctx, i)) { GLuint len = (GLuint) strlen(default_extensions[i].name); - _mesa_memcpy(s + extStrLen, default_extensions[i].name, len); + memcpy(s + extStrLen, default_extensions[i].name, len); extStrLen += len; s[extStrLen] = ' '; extStrLen++; diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 468f2a9b214..bd03217e2a8 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1099,7 +1099,7 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels, } if ((packing->SkipPixels & 7) == 0) { - _mesa_memcpy( dst, src, width_in_bytes ); + memcpy( dst, src, width_in_bytes ); if (packing->LsbFirst) { flip_bytes( dst, width_in_bytes ); } @@ -1191,7 +1191,7 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, return; if ((packing->SkipPixels & 7) == 0) { - _mesa_memcpy( dst, src, width_in_bytes ); + memcpy( dst, src, width_in_bytes ); if (packing->LsbFirst) { flip_bytes( dst, width_in_bytes ); } @@ -3794,7 +3794,7 @@ _mesa_unpack_color_span_chan( GLcontext *ctx, if (srcType == CHAN_TYPE) { if (dstFormat == GL_RGBA) { if (srcFormat == GL_RGBA) { - _mesa_memcpy( dest, source, n * 4 * sizeof(GLchan) ); + memcpy( dest, source, n * 4 * sizeof(GLchan) ); return; } else if (srcFormat == GL_RGB) { @@ -3814,7 +3814,7 @@ _mesa_unpack_color_span_chan( GLcontext *ctx, } else if (dstFormat == GL_RGB) { if (srcFormat == GL_RGB) { - _mesa_memcpy( dest, source, n * 3 * sizeof(GLchan) ); + memcpy( dest, source, n * 3 * sizeof(GLchan) ); return; } else if (srcFormat == GL_RGBA) { @@ -3834,7 +3834,7 @@ _mesa_unpack_color_span_chan( GLcontext *ctx, else if (dstFormat == srcFormat) { GLint comps = _mesa_components_in_format(srcFormat); assert(comps > 0); - _mesa_memcpy( dest, source, n * comps * sizeof(GLchan) ); + memcpy( dest, source, n * comps * sizeof(GLchan) ); return; } } @@ -4381,11 +4381,11 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, */ if (transferOps == 0 && srcType == GL_UNSIGNED_BYTE && dstType == GL_UNSIGNED_BYTE) { - _mesa_memcpy(dest, source, n * sizeof(GLubyte)); + memcpy(dest, source, n * sizeof(GLubyte)); } else if (transferOps == 0 && srcType == GL_UNSIGNED_INT && dstType == GL_UNSIGNED_INT && !srcPacking->SwapBytes) { - _mesa_memcpy(dest, source, n * sizeof(GLuint)); + memcpy(dest, source, n * sizeof(GLuint)); } else { /* @@ -4421,7 +4421,7 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, } break; case GL_UNSIGNED_INT: - _mesa_memcpy(dest, indexes, n * sizeof(GLuint)); + memcpy(dest, indexes, n * sizeof(GLuint)); break; default: _mesa_problem(ctx, "bad dstType in _mesa_unpack_index_span"); @@ -4444,7 +4444,7 @@ _mesa_pack_index_span( const GLcontext *ctx, GLuint n, if (transferOps & (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT)) { /* make a copy of input */ - _mesa_memcpy(indexes, source, n * sizeof(GLuint)); + memcpy(indexes, source, n * sizeof(GLuint)); _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes); source = indexes; } @@ -4592,14 +4592,14 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, !ctx->Pixel.MapStencilFlag && srcType == GL_UNSIGNED_BYTE && dstType == GL_UNSIGNED_BYTE) { - _mesa_memcpy(dest, source, n * sizeof(GLubyte)); + memcpy(dest, source, n * sizeof(GLubyte)); } else if (transferOps == 0 && !ctx->Pixel.MapStencilFlag && srcType == GL_UNSIGNED_INT && dstType == GL_UNSIGNED_INT && !srcPacking->SwapBytes) { - _mesa_memcpy(dest, source, n * sizeof(GLuint)); + memcpy(dest, source, n * sizeof(GLuint)); } else { /* @@ -4646,7 +4646,7 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, } break; case GL_UNSIGNED_INT: - _mesa_memcpy(dest, indexes, n * sizeof(GLuint)); + memcpy(dest, indexes, n * sizeof(GLuint)); break; default: _mesa_problem(ctx, "bad dstType in _mesa_unpack_stencil_span"); @@ -4667,7 +4667,7 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n, if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset || ctx->Pixel.MapStencilFlag) { /* make a copy of input */ - _mesa_memcpy(stencil, source, n * sizeof(GLstencil)); + memcpy(stencil, source, n * sizeof(GLstencil)); _mesa_apply_stencil_transfer_ops(ctx, n, stencil); source = stencil; } @@ -4675,7 +4675,7 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n, switch (dstType) { case GL_UNSIGNED_BYTE: if (sizeof(GLstencil) == 1) { - _mesa_memcpy( dest, source, n ); + memcpy( dest, source, n ); } else { GLubyte *dst = (GLubyte *) dest; @@ -5039,7 +5039,7 @@ _mesa_pack_depth_span( const GLcontext *ctx, GLuint n, GLvoid *dest, ASSERT(n <= MAX_WIDTH); if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) { - _mesa_memcpy(depthCopy, depthSpan, n * sizeof(GLfloat)); + memcpy(depthCopy, depthSpan, n * sizeof(GLfloat)); _mesa_scale_and_bias_depth(ctx, n, depthCopy); depthSpan = depthCopy; } @@ -5158,7 +5158,7 @@ _mesa_pack_depth_stencil_span(const GLcontext *ctx, GLuint n, GLuint *dest, ASSERT(n <= MAX_WIDTH); if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) { - _mesa_memcpy(depthCopy, depthVals, n * sizeof(GLfloat)); + memcpy(depthCopy, depthVals, n * sizeof(GLfloat)); _mesa_scale_and_bias_depth(ctx, n, depthCopy); depthVals = depthCopy; } @@ -5166,7 +5166,7 @@ _mesa_pack_depth_stencil_span(const GLcontext *ctx, GLuint n, GLuint *dest, if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset || ctx->Pixel.MapStencilFlag) { - _mesa_memcpy(stencilCopy, stencilVals, n * sizeof(GLstencil)); + memcpy(stencilCopy, stencilVals, n * sizeof(GLstencil)); _mesa_apply_stencil_transfer_ops(ctx, n, stencilCopy); stencilVals = stencilCopy; } @@ -5303,7 +5303,7 @@ _mesa_unpack_image( GLuint dimensions, } } else { - _mesa_memcpy(dst, src, bytesPerRow); + memcpy(dst, src, bytesPerRow); } /* byte flipping/swapping */ @@ -5356,7 +5356,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, } } if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort)); + memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort)); } else { const GLubyte (*src1)[4] = (const GLubyte (*)[4]) src; @@ -5372,7 +5372,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, } } if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat)); + memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat)); } break; case GL_UNSIGNED_SHORT: @@ -5389,7 +5389,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, } } if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte)); + memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte)); } else { const GLushort (*src2)[4] = (const GLushort (*)[4]) src; @@ -5405,7 +5405,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, } } if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat)); + memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat)); } break; case GL_FLOAT: @@ -5422,7 +5422,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, } } if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte)); + memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte)); } else { const GLfloat (*src4)[4] = (const GLfloat (*)[4]) src; @@ -5438,7 +5438,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, } } if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort)); + memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort)); } break; default: diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 2a0952c7afc..0abdfca381e 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -221,7 +221,7 @@ _mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, const size_t copySize = (oldSize < newSize) ? oldSize : newSize; void *newBuf = _mesa_align_malloc(newSize, alignment); if (newBuf && oldBuffer && copySize > 0) { - _mesa_memcpy(newBuf, oldBuffer, copySize); + memcpy(newBuf, oldBuffer, copySize); } if (oldBuffer) _mesa_align_free(oldBuffer); @@ -238,23 +238,12 @@ _mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) const size_t copySize = (oldSize < newSize) ? oldSize : newSize; void *newBuffer = _mesa_malloc(newSize); if (newBuffer && oldBuffer && copySize > 0) - _mesa_memcpy(newBuffer, oldBuffer, copySize); + memcpy(newBuffer, oldBuffer, copySize); if (oldBuffer) _mesa_free(oldBuffer); return newBuffer; } -/** memcpy wrapper */ -void * -_mesa_memcpy(void *dest, const void *src, size_t n) -{ -#if defined(SUNOS4) - return memcpy((char *) dest, (char *) src, (int) n); -#else - return memcpy(dest, src, n); -#endif -} - /** Wrapper around memset() */ void _mesa_memset( void *dst, int val, size_t n ) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 124642178c7..8f13d518ea7 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -72,7 +72,7 @@ extern "C" { #define ALIGN_FREE(PTR) _mesa_align_free(PTR) /** Copy \p BYTES bytes from \p SRC into \p DST */ -#define MEMCPY( DST, SRC, BYTES) _mesa_memcpy(DST, SRC, BYTES) +#define MEMCPY( DST, SRC, BYTES) memcpy(DST, SRC, BYTES) /** Set \p N bytes in \p DST to \p VAL */ #define MEMSET( DST, VAL, N ) _mesa_memset(DST, VAL, N) @@ -543,9 +543,6 @@ _mesa_exec_free( void *addr ); extern void * _mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize ); -extern void * -_mesa_memcpy( void *dest, const void *src, size_t n ); - extern void _mesa_memset( void *dst, int val, size_t n ); diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index 38a97fdb18c..a8624574de4 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -207,7 +207,7 @@ do { \ */ #define COPY_4FV( DST, SRC ) \ do { \ - _mesa_memcpy(DST, SRC, sizeof(GLfloat) * 4); \ + memcpy(DST, SRC, sizeof(GLfloat) * 4); \ } while (0) /** Copy \p SZ elements into a 4-element vector */ diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 3bb062bae2a..4ae5843662d 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -87,7 +87,7 @@ get_row_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, { const GLubyte *src = (const GLubyte *) rb->Data + y * rb->Width + x; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - _mesa_memcpy(values, src, count * sizeof(GLubyte)); + memcpy(values, src, count * sizeof(GLubyte)); } @@ -121,7 +121,7 @@ put_row_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } else { - _mesa_memcpy(dst, values, count * sizeof(GLubyte)); + memcpy(dst, values, count * sizeof(GLubyte)); } } @@ -207,7 +207,7 @@ get_row_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, { const void *src = rb->GetPointer(ctx, rb, x, y); ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - _mesa_memcpy(values, src, count * sizeof(GLushort)); + memcpy(values, src, count * sizeof(GLushort)); } @@ -241,7 +241,7 @@ put_row_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } else { - _mesa_memcpy(dst, src, count * sizeof(GLushort)); + memcpy(dst, src, count * sizeof(GLushort)); } } @@ -337,7 +337,7 @@ get_row_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const void *src = rb->GetPointer(ctx, rb, x, y); ASSERT(rb->DataType == GL_UNSIGNED_INT || rb->DataType == GL_UNSIGNED_INT_24_8_EXT); - _mesa_memcpy(values, src, count * sizeof(GLuint)); + memcpy(values, src, count * sizeof(GLuint)); } @@ -373,7 +373,7 @@ put_row_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } else { - _mesa_memcpy(dst, src, count * sizeof(GLuint)); + memcpy(dst, src, count * sizeof(GLuint)); } } @@ -631,7 +631,7 @@ get_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLubyte *src = (const GLubyte *) rb->Data + 4 * (y * rb->Width + x); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); ASSERT(rb->Format == MESA_FORMAT_RGBA8888); - _mesa_memcpy(values, src, 4 * count * sizeof(GLubyte)); + memcpy(values, src, 4 * count * sizeof(GLubyte)); } @@ -669,7 +669,7 @@ put_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } else { - _mesa_memcpy(dst, src, 4 * count * sizeof(GLubyte)); + memcpy(dst, src, 4 * count * sizeof(GLubyte)); } } @@ -788,7 +788,7 @@ get_row_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, { const GLshort *src = (const GLshort *) rb->Data + 4 * (y * rb->Width + x); ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); - _mesa_memcpy(values, src, 4 * count * sizeof(GLshort)); + memcpy(values, src, 4 * count * sizeof(GLshort)); } @@ -826,7 +826,7 @@ put_row_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } else { - _mesa_memcpy(dst, src, 4 * count * sizeof(GLushort)); + memcpy(dst, src, 4 * count * sizeof(GLushort)); } } @@ -851,7 +851,7 @@ put_row_rgb_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } else { - _mesa_memcpy(dst, src, 4 * count * sizeof(GLushort)); + memcpy(dst, src, 4 * count * sizeof(GLushort)); } } @@ -1374,7 +1374,7 @@ copy_buffer_alpha8(struct gl_renderbuffer* dst, struct gl_renderbuffer* src) ASSERT(dst->Width == src->Width); ASSERT(dst->Height == src->Height); - _mesa_memcpy(dst->Data, src->Data, dst->Width * dst->Height * sizeof(GLubyte)); + memcpy(dst->Data, src->Data, dst->Width * dst->Height * sizeof(GLubyte)); } diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index b9c84eb7925..91f2a7a7bf4 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -469,8 +469,8 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, for (i = 0; i < count; i++) { GLint start = (i > 0) ? offsets[i - 1] : 0; - _mesa_memcpy(source + start, string[i], - (offsets[i] - start) * sizeof(GLcharARB)); + memcpy(source + start, string[i], + (offsets[i] - start) * sizeof(GLcharARB)); } source[totalLength - 1] = '\0'; source[totalLength - 2] = '\0'; diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c index ac3f9eb1752..36b48fd9f26 100644 --- a/src/mesa/main/syncobj.c +++ b/src/mesa/main/syncobj.c @@ -398,7 +398,7 @@ _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, if (size > 0) { const GLsizei copy_count = MIN2(size, bufSize); - _mesa_memcpy(values, v, sizeof(GLint) * copy_count); + memcpy(values, v, sizeof(GLint) * copy_count); } if (length != NULL) { diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 6b3355a7ecd..7ad91805bc9 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -156,7 +156,7 @@ get_tex_depth_stencil(GLcontext *ctx, GLuint dimensions, void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, width, height, format, type, img, row, 0); - _mesa_memcpy(dest, src, width * sizeof(GLuint)); + memcpy(dest, src, width * sizeof(GLuint)); if (ctx->Pack.SwapBytes) { _mesa_swap4((GLuint *) dest, width); } @@ -187,7 +187,7 @@ get_tex_ycbcr(GLcontext *ctx, GLuint dimensions, void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, width, height, format, type, img, row, 0); - _mesa_memcpy(dest, src, width * sizeof(GLushort)); + memcpy(dest, src, width * sizeof(GLushort)); /* check for byte swapping */ if ((texImage->TexFormat == MESA_FORMAT_YCBCR @@ -560,7 +560,7 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, texImage->Width, texImage->Height, texImage->Depth); - _mesa_memcpy(img, texImage->Data, size); + memcpy(img, texImage->Data, size); } else { GLuint bw, bh; diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 78612b08560..c1418e0967a 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -2919,7 +2919,7 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) + dstYoffset * dstRowStride + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { - _mesa_memcpy(dstRow, srcRow, bytesPerRow); + memcpy(dstRow, srcRow, bytesPerRow); dstRow += dstRowStride; srcRow += srcWidth * components; } diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index a77ff7c5b15..75b4274bfd3 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -1091,7 +1091,7 @@ _mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string) } if (prog->String) - _mesa_memcpy(dst, prog->String, strlen((char *) prog->String)); + memcpy(dst, prog->String, strlen((char *) prog->String)); else *dst = '\0'; } diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index ff3a921777f..e226973c53f 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1233,7 +1233,7 @@ Parse_PrintInstruction(struct parse_state *parseState, parseState->pos += len + 1; msg = (GLubyte*) _mesa_malloc(len + 1); - _mesa_memcpy(msg, str, len); + memcpy(msg, str, len); msg[len] = 0; inst->Data = msg; diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 630de7c2d7e..1a840a3a928 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1050,7 +1050,7 @@ Parse_PrintInstruction(struct parse_state *parseState, struct prog_instruction * parseState->pos += len + 1; msg = (GLubyte*) _mesa_malloc(len + 1); - _mesa_memcpy(msg, str, len); + memcpy(msg, str, len); msg[len] = 0; inst->Data = msg; diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index 44c961927a3..dcf834f52da 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -110,7 +110,7 @@ _mesa_copy_instructions(struct prog_instruction *dest, const struct prog_instruction *src, GLuint n) { GLuint i; - _mesa_memcpy(dest, src, n * sizeof(struct prog_instruction)); + memcpy(dest, src, n * sizeof(struct prog_instruction)); for (i = 0; i < n; i++) { if (src[i].Comment) dest[i].Comment = _mesa_strdup(src[i].Comment); diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 18ef6d5ccfa..3bf9a659050 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -223,7 +223,7 @@ _mesa_find_line_column(const GLubyte *string, const GLubyte *pos, p++; len = p - lineStart; s = (GLubyte *) _mesa_malloc(len + 1); - _mesa_memcpy(s, lineStart, len); + memcpy(s, lineStart, len); s[len] = 0; return s; diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 2adfb409739..182ef4c26d1 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -5623,7 +5623,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); return GL_FALSE; } - _mesa_memcpy (strz, str, len); + memcpy (strz, str, len); strz[len] = '\0'; state->prog->String = strz; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 3880d549172..577bd2c38d1 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -2662,7 +2662,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); return GL_FALSE; } - _mesa_memcpy (strz, str, len); + memcpy (strz, str, len); strz[len] = '\0'; state->prog->String = strz; diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 44310d2e612..7e2a60f74b7 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1380,7 +1380,7 @@ _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name) GLchar *newName = _mesa_malloc(len + 1); if (!newName) return -1; /* out of mem */ - _mesa_memcpy(newName, name, len); + memcpy(newName, name, len); newName[len] = 0; location = _mesa_lookup_uniform(shProg->Uniforms, newName); diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c index 3a15d9d3ab5..5441d60df59 100644 --- a/src/mesa/shader/slang/slang_compile_operation.c +++ b/src/mesa/shader/slang/slang_compile_operation.c @@ -269,10 +269,10 @@ slang_operation_insert(GLuint *numElements, slang_operation **array, slang_operation *newOp; newOp = ops + pos; if (pos > 0) - _mesa_memcpy(ops, *array, pos * sizeof(slang_operation)); + memcpy(ops, *array, pos * sizeof(slang_operation)); if (pos < *numElements) - _mesa_memcpy(newOp + 1, (*array) + pos, - (*numElements - pos) * sizeof(slang_operation)); + memcpy(newOp + 1, (*array) + pos, + (*numElements - pos) * sizeof(slang_operation)); if (!slang_operation_construct(newOp)) { _slang_free(ops); diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 2906cb17c4b..68129d4c5a0 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -625,7 +625,7 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) for (i = 0; i < shProg->NumShaders; i++) { const struct gl_shader *shader = shProg->Shaders[i]; if (shader->Type == shaderType) { - _mesa_memcpy(source + len, shader->Source, shaderLengths[i]); + memcpy(source + len, shader->Source, shaderLengths[i]); len += shaderLengths[i]; } } diff --git a/src/mesa/shader/slang/slang_mem.c b/src/mesa/shader/slang/slang_mem.c index c37e12fb7f9..54f5196617f 100644 --- a/src/mesa/shader/slang/slang_mem.c +++ b/src/mesa/shader/slang/slang_mem.c @@ -197,7 +197,7 @@ _slang_realloc(void *oldBuffer, GLuint oldSize, GLuint newSize) ASSERT(is_valid_address(pool, oldBuffer)); if (newBuffer && oldBuffer && copySize > 0) - _mesa_memcpy(newBuffer, oldBuffer, copySize); + memcpy(newBuffer, oldBuffer, copySize); return newBuffer; } diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index e3b0491d97f..56a33e6f6b5 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -92,7 +92,7 @@ slang_string_push (slang_string *self, const slang_string *str) return; } if (grow (self, self->length + str->length)) { - _mesa_memcpy (&self->data[self->length], str->data, str->length); + memcpy (&self->data[self->length], str->data, str->length); self->length += str->length; } } @@ -110,7 +110,7 @@ GLvoid slang_string_pushs (slang_string *self, const char *cstr, GLuint len) { if (grow (self, self->length + len)) { - _mesa_memcpy (&self->data[self->length], cstr, len); + memcpy (&self->data[self->length], cstr, len); self->length += len; } } diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index f1b4f11c050..c92af34378d 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -377,7 +377,7 @@ st_copy_buffer_subdata(GLcontext *ctx, PIPE_BUFFER_USAGE_CPU_WRITE); if (srcPtr && dstPtr) - _mesa_memcpy(dstPtr + writeOffset, srcPtr + readOffset, size); + memcpy(dstPtr + writeOffset, srcPtr + readOffset, size); pipe_buffer_unmap(pipe->screen, srcObj->buffer); pipe_buffer_unmap(pipe->screen, dstObj->buffer); diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c index 95c83432a9c..5b090c72c79 100644 --- a/src/mesa/swrast/s_blend.c +++ b/src/mesa/swrast/s_blend.c @@ -89,7 +89,7 @@ blend_noop(GLcontext *ctx, GLuint n, const GLubyte mask[], else bytes = 4 * n * sizeof(GLfloat); - _mesa_memcpy(src, dst, bytes); + memcpy(src, dst, bytes); } diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index e881d1be30c..b69be50f519 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -167,7 +167,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0]; /* copy convolved colors into span array */ - _mesa_memcpy(rgba, src, width * 4 * sizeof(GLfloat)); + memcpy(rgba, src, width * 4 * sizeof(GLfloat)); /* write span */ span.x = destx; @@ -273,7 +273,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, /* Get row/span of source pixels */ if (overlapping) { /* get from buffered image */ - _mesa_memcpy(rgba, p, width * sizeof(GLfloat) * 4); + memcpy(rgba, p, width * sizeof(GLfloat) * 4); p += width * 4; } else { @@ -374,7 +374,7 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, for (j = 0; j < height; j++, sy += stepy, dy += stepy) { /* Get color indexes */ if (overlapping) { - _mesa_memcpy(span.array->index, p, width * sizeof(GLuint)); + memcpy(span.array->index, p, width * sizeof(GLuint)); p += width; } else { @@ -508,7 +508,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLfloat depth[MAX_WIDTH]; /* get depth values */ if (overlapping) { - _mesa_memcpy(depth, p, width * sizeof(GLfloat)); + memcpy(depth, p, width * sizeof(GLfloat)); p += width; } else { @@ -606,7 +606,7 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, /* Get stencil values */ if (overlapping) { - _mesa_memcpy(stencil, p, width * sizeof(GLstencil)); + memcpy(stencil, p, width * sizeof(GLstencil)); p += width; } else { @@ -730,7 +730,7 @@ copy_depth_stencil_pixels(GLcontext *ctx, /* Get stencil values */ if (overlapping) { - _mesa_memcpy(stencil, stencilPtr, width * sizeof(GLstencil)); + memcpy(stencil, stencilPtr, width * sizeof(GLstencil)); stencilPtr += width; } else { @@ -759,7 +759,7 @@ copy_depth_stencil_pixels(GLcontext *ctx, /* get depth values */ if (overlapping) { - _mesa_memcpy(depth, depthPtr, width * sizeof(GLfloat)); + memcpy(depth, depthPtr, width * sizeof(GLfloat)); depthPtr += width; } else { diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 248d6cc1c04..136c296e98a 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -473,7 +473,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, _mesa_image_address2d(unpack, pixels, width, height, GL_DEPTH_COMPONENT, type, row, 0); if (shift == 0) { - _mesa_memcpy(span.array->z, zSrc, width * sizeof(GLuint)); + memcpy(span.array->z, zSrc, width * sizeof(GLuint)); } else { GLint col; diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 85d30cc929e..63a8d4e350e 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -993,8 +993,8 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) if (numBuffers > 1) { /* save indexes for second, third renderbuffer writes */ - _mesa_memcpy(indexSave, span->array->index, - span->end * sizeof(indexSave[0])); + memcpy(indexSave, span->array->index, + span->end * sizeof(indexSave[0])); } if (ctx->Color.IndexLogicOpEnabled) { @@ -1073,8 +1073,8 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) if (buf + 1 < numBuffers) { /* restore original span values */ - _mesa_memcpy(span->array->index, indexSave, - span->end * sizeof(indexSave[0])); + memcpy(span->array->index, indexSave, + span->end * sizeof(indexSave[0])); } } /* for buf */ } @@ -1510,8 +1510,8 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) if (!multiFragOutputs && numBuffers > 1) { /* save colors for second, third renderbuffer writes */ - _mesa_memcpy(rgbaSave, span->array->rgba, - 4 * span->end * sizeof(GLchan)); + memcpy(rgbaSave, span->array->rgba, + 4 * span->end * sizeof(GLchan)); } ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB); @@ -1544,8 +1544,8 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) if (!multiFragOutputs && numBuffers > 1) { /* restore original span values */ - _mesa_memcpy(span->array->rgba, rgbaSave, - 4 * span->end * sizeof(GLchan)); + memcpy(span->array->rgba, rgbaSave, + 4 * span->end * sizeof(GLchan)); } } /* if rb */ diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index e9e9d3a4f10..5e9a4e37c7d 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -475,7 +475,7 @@ stencil_and_ztest_span(GLcontext *ctx, SWspan *span, GLuint face) GLubyte passMask[MAX_WIDTH], failMask[MAX_WIDTH], origMask[MAX_WIDTH]; /* save the current mask bits */ - _mesa_memcpy(origMask, mask, n * sizeof(GLubyte)); + memcpy(origMask, mask, n * sizeof(GLubyte)); /* apply the depth test */ _swrast_depth_test_span(ctx, span); @@ -918,7 +918,7 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) ASSERT(rb->DataType == GL_UNSIGNED_BYTE); _swrast_get_values(ctx, rb, n, x, y, stencil, sizeof(GLubyte)); - _mesa_memcpy(origMask, mask, n * sizeof(GLubyte)); + memcpy(origMask, mask, n * sizeof(GLubyte)); (void) do_stencil_test(ctx, face, n, stencil, mask); @@ -928,7 +928,7 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) } else { GLubyte tmpMask[MAX_WIDTH]; - _mesa_memcpy(tmpMask, mask, n * sizeof(GLubyte)); + memcpy(tmpMask, mask, n * sizeof(GLubyte)); _swrast_depth_test_span(ctx, span); @@ -962,7 +962,7 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) ctx->Stencil.ZPassFunc[face], face, mask); } else { - _mesa_memcpy(origMask, mask, n * sizeof(GLubyte)); + memcpy(origMask, mask, n * sizeof(GLubyte)); _swrast_depth_test_span(ctx, span); diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index d3955873dcd..2b8c962f063 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -236,7 +236,7 @@ void _tnl_get_attr( GLcontext *ctx, const void *vin, dest[0] = ctx->Point.Size; } else { - _mesa_memcpy( dest, ctx->Current.Attrib[attr], 4*sizeof(GLfloat)); + memcpy( dest, ctx->Current.Attrib[attr], 4*sizeof(GLfloat)); } } diff --git a/src/mesa/tnl/t_vertex_generic.c b/src/mesa/tnl/t_vertex_generic.c index 99ddace73d1..b1ea1424649 100644 --- a/src/mesa/tnl/t_vertex_generic.c +++ b/src/mesa/tnl/t_vertex_generic.c @@ -1074,9 +1074,9 @@ void _tnl_generic_copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc ) if (a[j].attrib == VERT_ATTRIB_COLOR0 || a[j].attrib == VERT_ATTRIB_COLOR1) { - _mesa_memcpy( vdst + a[j].vertoffset, - vsrc + a[j].vertoffset, - a[j].vertattrsize ); + memcpy( vdst + a[j].vertoffset, + vsrc + a[j].vertoffset, + a[j].vertattrsize ); } } } diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 8ee14be2610..b10ee2105a3 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -126,8 +126,8 @@ void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ) assert(exec->vtx.max_vert - exec->vtx.vert_count > exec->vtx.copied.nr); for (i = 0 ; i < exec->vtx.copied.nr ; i++) { - _mesa_memcpy( exec->vtx.buffer_ptr, data, - exec->vtx.vertex_size * sizeof(GLfloat)); + memcpy( exec->vtx.buffer_ptr, data, + exec->vtx.vertex_size * sizeof(GLfloat)); exec->vtx.buffer_ptr += exec->vtx.vertex_size; data += exec->vtx.vertex_size; exec->vtx.vert_count++; @@ -414,13 +414,13 @@ static void GLAPIENTRY vbo_exec_EvalCoord1f( GLfloat u ) } - _mesa_memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, - exec->vtx.vertex_size * sizeof(GLfloat)); + memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, + exec->vtx.vertex_size * sizeof(GLfloat)); vbo_exec_do_EvalCoord1f( exec, u ); - _mesa_memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, - exec->vtx.vertex_size * sizeof(GLfloat)); + memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, + exec->vtx.vertex_size * sizeof(GLfloat)); } static void GLAPIENTRY vbo_exec_EvalCoord2f( GLfloat u, GLfloat v ) @@ -444,13 +444,13 @@ static void GLAPIENTRY vbo_exec_EvalCoord2f( GLfloat u, GLfloat v ) vbo_exec_fixup_vertex( ctx, VBO_ATTRIB_NORMAL, 3 ); } - _mesa_memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, - exec->vtx.vertex_size * sizeof(GLfloat)); + memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, + exec->vtx.vertex_size * sizeof(GLfloat)); vbo_exec_do_EvalCoord2f( exec, u, v ); - _mesa_memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, - exec->vtx.vertex_size * sizeof(GLfloat)); + memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, + exec->vtx.vertex_size * sizeof(GLfloat)); } static void GLAPIENTRY vbo_exec_EvalCoord1fv( const GLfloat *u ) diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index d7dbbceb1b7..526bf7ae79c 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -85,24 +85,24 @@ vbo_copy_vertices( struct vbo_exec_context *exec ) case GL_LINES: ovf = nr&1; for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); return i; case GL_TRIANGLES: ovf = nr%3; for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); return i; case GL_QUADS: ovf = nr&3; for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); return i; case GL_LINE_STRIP: if (nr == 0) { return 0; } else { - _mesa_memcpy( dst, src+(nr-1)*sz, sz * sizeof(GLfloat) ); + memcpy( dst, src+(nr-1)*sz, sz * sizeof(GLfloat) ); return 1; } case GL_LINE_LOOP: @@ -112,12 +112,12 @@ vbo_copy_vertices( struct vbo_exec_context *exec ) return 0; } else if (nr == 1) { - _mesa_memcpy( dst, src+0, sz * sizeof(GLfloat) ); + memcpy( dst, src+0, sz * sizeof(GLfloat) ); return 1; } else { - _mesa_memcpy( dst, src+0, sz * sizeof(GLfloat) ); - _mesa_memcpy( dst+sz, src+(nr-1)*sz, sz * sizeof(GLfloat) ); + memcpy( dst, src+0, sz * sizeof(GLfloat) ); + memcpy( dst+sz, src+(nr-1)*sz, sz * sizeof(GLfloat) ); return 2; } case GL_TRIANGLE_STRIP: @@ -139,7 +139,7 @@ vbo_copy_vertices( struct vbo_exec_context *exec ) break; } for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); return i; case PRIM_OUTSIDE_BEGIN_END: return 0; diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 3f86c68b249..e1caa6f8c5f 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -118,23 +118,23 @@ static GLuint _save_copy_vertices( GLcontext *ctx, case GL_LINES: ovf = nr&1; for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); return i; case GL_TRIANGLES: ovf = nr%3; for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); return i; case GL_QUADS: ovf = nr&3; for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); return i; case GL_LINE_STRIP: if (nr == 0) return 0; else { - _mesa_memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) ); + memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) ); return 1; } case GL_LINE_LOOP: @@ -143,11 +143,11 @@ static GLuint _save_copy_vertices( GLcontext *ctx, if (nr == 0) return 0; else if (nr == 1) { - _mesa_memcpy( dst, src+0, sz*sizeof(GLfloat) ); + memcpy( dst, src+0, sz*sizeof(GLfloat) ); return 1; } else { - _mesa_memcpy( dst, src+0, sz*sizeof(GLfloat) ); - _mesa_memcpy( dst+sz, src+(nr-1)*sz, sz*sizeof(GLfloat) ); + memcpy( dst, src+0, sz*sizeof(GLfloat) ); + memcpy( dst+sz, src+(nr-1)*sz, sz*sizeof(GLfloat) ); return 2; } case GL_TRIANGLE_STRIP: @@ -158,7 +158,7 @@ static GLuint _save_copy_vertices( GLcontext *ctx, default: ovf = 2 + (nr&1); break; } for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); return i; default: assert(0); @@ -277,7 +277,7 @@ static void _save_compile_vertex_list( GLcontext *ctx ) /* Duplicate our template, increment refcounts to the storage structs: */ - _mesa_memcpy(node->attrsz, save->attrsz, sizeof(node->attrsz)); + memcpy(node->attrsz, save->attrsz, sizeof(node->attrsz)); node->vertex_size = save->vertex_size; node->buffer_offset = (save->buffer - save->vertex_store->buffer) * sizeof(GLfloat); node->count = save->vert_count; @@ -441,7 +441,7 @@ static void _save_wrap_filled_vertex( GLcontext *ctx ) assert(save->max_vert - save->vert_count > save->copied.nr); for (i = 0 ; i < save->copied.nr ; i++) { - _mesa_memcpy( save->buffer_ptr, data, save->vertex_size * sizeof(GLfloat)); + memcpy( save->buffer_ptr, data, save->vertex_size * sizeof(GLfloat)); data += save->vertex_size; save->buffer_ptr += save->vertex_size; save->vert_count++; diff --git a/src/mesa/vf/vf.c b/src/mesa/vf/vf.c index 82f3d2b641d..15a78c4c0af 100644 --- a/src/mesa/vf/vf.c +++ b/src/mesa/vf/vf.c @@ -296,7 +296,7 @@ void vf_get_attr( struct vertex_fetch *vf, /* Else return the value from ctx->Current. */ - _mesa_memcpy( dest, dflt, 4*sizeof(GLfloat)); + memcpy( dest, dflt, 4*sizeof(GLfloat)); } -- cgit v1.2.3 From e197de56cdb86835f1437688a9161cd909792d80 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 Feb 2010 08:09:01 -0700 Subject: mesa: replace old MEMCPY macro with memcpy --- src/gallium/state_trackers/glx/xlib/xm_api.c | 2 +- src/mesa/drivers/dri/mga/mgapixel.c | 2 +- src/mesa/drivers/dri/tdfx/tdfx_pixels.c | 6 +-- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 4 +- src/mesa/drivers/glide/fxdd.c | 6 +-- src/mesa/drivers/glide/fxddtex.c | 4 +- src/mesa/drivers/x11/xm_api.c | 12 +++--- src/mesa/main/attrib.c | 60 ++++++++++++++-------------- src/mesa/main/context.c | 2 +- src/mesa/main/dlist.c | 14 +++---- src/mesa/main/imports.h | 2 - src/mesa/main/mipmap.c | 40 +++++++++---------- src/mesa/main/pixel.c | 4 +- src/mesa/main/texstore.c | 4 +- src/mesa/math/m_matrix.c | 28 ++++++------- src/mesa/shader/nvfragparse.c | 2 +- src/mesa/shader/nvprogram.c | 2 +- src/mesa/shader/nvvertparse.c | 2 +- src/mesa/shader/prog_statevars.c | 2 +- src/mesa/swrast/s_zoom.c | 8 ++-- src/mesa/tnl/t_pipeline.c | 2 +- src/mesa/tnl/t_vb_program.c | 2 +- 22 files changed, 104 insertions(+), 106 deletions(-) (limited to 'src/mesa/shader/nvfragparse.c') diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index fb314f3b528..2e678c8f1e0 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -678,7 +678,7 @@ XMesaVisual XMesaCreateVisual( Display *display, _mesa_free(v); return NULL; } - MEMCPY(v->visinfo, visinfo, sizeof(*visinfo)); + memcpy(v->visinfo, visinfo, sizeof(*visinfo)); v->ximage_flag = ximage_flag; diff --git a/src/mesa/drivers/dri/mga/mgapixel.c b/src/mesa/drivers/dri/mga/mgapixel.c index 69415f8a839..664f7c77c2b 100644 --- a/src/mesa/drivers/dri/mga/mgapixel.c +++ b/src/mesa/drivers/dri/mga/mgapixel.c @@ -600,7 +600,7 @@ mgaTryDrawPixels( GLcontext *ctx, } } #else - MEMCPY( address, pixels, rows*bufferpitch ); + memcpy( address, pixels, rows*bufferpitch ); #endif do_draw_pix( ctx, x, y, width, rows, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c index 44496274188..5a7184056dc 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c @@ -519,7 +519,7 @@ tdfx_readpixels_R5G6B5(GLcontext * ctx, GLint x, GLint y, const GLint widthInBytes = width * 2; GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; src -= srcStride; } @@ -578,7 +578,7 @@ tdfx_readpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y, { GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; src -= srcStride; } @@ -672,7 +672,7 @@ tdfx_drawpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y, (format == GL_BGRA && type == GL_UNSIGNED_BYTE)) { GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst -= dstStride; src += srcStride; } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index e31ae97b023..1c51452c104 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -1660,7 +1660,7 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, texImage->Data); ti->padded = GL_TRUE; } else { - MEMCPY(texImage->Data, data, compressedSize); + memcpy(texImage->Data, data, compressedSize); } RevalidateTexture(ctx, texObj); @@ -1707,7 +1707,7 @@ tdfxCompressedTexSubImage2D( GLcontext *ctx, GLenum target, rows = height / 4; /* [dBorca] hardcoded 4, but works for FXT1/DXTC */ for (i = 0; i < rows; i++) { - MEMCPY(dest, data, srcRowStride); + memcpy(dest, data, srcRowStride); dest += destRowStride; data = (GLvoid *)((intptr_t)data + (intptr_t)srcRowStride); } diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 2bc60399ea2..d94bf08a882 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -840,7 +840,7 @@ fxDDReadPixels565 (GLcontext * ctx, const GLint widthInBytes = width * 2; GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; src -= srcStride; } @@ -953,7 +953,7 @@ fxDDReadPixels555 (GLcontext * ctx, const GLint widthInBytes = width * 2; GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; src -= srcStride; } @@ -1572,7 +1572,7 @@ fxDDDrawPixels8888 (GLcontext * ctx, GLint x, GLint y, for (row = 0; row < height; row++) { GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack, pixels, width, height, format, type, row, 0); - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; } } diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 9dd4f1e9c37..a87a28ac3e0 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1688,7 +1688,7 @@ fxDDCompressedTexImage2D (GLcontext *ctx, GLenum target, texImage->Data); ti->padded = GL_TRUE; } else { - MEMCPY(texImage->Data, data, texImage->CompressedSize); + memcpy(texImage->Data, data, texImage->CompressedSize); } ti->info.format = mml->glideFormat; @@ -1739,7 +1739,7 @@ fxDDCompressedTexSubImage2D( GLcontext *ctx, GLenum target, rows = height / 4; /* hardcoded 4, but works for FXT1/DXTC */ for (i = 0; i < rows; i++) { - MEMCPY(dest, data, srcRowStride); + memcpy(dest, data, srcRowStride); dest += destRowStride; data = (GLvoid *)((GLuint)data + (GLuint)srcRowStride); } diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 1a5456e1be2..98ce6c5831a 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -511,12 +511,12 @@ xmesa_free_buffer(XMesaBuffer buffer) static void copy_colortable_info(XMesaBuffer dst, const XMesaBuffer src) { - MEMCPY(dst->color_table, src->color_table, sizeof(src->color_table)); - MEMCPY(dst->pixel_to_r, src->pixel_to_r, sizeof(src->pixel_to_r)); - MEMCPY(dst->pixel_to_g, src->pixel_to_g, sizeof(src->pixel_to_g)); - MEMCPY(dst->pixel_to_b, src->pixel_to_b, sizeof(src->pixel_to_b)); + memcpy(dst->color_table, src->color_table, sizeof(src->color_table)); + memcpy(dst->pixel_to_r, src->pixel_to_r, sizeof(src->pixel_to_r)); + memcpy(dst->pixel_to_g, src->pixel_to_g, sizeof(src->pixel_to_g)); + memcpy(dst->pixel_to_b, src->pixel_to_b, sizeof(src->pixel_to_b)); dst->num_alloced = src->num_alloced; - MEMCPY(dst->alloced_colors, src->alloced_colors, + memcpy(dst->alloced_colors, src->alloced_colors, sizeof(src->alloced_colors)); } @@ -1376,7 +1376,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, _mesa_free(v); return NULL; } - MEMCPY(v->visinfo, visinfo, sizeof(*visinfo)); + memcpy(v->visinfo, visinfo, sizeof(*visinfo)); #endif /* check for MESA_GAMMA environment variable */ diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 881644cdaf2..44dc3b871ec 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -222,7 +222,7 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_ACCUM_BUFFER_BIT) { struct gl_accum_attrib *attr; attr = MALLOC_STRUCT( gl_accum_attrib ); - MEMCPY( attr, &ctx->Accum, sizeof(struct gl_accum_attrib) ); + memcpy( attr, &ctx->Accum, sizeof(struct gl_accum_attrib) ); save_attrib_data(&head, GL_ACCUM_BUFFER_BIT, attr); } @@ -230,7 +230,7 @@ _mesa_PushAttrib(GLbitfield mask) GLuint i; struct gl_colorbuffer_attrib *attr; attr = MALLOC_STRUCT( gl_colorbuffer_attrib ); - MEMCPY( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) ); + memcpy( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) ); /* push the Draw FBO's DrawBuffer[] state, not ctx->Color.DrawBuffer[] */ for (i = 0; i < ctx->Const.MaxDrawBuffers; i ++) attr->DrawBuffer[i] = ctx->DrawBuffer->ColorDrawBuffer[i]; @@ -241,14 +241,14 @@ _mesa_PushAttrib(GLbitfield mask) struct gl_current_attrib *attr; FLUSH_CURRENT( ctx, 0 ); attr = MALLOC_STRUCT( gl_current_attrib ); - MEMCPY( attr, &ctx->Current, sizeof(struct gl_current_attrib) ); + memcpy( attr, &ctx->Current, sizeof(struct gl_current_attrib) ); save_attrib_data(&head, GL_CURRENT_BIT, attr); } if (mask & GL_DEPTH_BUFFER_BIT) { struct gl_depthbuffer_attrib *attr; attr = MALLOC_STRUCT( gl_depthbuffer_attrib ); - MEMCPY( attr, &ctx->Depth, sizeof(struct gl_depthbuffer_attrib) ); + memcpy( attr, &ctx->Depth, sizeof(struct gl_depthbuffer_attrib) ); save_attrib_data(&head, GL_DEPTH_BUFFER_BIT, attr); } @@ -292,7 +292,7 @@ _mesa_PushAttrib(GLbitfield mask) attr->Map1TextureCoord4 = ctx->Eval.Map1TextureCoord4; attr->Map1Vertex3 = ctx->Eval.Map1Vertex3; attr->Map1Vertex4 = ctx->Eval.Map1Vertex4; - MEMCPY(attr->Map1Attrib, ctx->Eval.Map1Attrib, sizeof(ctx->Eval.Map1Attrib)); + memcpy(attr->Map1Attrib, ctx->Eval.Map1Attrib, sizeof(ctx->Eval.Map1Attrib)); attr->Map2Color4 = ctx->Eval.Map2Color4; attr->Map2Index = ctx->Eval.Map2Index; attr->Map2Normal = ctx->Eval.Map2Normal; @@ -302,7 +302,7 @@ _mesa_PushAttrib(GLbitfield mask) attr->Map2TextureCoord4 = ctx->Eval.Map2TextureCoord4; attr->Map2Vertex3 = ctx->Eval.Map2Vertex3; attr->Map2Vertex4 = ctx->Eval.Map2Vertex4; - MEMCPY(attr->Map2Attrib, ctx->Eval.Map2Attrib, sizeof(ctx->Eval.Map2Attrib)); + memcpy(attr->Map2Attrib, ctx->Eval.Map2Attrib, sizeof(ctx->Eval.Map2Attrib)); attr->Normalize = ctx->Transform.Normalize; attr->RasterPositionUnclipped = ctx->Transform.RasterPositionUnclipped; attr->PointSmooth = ctx->Point.SmoothFlag; @@ -336,21 +336,21 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_EVAL_BIT) { struct gl_eval_attrib *attr; attr = MALLOC_STRUCT( gl_eval_attrib ); - MEMCPY( attr, &ctx->Eval, sizeof(struct gl_eval_attrib) ); + memcpy( attr, &ctx->Eval, sizeof(struct gl_eval_attrib) ); save_attrib_data(&head, GL_EVAL_BIT, attr); } if (mask & GL_FOG_BIT) { struct gl_fog_attrib *attr; attr = MALLOC_STRUCT( gl_fog_attrib ); - MEMCPY( attr, &ctx->Fog, sizeof(struct gl_fog_attrib) ); + memcpy( attr, &ctx->Fog, sizeof(struct gl_fog_attrib) ); save_attrib_data(&head, GL_FOG_BIT, attr); } if (mask & GL_HINT_BIT) { struct gl_hint_attrib *attr; attr = MALLOC_STRUCT( gl_hint_attrib ); - MEMCPY( attr, &ctx->Hint, sizeof(struct gl_hint_attrib) ); + memcpy( attr, &ctx->Hint, sizeof(struct gl_hint_attrib) ); save_attrib_data(&head, GL_HINT_BIT, attr); } @@ -358,28 +358,28 @@ _mesa_PushAttrib(GLbitfield mask) struct gl_light_attrib *attr; FLUSH_CURRENT(ctx, 0); /* flush material changes */ attr = MALLOC_STRUCT( gl_light_attrib ); - MEMCPY( attr, &ctx->Light, sizeof(struct gl_light_attrib) ); + memcpy( attr, &ctx->Light, sizeof(struct gl_light_attrib) ); save_attrib_data(&head, GL_LIGHTING_BIT, attr); } if (mask & GL_LINE_BIT) { struct gl_line_attrib *attr; attr = MALLOC_STRUCT( gl_line_attrib ); - MEMCPY( attr, &ctx->Line, sizeof(struct gl_line_attrib) ); + memcpy( attr, &ctx->Line, sizeof(struct gl_line_attrib) ); save_attrib_data(&head, GL_LINE_BIT, attr); } if (mask & GL_LIST_BIT) { struct gl_list_attrib *attr; attr = MALLOC_STRUCT( gl_list_attrib ); - MEMCPY( attr, &ctx->List, sizeof(struct gl_list_attrib) ); + memcpy( attr, &ctx->List, sizeof(struct gl_list_attrib) ); save_attrib_data(&head, GL_LIST_BIT, attr); } if (mask & GL_PIXEL_MODE_BIT) { struct gl_pixel_attrib *attr; attr = MALLOC_STRUCT( gl_pixel_attrib ); - MEMCPY( attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib) ); + memcpy( attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib) ); /* push the Read FBO's ReadBuffer state, not ctx->Pixel.ReadBuffer */ attr->ReadBuffer = ctx->ReadBuffer->ColorReadBuffer; save_attrib_data(&head, GL_PIXEL_MODE_BIT, attr); @@ -388,35 +388,35 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_POINT_BIT) { struct gl_point_attrib *attr; attr = MALLOC_STRUCT( gl_point_attrib ); - MEMCPY( attr, &ctx->Point, sizeof(struct gl_point_attrib) ); + memcpy( attr, &ctx->Point, sizeof(struct gl_point_attrib) ); save_attrib_data(&head, GL_POINT_BIT, attr); } if (mask & GL_POLYGON_BIT) { struct gl_polygon_attrib *attr; attr = MALLOC_STRUCT( gl_polygon_attrib ); - MEMCPY( attr, &ctx->Polygon, sizeof(struct gl_polygon_attrib) ); + memcpy( attr, &ctx->Polygon, sizeof(struct gl_polygon_attrib) ); save_attrib_data(&head, GL_POLYGON_BIT, attr); } if (mask & GL_POLYGON_STIPPLE_BIT) { GLuint *stipple; stipple = (GLuint *) MALLOC( 32*sizeof(GLuint) ); - MEMCPY( stipple, ctx->PolygonStipple, 32*sizeof(GLuint) ); + memcpy( stipple, ctx->PolygonStipple, 32*sizeof(GLuint) ); save_attrib_data(&head, GL_POLYGON_STIPPLE_BIT, stipple); } if (mask & GL_SCISSOR_BIT) { struct gl_scissor_attrib *attr; attr = MALLOC_STRUCT( gl_scissor_attrib ); - MEMCPY( attr, &ctx->Scissor, sizeof(struct gl_scissor_attrib) ); + memcpy( attr, &ctx->Scissor, sizeof(struct gl_scissor_attrib) ); save_attrib_data(&head, GL_SCISSOR_BIT, attr); } if (mask & GL_STENCIL_BUFFER_BIT) { struct gl_stencil_attrib *attr; attr = MALLOC_STRUCT( gl_stencil_attrib ); - MEMCPY( attr, &ctx->Stencil, sizeof(struct gl_stencil_attrib) ); + memcpy( attr, &ctx->Stencil, sizeof(struct gl_stencil_attrib) ); save_attrib_data(&head, GL_STENCIL_BUFFER_BIT, attr); } @@ -460,14 +460,14 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_TRANSFORM_BIT) { struct gl_transform_attrib *attr; attr = MALLOC_STRUCT( gl_transform_attrib ); - MEMCPY( attr, &ctx->Transform, sizeof(struct gl_transform_attrib) ); + memcpy( attr, &ctx->Transform, sizeof(struct gl_transform_attrib) ); save_attrib_data(&head, GL_TRANSFORM_BIT, attr); } if (mask & GL_VIEWPORT_BIT) { struct gl_viewport_attrib *attr; attr = MALLOC_STRUCT( gl_viewport_attrib ); - MEMCPY( attr, &ctx->Viewport, sizeof(struct gl_viewport_attrib) ); + memcpy( attr, &ctx->Viewport, sizeof(struct gl_viewport_attrib) ); save_attrib_data(&head, GL_VIEWPORT_BIT, attr); } @@ -475,7 +475,7 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_MULTISAMPLE_BIT_ARB) { struct gl_multisample_attrib *attr; attr = MALLOC_STRUCT( gl_multisample_attrib ); - MEMCPY( attr, &ctx->Multisample, sizeof(struct gl_multisample_attrib) ); + memcpy( attr, &ctx->Multisample, sizeof(struct gl_multisample_attrib) ); save_attrib_data(&head, GL_MULTISAMPLE_BIT_ARB, attr); } @@ -1010,7 +1010,7 @@ _mesa_PopAttrib(void) break; case GL_CURRENT_BIT: FLUSH_CURRENT( ctx, 0 ); - MEMCPY( &ctx->Current, attr->data, + memcpy( &ctx->Current, attr->data, sizeof(struct gl_current_attrib) ); break; case GL_DEPTH_BUFFER_BIT: @@ -1032,7 +1032,7 @@ _mesa_PopAttrib(void) } break; case GL_EVAL_BIT: - MEMCPY( &ctx->Eval, attr->data, sizeof(struct gl_eval_attrib) ); + memcpy( &ctx->Eval, attr->data, sizeof(struct gl_eval_attrib) ); ctx->NewState |= _NEW_EVAL; break; case GL_FOG_BIT: @@ -1126,7 +1126,7 @@ _mesa_PopAttrib(void) _mesa_set_enable(ctx, GL_COLOR_MATERIAL, light->ColorMaterialEnabled); /* materials */ - MEMCPY(&ctx->Light.Material, &light->Material, + memcpy(&ctx->Light.Material, &light->Material, sizeof(struct gl_material)); } break; @@ -1141,10 +1141,10 @@ _mesa_PopAttrib(void) } break; case GL_LIST_BIT: - MEMCPY( &ctx->List, attr->data, sizeof(struct gl_list_attrib) ); + memcpy( &ctx->List, attr->data, sizeof(struct gl_list_attrib) ); break; case GL_PIXEL_MODE_BIT: - MEMCPY( &ctx->Pixel, attr->data, sizeof(struct gl_pixel_attrib) ); + memcpy( &ctx->Pixel, attr->data, sizeof(struct gl_pixel_attrib) ); /* XXX what other pixel state needs to be set by function calls? */ _mesa_ReadBuffer(ctx->Pixel.ReadBuffer); ctx->NewState |= _NEW_PIXEL; @@ -1203,7 +1203,7 @@ _mesa_PopAttrib(void) } break; case GL_POLYGON_STIPPLE_BIT: - MEMCPY( ctx->PolygonStipple, attr->data, 32*sizeof(GLuint) ); + memcpy( ctx->PolygonStipple, attr->data, 32*sizeof(GLuint) ); ctx->NewState |= _NEW_POLYGONSTIPPLE; if (ctx->Driver.PolygonStipple) ctx->Driver.PolygonStipple( ctx, (const GLubyte *) attr->data ); @@ -1417,8 +1417,8 @@ _mesa_PushClientAttrib(GLbitfield mask) ctx->Array.ElementArrayBufferObj->RefCount++; #endif - MEMCPY( attr, &ctx->Array, sizeof(struct gl_array_attrib) ); - MEMCPY( obj, ctx->Array.ArrayObj, sizeof(struct gl_array_object) ); + memcpy( attr, &ctx->Array, sizeof(struct gl_array_attrib) ); + memcpy( obj, ctx->Array.ArrayObj, sizeof(struct gl_array_object) ); attr->ArrayObj = obj; @@ -1492,7 +1492,7 @@ _mesa_PopClientAttrib(void) data->ElementArrayBufferObj->Name); #endif - MEMCPY( ctx->Array.ArrayObj, data->ArrayObj, + memcpy( ctx->Array.ArrayObj, data->ArrayObj, sizeof( struct gl_array_object ) ); FREE( data->ArrayObj ); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index c292d1fea5e..f315f0b212b 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1108,7 +1108,7 @@ _mesa_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask ) dst->Polygon = src->Polygon; } if (mask & GL_POLYGON_STIPPLE_BIT) { - /* Use loop instead of MEMCPY due to problem with Portland Group's + /* Use loop instead of memcpy due to problem with Portland Group's * C compiler. Reported by John Stone. */ GLuint i; diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index ea0d13b8906..9c472d85e32 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -2913,7 +2913,7 @@ save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values) n[1].e = map; n[2].i = mapsize; n[3].data = (void *) _mesa_malloc(mapsize * sizeof(GLfloat)); - MEMCPY(n[3].data, (void *) values, mapsize * sizeof(GLfloat)); + memcpy(n[3].data, (void *) values, mapsize * sizeof(GLfloat)); } if (ctx->ExecuteFlag) { CALL_PixelMapfv(ctx->Exec, (map, mapsize, values)); @@ -4365,7 +4365,7 @@ save_CompressedTexImage1DARB(GLenum target, GLint level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7); if (n) { n[1].e = target; @@ -4411,7 +4411,7 @@ save_CompressedTexImage2DARB(GLenum target, GLint level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8); if (n) { n[1].e = target; @@ -4458,7 +4458,7 @@ save_CompressedTexImage3DARB(GLenum target, GLint level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9); if (n) { n[1].e = target; @@ -4501,7 +4501,7 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage1DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7); if (n) { n[1].e = target; @@ -4541,7 +4541,7 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage2DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9); if (n) { n[1].e = target; @@ -4583,7 +4583,7 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage3DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11); if (n) { n[1].e = target; diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index d5ab7cdc206..c4e28df0513 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -71,8 +71,6 @@ extern "C" { /** Free aligned memory */ #define ALIGN_FREE(PTR) _mesa_align_free(PTR) -/** Copy \p BYTES bytes from \p SRC into \p DST */ -#define MEMCPY( DST, SRC, BYTES) memcpy(DST, SRC, BYTES) /** Set \p N bytes in \p DST to \p VAL */ #define MEMSET( DST, VAL, N ) memset(DST, VAL, N) diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 77cd1d41595..1da576337f9 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -979,9 +979,9 @@ make_1d_mipmap(GLenum datatype, GLuint comps, GLint border, if (border) { /* copy left-most pixel from source */ - MEMCPY(dstPtr, srcPtr, bpt); + memcpy(dstPtr, srcPtr, bpt); /* copy right-most pixel from source */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth - 1) * bpt, srcPtr + (srcWidth - 1) * bpt, bpt); } @@ -1025,15 +1025,15 @@ make_2d_mipmap(GLenum datatype, GLuint comps, GLint border, if (border > 0) { /* fill in dest border */ /* lower-left border pixel */ - MEMCPY(dstPtr, srcPtr, bpt); + memcpy(dstPtr, srcPtr, bpt); /* lower-right border pixel */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth - 1) * bpt, srcPtr + (srcWidth - 1) * bpt, bpt); /* upper-left border pixel */ - MEMCPY(dstPtr + dstWidth * (dstHeight - 1) * bpt, + memcpy(dstPtr + dstWidth * (dstHeight - 1) * bpt, srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt); /* upper-right border pixel */ - MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt, + memcpy(dstPtr + (dstWidth * dstHeight - 1) * bpt, srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt); /* lower border */ do_row(datatype, comps, srcWidthNB, @@ -1050,9 +1050,9 @@ make_2d_mipmap(GLenum datatype, GLuint comps, GLint border, if (srcHeight == dstHeight) { /* copy border pixel from src to dst */ for (row = 1; row < srcHeight; row++) { - MEMCPY(dstPtr + dstWidth * row * bpt, + memcpy(dstPtr + dstWidth * row * bpt, srcPtr + srcWidth * row * bpt, bpt); - MEMCPY(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt); } } @@ -1174,28 +1174,28 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, /* do border along [img][row=0][col=0] */ src = srcPtr + (img + 1) * bytesPerSrcImage; dst = dstPtr + (img + 1) * bytesPerDstImage; - MEMCPY(dst, src, bpt); + memcpy(dst, src, bpt); /* do border along [img][row=dstHeight-1][col=0] */ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + (srcHeight - 1) * bytesPerSrcRow; dst = dstPtr + (img + 1) * bytesPerDstImage + (dstHeight - 1) * bytesPerDstRow; - MEMCPY(dst, src, bpt); + memcpy(dst, src, bpt); /* do border along [img][row=0][col=dstWidth-1] */ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + (srcWidth - 1) * bpt; dst = dstPtr + (img + 1) * bytesPerDstImage + (dstWidth - 1) * bpt; - MEMCPY(dst, src, bpt); + memcpy(dst, src, bpt); /* do border along [img][row=dstHeight-1][col=dstWidth-1] */ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + (bytesPerSrcImage - bpt); dst = dstPtr + (img + 1) * bytesPerDstImage + (bytesPerDstImage - bpt); - MEMCPY(dst, src, bpt); + memcpy(dst, src, bpt); } } else { @@ -1265,9 +1265,9 @@ make_1d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, if (border) { /* copy left-most pixel from source */ - MEMCPY(dstPtr, srcPtr, bpt); + memcpy(dstPtr, srcPtr, bpt); /* copy right-most pixel from source */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth - 1) * bpt, srcPtr + (srcWidth - 1) * bpt, bpt); } @@ -1319,15 +1319,15 @@ make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, if (border > 0) { /* fill in dest border */ /* lower-left border pixel */ - MEMCPY(dstPtr, srcPtr, bpt); + memcpy(dstPtr, srcPtr, bpt); /* lower-right border pixel */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth - 1) * bpt, srcPtr + (srcWidth - 1) * bpt, bpt); /* upper-left border pixel */ - MEMCPY(dstPtr + dstWidth * (dstHeight - 1) * bpt, + memcpy(dstPtr + dstWidth * (dstHeight - 1) * bpt, srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt); /* upper-right border pixel */ - MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt, + memcpy(dstPtr + (dstWidth * dstHeight - 1) * bpt, srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt); /* lower border */ do_row(datatype, comps, srcWidthNB, @@ -1344,9 +1344,9 @@ make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, if (srcHeight == dstHeight) { /* copy border pixel from src to dst */ for (row = 1; row < srcHeight; row++) { - MEMCPY(dstPtr + dstWidth * row * bpt, + memcpy(dstPtr + dstWidth * row * bpt, srcPtr + srcWidth * row * bpt, bpt); - MEMCPY(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt); } } diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index ca6ecd7bfb6..f6c316a5803 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -362,7 +362,7 @@ _mesa_GetPixelMapfv( GLenum map, GLfloat *values ) } } else { - MEMCPY(values, pm->Map, mapsize * sizeof(GLfloat)); + memcpy(values, pm->Map, mapsize * sizeof(GLfloat)); } _mesa_unmap_pbo_dest(ctx, &ctx->Pack); @@ -401,7 +401,7 @@ _mesa_GetPixelMapuiv( GLenum map, GLuint *values ) if (map == GL_PIXEL_MAP_S_TO_S) { /* special case */ - MEMCPY(values, ctx->PixelMaps.StoS.Map, mapsize * sizeof(GLint)); + memcpy(values, ctx->PixelMaps.StoS.Map, mapsize * sizeof(GLint)); } else { for (i = 0; i < mapsize; i++) { diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index c1418e0967a..ab572a13edf 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3716,7 +3716,7 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, return; /* copy the data */ - MEMCPY(texImage->Data, data, imageSize); + memcpy(texImage->Data, data, imageSize); _mesa_unmap_teximage_pbo(ctx, &ctx->Unpack); } @@ -3823,7 +3823,7 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, /* copy rows of blocks */ for (i = 0; i < rows; i++) { - MEMCPY(dest, src, bytesPerRow); + memcpy(dest, src, bytesPerRow); dest += destRowStride; src += srcRowStride; } diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index da6956efed5..e810d6deb82 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -599,7 +599,7 @@ static GLboolean invert_matrix_3d( GLmatrix *mat ) } else { /* pure translation */ - MEMCPY( out, Identity, sizeof(Identity) ); + memcpy( out, Identity, sizeof(Identity) ); MAT(out,0,3) = - MAT(in,0,3); MAT(out,1,3) = - MAT(in,1,3); MAT(out,2,3) = - MAT(in,2,3); @@ -637,7 +637,7 @@ static GLboolean invert_matrix_3d( GLmatrix *mat ) */ static GLboolean invert_matrix_identity( GLmatrix *mat ) { - MEMCPY( mat->inv, Identity, sizeof(Identity) ); + memcpy( mat->inv, Identity, sizeof(Identity) ); return GL_TRUE; } @@ -659,7 +659,7 @@ static GLboolean invert_matrix_3d_no_rot( GLmatrix *mat ) if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0 || MAT(in,2,2) == 0 ) return GL_FALSE; - MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); + memcpy( out, Identity, 16 * sizeof(GLfloat) ); MAT(out,0,0) = 1.0F / MAT(in,0,0); MAT(out,1,1) = 1.0F / MAT(in,1,1); MAT(out,2,2) = 1.0F / MAT(in,2,2); @@ -692,7 +692,7 @@ static GLboolean invert_matrix_2d_no_rot( GLmatrix *mat ) if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0) return GL_FALSE; - MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); + memcpy( out, Identity, 16 * sizeof(GLfloat) ); MAT(out,0,0) = 1.0F / MAT(in,0,0); MAT(out,1,1) = 1.0F / MAT(in,1,1); @@ -714,7 +714,7 @@ static GLboolean invert_matrix_perspective( GLmatrix *mat ) if (MAT(in,2,3) == 0) return GL_FALSE; - MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); + memcpy( out, Identity, 16 * sizeof(GLfloat) ); MAT(out,0,0) = 1.0F / MAT(in,0,0); MAT(out,1,1) = 1.0F / MAT(in,1,1); @@ -776,7 +776,7 @@ static GLboolean matrix_invert( GLmatrix *mat ) return GL_TRUE; } else { mat->flags |= MAT_FLAG_SINGULAR; - MEMCPY( mat->inv, Identity, sizeof(Identity) ); + memcpy( mat->inv, Identity, sizeof(Identity) ); return GL_FALSE; } } @@ -807,7 +807,7 @@ _math_matrix_rotate( GLmatrix *mat, s = (GLfloat) _mesa_sin( angle * DEG2RAD ); c = (GLfloat) _mesa_cos( angle * DEG2RAD ); - MEMCPY(m, Identity, sizeof(GLfloat)*16); + memcpy(m, Identity, sizeof(GLfloat)*16); optimized = GL_FALSE; #define M(row,col) m[col*4+row] @@ -1141,10 +1141,10 @@ _math_matrix_viewport(GLmatrix *m, GLint x, GLint y, GLint width, GLint height, void _math_matrix_set_identity( GLmatrix *mat ) { - MEMCPY( mat->m, Identity, 16*sizeof(GLfloat) ); + memcpy( mat->m, Identity, 16*sizeof(GLfloat) ); if (mat->inv) - MEMCPY( mat->inv, Identity, 16*sizeof(GLfloat) ); + memcpy( mat->inv, Identity, 16*sizeof(GLfloat) ); mat->type = MATRIX_IDENTITY; mat->flags &= ~(MAT_DIRTY_FLAGS| @@ -1444,7 +1444,7 @@ _math_matrix_is_dirty( const GLmatrix *m ) void _math_matrix_copy( GLmatrix *to, const GLmatrix *from ) { - MEMCPY( to->m, from->m, sizeof(Identity) ); + memcpy( to->m, from->m, sizeof(Identity) ); to->flags = from->flags; to->type = from->type; @@ -1453,7 +1453,7 @@ _math_matrix_copy( GLmatrix *to, const GLmatrix *from ) matrix_invert( to ); } else { - MEMCPY(to->inv, from->inv, sizeof(GLfloat)*16); + memcpy(to->inv, from->inv, sizeof(GLfloat)*16); } } } @@ -1470,7 +1470,7 @@ _math_matrix_copy( GLmatrix *to, const GLmatrix *from ) void _math_matrix_loadf( GLmatrix *mat, const GLfloat *m ) { - MEMCPY( mat->m, m, 16*sizeof(GLfloat) ); + memcpy( mat->m, m, 16*sizeof(GLfloat) ); mat->flags = (MAT_FLAG_GENERAL | MAT_DIRTY); } @@ -1486,7 +1486,7 @@ _math_matrix_ctr( GLmatrix *m ) { m->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); if (m->m) - MEMCPY( m->m, Identity, sizeof(Identity) ); + memcpy( m->m, Identity, sizeof(Identity) ); m->inv = NULL; m->type = MATRIX_IDENTITY; m->flags = 0; @@ -1525,7 +1525,7 @@ _math_matrix_alloc_inv( GLmatrix *m ) if (!m->inv) { m->inv = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); if (m->inv) - MEMCPY( m->inv, Identity, 16 * sizeof(GLfloat) ); + memcpy( m->inv, Identity, 16 * sizeof(GLfloat) ); } } diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index e226973c53f..35f18aa2fb7 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1479,7 +1479,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); return; } - MEMCPY(programString, str, len); + memcpy(programString, str, len); programString[len] = 0; /* Get ready to parse */ diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 394b6a42d71..19020be42c7 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -297,7 +297,7 @@ _mesa_GetProgramStringNV(GLuint id, GLenum pname, GLubyte *program) } if (prog->String) { - MEMCPY(program, prog->String, strlen((char *) prog->String)); + memcpy(program, prog->String, strlen((char *) prog->String)); } else { program[0] = 0; diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 1a840a3a928..3656438d42c 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1296,7 +1296,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); return; } - MEMCPY(programString, str, len); + memcpy(programString, str, len); programString[len] = 0; /* Get ready to parse */ diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index a0be1acfcab..f5264fa9189 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -1117,7 +1117,7 @@ static void load_transpose_matrix(GLfloat registers[][4], GLuint pos, const GLfloat mat[16]) { - MEMCPY(registers[pos], mat, 16 * sizeof(GLfloat)); + memcpy(registers[pos], mat, 16 * sizeof(GLfloat)); } diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index a48eae19259..bec16208e3d 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -324,14 +324,14 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, ((zoomed.array->ChanType == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) : 4 * sizeof(GLfloat)); if (y1 - y0 > 1) { - MEMCPY(rgbaSave, zoomed.array->rgba, zoomed.end * pixelSize); + memcpy(rgbaSave, zoomed.array->rgba, zoomed.end * pixelSize); } for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) { _swrast_write_rgba_span(ctx, &zoomed); zoomed.end = end; /* restore */ if (y1 - y0 > 1) { /* restore the colors */ - MEMCPY(zoomed.array->rgba, rgbaSave, zoomed.end * pixelSize); + memcpy(zoomed.array->rgba, rgbaSave, zoomed.end * pixelSize); } } } @@ -340,14 +340,14 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, GLuint *indexSave = (GLuint *) zoomed.array->attribs[FRAG_ATTRIB_FOGC]; const GLint end = zoomed.end; /* save */ if (y1 - y0 > 1) { - MEMCPY(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint)); + memcpy(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint)); } for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) { _swrast_write_index_span(ctx, &zoomed); zoomed.end = end; /* restore */ if (y1 - y0 > 1) { /* restore the colors */ - MEMCPY(zoomed.array->index, indexSave, zoomed.end * sizeof(GLuint)); + memcpy(zoomed.array->index, indexSave, zoomed.end * sizeof(GLuint)); } } } diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c index 946b29e250f..36fcd074cd9 100644 --- a/src/mesa/tnl/t_pipeline.c +++ b/src/mesa/tnl/t_pipeline.c @@ -47,7 +47,7 @@ void _tnl_install_pipeline( GLcontext *ctx, */ for (i = 0 ; i < MAX_PIPELINE_STAGES && stages[i] ; i++) { struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i]; - MEMCPY(s, stages[i], sizeof(*s)); + memcpy(s, stages[i], sizeof(*s)); if (s->create) s->create(ctx, s); } diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 44b64b17d15..5351b5fe41f 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -221,7 +221,7 @@ static void init_machine(GLcontext *ctx, struct gl_program_machine *machine) { /* Input registers get initialized from the current vertex attribs */ - MEMCPY(machine->VertAttribs, ctx->Current.Attrib, + memcpy(machine->VertAttribs, ctx->Current.Attrib, MAX_VERTEX_GENERIC_ATTRIBS * 4 * sizeof(GLfloat)); if (ctx->VertexProgram._Current->IsNVProgram) { -- cgit v1.2.3 From 6bf1ea897fa470af58fe8916dff45e2da79634a3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 Feb 2010 08:32:36 -0700 Subject: mesa: replace _mesa_bzero() with memset() --- src/mesa/drivers/common/driverfuncs.c | 2 +- src/mesa/drivers/dri/r300/r300_fragprog_common.c | 2 +- src/mesa/main/bufferobj.c | 2 +- src/mesa/main/dlist.c | 2 +- src/mesa/main/framebuffer.c | 6 +++--- src/mesa/main/imports.c | 11 ----------- src/mesa/main/imports.h | 3 --- src/mesa/main/renderbuffer.c | 4 ++-- src/mesa/main/texobj.c | 2 +- src/mesa/shader/nvfragparse.c | 2 +- src/mesa/shader/prog_instruction.c | 2 +- src/mesa/shader/program.c | 2 +- src/mesa/shader/slang/slang_emit.c | 4 ++-- src/mesa/shader/slang/slang_typeinfo.c | 2 +- src/mesa/swrast/s_depth.c | 16 ++++++++-------- src/mesa/swrast/s_fragprog.c | 3 +-- src/mesa/swrast/s_span.c | 4 ++-- 17 files changed, 27 insertions(+), 42 deletions(-) (limited to 'src/mesa/shader/nvfragparse.c') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 4f6f0836779..87163e6505c 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -70,7 +70,7 @@ void _mesa_init_driver_functions(struct dd_function_table *driver) { - _mesa_bzero(driver, sizeof(*driver)); + memset(driver, 0, sizeof(*driver)); driver->GetString = NULL; /* REQUIRED! */ driver->UpdateState = NULL; /* REQUIRED! */ diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index f3d8f2f4244..acc66e0ae02 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -72,7 +72,7 @@ static void build_state( { int unit; - _mesa_bzero(state, sizeof(*state)); + memset(state, 0, sizeof(*state)); for(unit = 0; unit < 16; ++unit) { if (fp->Base.ShadowSamplers & (1 << unit)) { diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index c735661dc2c..2e9793ea0e5 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -295,7 +295,7 @@ _mesa_initialize_buffer_object( struct gl_buffer_object *obj, { (void) target; - _mesa_bzero(obj, sizeof(struct gl_buffer_object)); + memset(obj, 0, sizeof(struct gl_buffer_object)); _glthread_INIT_MUTEX(obj->Mutex); obj->RefCount = 1; obj->Name = name; diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 9c472d85e32..740ebfe17a5 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -9711,7 +9711,7 @@ _mesa_init_display_list(GLcontext *ctx) /* zero-out the instruction size table, just once */ if (!tableInitialized) { - _mesa_bzero(InstSize, sizeof(InstSize)); + memset(InstSize, 0, sizeof(InstSize)); tableInitialized = GL_TRUE; } diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 96e53443836..41b54209432 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -127,7 +127,7 @@ _mesa_initialize_window_framebuffer(struct gl_framebuffer *fb, assert(fb); assert(visual); - _mesa_bzero(fb, sizeof(struct gl_framebuffer)); + memset(fb, 0, sizeof(struct gl_framebuffer)); _glthread_INIT_MUTEX(fb->Mutex); @@ -169,7 +169,7 @@ _mesa_initialize_user_framebuffer(struct gl_framebuffer *fb, GLuint name) assert(fb); assert(name); - _mesa_bzero(fb, sizeof(struct gl_framebuffer)); + memset(fb, 0, sizeof(struct gl_framebuffer)); fb->Name = name; fb->RefCount = 1; @@ -526,7 +526,7 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) { GLuint i; - _mesa_bzero(&fb->Visual, sizeof(fb->Visual)); + memset(&fb->Visual, 0, sizeof(fb->Visual)); fb->Visual.rgbMode = GL_TRUE; /* assume this */ #if 0 /* this _might_ be needed */ diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 67305002258..5c2c863f976 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -257,17 +257,6 @@ _mesa_memset16( unsigned short *dst, unsigned short val, size_t n ) *dst++ = val; } -/** Wrapper around either memset() or bzero() */ -void -_mesa_bzero( void *dst, size_t n ) -{ -#if defined(__FreeBSD__) - bzero( dst, n ); -#else - memset( dst, 0, n ); -#endif -} - /*@}*/ diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 048ae912c9d..106dd021a14 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -541,9 +541,6 @@ _mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize ); extern void _mesa_memset16( unsigned short *dst, unsigned short val, size_t n ); -extern void -_mesa_bzero( void *dst, size_t n ); - extern double _mesa_sin(double a); diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index bb0c78382c5..aec22d9d148 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -706,7 +706,7 @@ put_mono_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, ASSERT(rb->Format == MESA_FORMAT_RGBA8888); if (!mask && val == 0) { /* common case */ - _mesa_bzero(dst, count * 4 * sizeof(GLubyte)); + memset(dst, 0, count * 4 * sizeof(GLubyte)); } else { /* general case */ @@ -868,7 +868,7 @@ put_mono_row_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); if (!mask && val0 == 0 && val1 == 0 && val2 == 0 && val3 == 0) { /* common case for clearing accum buffer */ - _mesa_bzero(dst, count * 4 * sizeof(GLushort)); + memset(dst, 0, count * 4 * sizeof(GLushort)); } else { GLuint i; diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 9db95814d00..649f3587cb6 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -106,7 +106,7 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj, target == GL_TEXTURE_1D_ARRAY_EXT || target == GL_TEXTURE_2D_ARRAY_EXT); - _mesa_bzero(obj, sizeof(*obj)); + memset(obj, 0, sizeof(*obj)); /* init the non-zero fields */ _glthread_INIT_MUTEX(obj->Mutex); obj->RefCount = 1; diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 35f18aa2fb7..639408d82a4 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1483,7 +1483,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, programString[len] = 0; /* Get ready to parse */ - _mesa_bzero(&parseState, sizeof(struct parse_state)); + memset(&parseState, 0, sizeof(struct parse_state)); parseState.ctx = ctx; parseState.start = programString; parseState.program = program; diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index dcf834f52da..0c4da4d1079 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -40,7 +40,7 @@ _mesa_init_instructions(struct prog_instruction *inst, GLuint count) { GLuint i; - _mesa_bzero(inst, count * sizeof(struct prog_instruction)); + memset(inst, 0, count * sizeof(struct prog_instruction)); for (i = 0; i < count; i++) { inst[i].SrcReg[0].File = PROGRAM_UNDEFINED; diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 2410ccb0472..0c3c5ffbd5f 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -240,7 +240,7 @@ _mesa_init_program_struct( GLcontext *ctx, struct gl_program *prog, (void) ctx; if (prog) { GLuint i; - _mesa_bzero(prog, sizeof(*prog)); + memset(prog, 0, sizeof(*prog)); prog->Id = id; prog->Target = target; prog->Resident = GL_TRUE; diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index fa3a63ea4be..b621e892c33 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -241,7 +241,7 @@ alloc_local_temp(slang_emit_info *emitInfo, slang_ir_storage *temp, GLint size) { assert(size >= 1); assert(size <= 4); - _mesa_bzero(temp, sizeof(*temp)); + memset(temp, 0, sizeof(*temp)); temp->Size = size; temp->File = PROGRAM_TEMPORARY; temp->Index = -1; @@ -1136,7 +1136,7 @@ emit_clamp(slang_emit_info *emitInfo, slang_ir_node *n) * dest for this clamp() is an output reg, we can't use that reg for * the intermediate result. Use a temp register instead. */ - _mesa_bzero(&tmpNode, sizeof(tmpNode)); + memset(&tmpNode, 0, sizeof(tmpNode)); if (!alloc_node_storage(emitInfo, &tmpNode, n->Store->Size)) { return NULL; } diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c index a96f2fb4c25..01e2bc4a22b 100644 --- a/src/mesa/shader/slang/slang_typeinfo.c +++ b/src/mesa/shader/slang/slang_typeinfo.c @@ -419,7 +419,7 @@ slang_type_specifier_compatible(const slang_type_specifier * x, GLboolean slang_typeinfo_construct(slang_typeinfo * ti) { - _mesa_bzero(ti, sizeof(*ti)); + memset(ti, 0, sizeof(*ti)); slang_type_specifier_ctr(&ti->spec); ti->array_len = 0; return GL_TRUE; diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 36c8db21072..3e36cf9a7e5 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -259,7 +259,7 @@ depth_test_span16( GLcontext *ctx, GLuint n, } break; case GL_NEVER: - _mesa_bzero(mask, n * sizeof(GLubyte)); + memset(mask, 0, n * sizeof(GLubyte)); break; default: _mesa_problem(ctx, "Bad depth func in depth_test_span16"); @@ -488,7 +488,7 @@ depth_test_span32( GLcontext *ctx, GLuint n, } break; case GL_NEVER: - _mesa_bzero(mask, n * sizeof(GLubyte)); + memset(mask, 0, n * sizeof(GLubyte)); break; default: _mesa_problem(ctx, "Bad depth func in depth_test_span32"); @@ -844,7 +844,7 @@ direct_depth_test_pixels16(GLcontext *ctx, GLushort *zStart, GLuint stride, break; case GL_NEVER: /* depth test never passes */ - _mesa_bzero(mask, n * sizeof(GLubyte)); + memset(mask, 0, n * sizeof(GLubyte)); break; default: _mesa_problem(ctx, "Bad depth func in direct_depth_test_pixels"); @@ -1090,7 +1090,7 @@ direct_depth_test_pixels32(GLcontext *ctx, GLuint *zStart, GLuint stride, break; case GL_NEVER: /* depth test never passes */ - _mesa_bzero(mask, n * sizeof(GLubyte)); + memset(mask, 0, n * sizeof(GLubyte)); break; default: _mesa_problem(ctx, "Bad depth func in direct_depth_test_pixels"); @@ -1260,7 +1260,7 @@ _swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb, if (!rb) { /* really only doing this to prevent FP exceptions later */ - _mesa_bzero(depth, n * sizeof(GLfloat)); + memset(depth, 0, n * sizeof(GLfloat)); return; } @@ -1269,7 +1269,7 @@ _swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb, if (y < 0 || y >= (GLint) rb->Height || x + n <= 0 || x >= (GLint) rb->Width) { /* span is completely outside framebuffer */ - _mesa_bzero(depth, n * sizeof(GLfloat)); + memset(depth, 0, n * sizeof(GLfloat)); return; } @@ -1326,7 +1326,7 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, if (!rb) { /* really only doing this to prevent FP exceptions later */ - _mesa_bzero(depth, n * sizeof(GLuint)); + memset(depth, 0, n * sizeof(GLuint)); return; } @@ -1337,7 +1337,7 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, if (y < 0 || y >= (GLint) rb->Height || x + n <= 0 || x >= (GLint) rb->Width) { /* span is completely outside framebuffer */ - _mesa_bzero(depth, n * sizeof(GLfloat)); + memset(depth, 0, n * sizeof(GLfloat)); return; } diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index d31da4c4022..7c1de62e878 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -148,8 +148,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine, if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) { /* Clear temporary registers (undefined for ARB_f_p) */ - _mesa_bzero(machine->Temporaries, - MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); + memset(machine->Temporaries, 0, MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); } /* ARB_fragment_coord_conventions */ diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 7087f25d274..dada3643606 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1579,7 +1579,7 @@ _swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb, if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) { /* completely above, below, or right */ /* XXX maybe leave rgba values undefined? */ - _mesa_bzero(rgba, 4 * n * sizeof(GLchan)); + memset(rgba, 0, 4 * n * sizeof(GLchan)); } else { GLint skip, length; @@ -1642,7 +1642,7 @@ _swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb, if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) { /* completely above, below, or right */ - _mesa_bzero(index, n * sizeof(GLuint)); + memset(index, 0, n * sizeof(GLuint)); } else { GLint skip, length; -- cgit v1.2.3 From 32f2fd1c5d6088692551c80352b7d6fa35b0cd09 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 19 Feb 2010 11:58:49 -0500 Subject: Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versions --- src/egl/drivers/dri/egldri.c | 2 +- src/gallium/state_trackers/glx/xlib/glx_api.c | 18 ++-- src/gallium/state_trackers/glx/xlib/xm_api.c | 14 +-- src/glx/glcontextmodes.c | 35 +------- src/glx/glcontextmodes.h | 2 - src/mesa/drivers/common/meta.c | 34 +++---- src/mesa/drivers/dri/common/dri_util.c | 34 +++---- src/mesa/drivers/dri/common/drirenderbuffer.c | 4 +- src/mesa/drivers/dri/common/utils.c | 12 +-- src/mesa/drivers/dri/fb/fb_dri.c | 12 +-- src/mesa/drivers/dri/i965/brw_curbe.c | 6 +- src/mesa/drivers/dri/i965/brw_draw_upload.c | 4 +- src/mesa/drivers/dri/i965/brw_eu.c | 4 +- src/mesa/drivers/dri/i965/brw_queryobj.c | 4 +- src/mesa/drivers/dri/i965/brw_state_batch.c | 6 +- src/mesa/drivers/dri/i965/brw_state_cache.c | 10 +-- src/mesa/drivers/dri/i965/brw_vtbl.c | 10 +-- src/mesa/drivers/dri/i965/brw_wm.c | 8 +- src/mesa/drivers/dri/intel/intel_buffer_objects.c | 12 +-- src/mesa/drivers/dri/intel/intel_fbo.c | 8 +- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 4 +- src/mesa/drivers/dri/intel/intel_pixel_draw.c | 4 +- src/mesa/drivers/dri/intel/intel_span.c | 2 +- src/mesa/drivers/dri/intel/intel_syncobj.c | 4 +- src/mesa/drivers/dri/r300/r300_fragprog_common.c | 2 +- src/mesa/drivers/dri/r300/r300_shader.c | 4 +- src/mesa/drivers/dri/r300/r300_vertprog.c | 2 +- src/mesa/drivers/dri/r600/r700_oglprog.c | 2 +- src/mesa/drivers/dri/r600/r700_vertprog.c | 2 +- .../drivers/dri/radeon/radeon_buffer_objects.c | 2 +- src/mesa/drivers/dri/radeon/radeon_fbo.c | 4 +- src/mesa/drivers/dri/radeon/radeon_queryobj.c | 4 +- src/mesa/drivers/dri/radeon/radeon_texture.c | 4 +- src/mesa/drivers/dri/savage/savage_xmesa.c | 16 ++-- src/mesa/drivers/dri/savage/savagetex.c | 4 +- src/mesa/drivers/dri/swrast/swrast.c | 24 ++--- src/mesa/drivers/dri/unichrome/via_fb.c | 6 +- src/mesa/drivers/fbdev/glfbdev.c | 22 ++--- src/mesa/drivers/glide/fxdd.c | 4 +- src/mesa/drivers/glide/fxddtex.c | 6 +- src/mesa/drivers/glide/fxsetup.c | 4 +- src/mesa/drivers/glslcompiler/glslcompiler.c | 4 +- src/mesa/drivers/osmesa/osmesa.c | 12 +-- src/mesa/drivers/windows/gdi/mesa.def | 2 - src/mesa/drivers/windows/gdi/wmesa.c | 8 +- src/mesa/drivers/windows/icd/mesa.def | 3 - src/mesa/drivers/x11/fakeglx.c | 18 ++-- src/mesa/drivers/x11/xm_api.c | 26 +++--- src/mesa/drivers/x11/xm_buffer.c | 6 +- src/mesa/es/main/specials_es1.c | 2 +- src/mesa/es/main/specials_es2.c | 2 +- src/mesa/glapi/mesadef.py | 3 - src/mesa/main/arrayobj.c | 2 +- src/mesa/main/attrib.c | 4 +- src/mesa/main/bufferobj.c | 4 +- src/mesa/main/colortab.c | 8 +- src/mesa/main/context.c | 24 ++--- src/mesa/main/cpuinfo.c | 4 +- src/mesa/main/debug.c | 28 +++--- src/mesa/main/depthstencil.c | 4 +- src/mesa/main/dlist.c | 100 ++++++++++----------- src/mesa/main/execmem.c | 4 +- src/mesa/main/extensions.c | 6 +- src/mesa/main/framebuffer.c | 2 +- src/mesa/main/hash.c | 8 +- src/mesa/main/image.c | 8 +- src/mesa/main/imports.c | 39 ++------ src/mesa/main/imports.h | 19 ++-- src/mesa/main/light.c | 4 +- src/mesa/main/mipmap.c | 10 +-- src/mesa/main/mm.c | 16 ++-- src/mesa/main/queryobj.c | 2 +- src/mesa/main/renderbuffer.c | 14 +-- src/mesa/main/shaders.c | 12 +-- src/mesa/main/shared.c | 2 +- src/mesa/main/syncobj.c | 2 +- src/mesa/main/texcompress_fxt1.c | 12 +-- src/mesa/main/texcompress_s3tc.c | 8 +- src/mesa/main/teximage.c | 10 +-- src/mesa/main/texobj.c | 2 +- src/mesa/main/texrender.c | 2 +- src/mesa/main/texstore.c | 62 ++++++------- src/mesa/main/version.c | 2 +- src/mesa/shader/arbprogparse.c | 8 +- src/mesa/shader/atifragshader.c | 16 ++-- src/mesa/shader/hash_table.c | 8 +- src/mesa/shader/nvfragparse.c | 6 +- src/mesa/shader/nvvertparse.c | 10 +-- src/mesa/shader/prog_cache.c | 18 ++-- src/mesa/shader/prog_instruction.c | 8 +- src/mesa/shader/prog_optimize.c | 8 +- src/mesa/shader/prog_parameter.c | 14 +-- src/mesa/shader/prog_print.c | 2 +- src/mesa/shader/prog_statevars.c | 2 +- src/mesa/shader/prog_uniform.c | 6 +- src/mesa/shader/program.c | 16 ++-- src/mesa/shader/program_parse.tab.c | 22 ++--- src/mesa/shader/program_parse.y | 22 ++--- src/mesa/shader/shader_api.c | 24 ++--- src/mesa/shader/slang/slang_codegen.c | 6 +- src/mesa/shader/slang/slang_compile.c | 2 +- src/mesa/shader/slang/slang_compile_variable.c | 2 +- src/mesa/shader/slang/slang_emit.c | 6 +- src/mesa/shader/slang/slang_label.c | 2 +- src/mesa/shader/slang/slang_link.c | 26 +++--- src/mesa/shader/slang/slang_log.c | 4 +- src/mesa/shader/slang/slang_mem.c | 14 +-- src/mesa/shader/slang/slang_utility.c | 2 +- src/mesa/shader/symbol_table.c | 2 +- src/mesa/state_tracker/st_cb_accum.c | 12 +-- src/mesa/state_tracker/st_cb_bitmap.c | 2 +- src/mesa/state_tracker/st_cb_bufferobjects.c | 2 +- src/mesa/state_tracker/st_cb_drawpixels.c | 12 +-- src/mesa/state_tracker/st_cb_fbo.c | 10 +-- src/mesa/state_tracker/st_cb_queryobj.c | 2 +- src/mesa/state_tracker/st_cb_rasterpos.c | 2 +- src/mesa/state_tracker/st_cb_texture.c | 4 +- src/mesa/state_tracker/st_context.c | 4 +- src/mesa/state_tracker/st_context.h | 2 +- src/mesa/state_tracker/st_mesa_to_tgsi.c | 2 +- src/mesa/swrast/s_blit.c | 32 +++---- src/mesa/swrast/s_copypix.c | 36 ++++---- src/mesa/swrast/s_drawpix.c | 10 +-- src/mesa/swrast/s_readpix.c | 10 +-- src/mesa/tnl/t_draw.c | 4 +- src/mesa/tnl/t_vb_normals.c | 4 +- src/mesa/tnl/t_vb_points.c | 4 +- src/mesa/tnl/t_vertex.c | 2 +- src/mesa/vbo/vbo_exec_array.c | 4 +- src/mesa/vbo/vbo_rebase.c | 8 +- src/mesa/vbo/vbo_split_copy.c | 14 +-- src/mesa/vf/vf.c | 2 +- 132 files changed, 624 insertions(+), 691 deletions(-) (limited to 'src/mesa/shader/nvfragparse.c') diff --git a/src/egl/drivers/dri/egldri.c b/src/egl/drivers/dri/egldri.c index ca6821dad06..6a8bf89985b 100644 --- a/src/egl/drivers/dri/egldri.c +++ b/src/egl/drivers/dri/egldri.c @@ -812,7 +812,7 @@ __eglGetDrawableInfo(__DRInativeDisplay * ndpy, int screen, __DRIid drawable, return GL_FALSE; } - cliprect = (drm_clip_rect_t*) _mesa_malloc(sizeof(drm_clip_rect_t)); + cliprect = (drm_clip_rect_t*) malloc(sizeof(drm_clip_rect_t)); cliprect->x1 = drawable->x; cliprect->y1 = drawable->y; cliprect->x2 = drawable->x + drawable->w; diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index 9093a0eae9f..0932569bd3e 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -1018,7 +1018,7 @@ glXChooseVisual( Display *dpy, int screen, int *list ) xmvis = choose_visual(dpy, screen, list, GL_FALSE); if (xmvis) { /* create a new vishandle - the cached one may be stale */ - xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); + xmvis->vishandle = (XVisualInfo *) malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } @@ -1055,7 +1055,7 @@ glXCreateContext( Display *dpy, XVisualInfo *visinfo, xmvis = create_glx_visual( dpy, visinfo ); if (!xmvis) { /* unusable visual */ - _mesa_free(glxCtx); + free(glxCtx); return NULL; } } @@ -1063,7 +1063,7 @@ glXCreateContext( Display *dpy, XVisualInfo *visinfo, glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - _mesa_free(glxCtx); + free(glxCtx); return NULL; } @@ -1336,7 +1336,7 @@ glXDestroyContext( Display *dpy, GLXContext ctx ) MakeCurrent_PrevReadBuffer = 0; XMesaDestroyContext( glxCtx->xmesaContext ); XMesaGarbageCollect(); - _mesa_free(glxCtx); + free(glxCtx); } @@ -1755,7 +1755,7 @@ glXGetFBConfigs( Display *dpy, int screen, int *nelements ) visuals = XGetVisualInfo(dpy, visMask, &visTemplate, nelements); if (*nelements > 0) { XMesaVisual *results; - results = (XMesaVisual *) _mesa_malloc(*nelements * sizeof(XMesaVisual)); + results = (XMesaVisual *) malloc(*nelements * sizeof(XMesaVisual)); if (!results) { *nelements = 0; return NULL; @@ -1782,7 +1782,7 @@ glXChooseFBConfig( Display *dpy, int screen, xmvis = choose_visual(dpy, screen, attribList, GL_TRUE); if (xmvis) { - GLXFBConfig *config = (GLXFBConfig *) _mesa_malloc(sizeof(XMesaVisual)); + GLXFBConfig *config = (GLXFBConfig *) malloc(sizeof(XMesaVisual)); if (!config) { *nitems = 0; return NULL; @@ -1807,7 +1807,7 @@ glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ) return xmvis->vishandle; #else /* create a new vishandle - the cached one may be stale */ - xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); + xmvis->vishandle = (XVisualInfo *) malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } @@ -2112,7 +2112,7 @@ glXCreateNewContext( Display *dpy, GLXFBConfig config, glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - _mesa_free(glxCtx); + free(glxCtx); return NULL; } @@ -2332,7 +2332,7 @@ glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int render_ glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - _mesa_free(glxCtx); + free(glxCtx); return NULL; } diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 2e678c8f1e0..61af6634364 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -175,7 +175,7 @@ bits_per_pixel( XMesaVisual xmv ) /* grab the bits/pixel value */ bitsPerPixel = img->bits_per_pixel; /* free the XImage */ - _mesa_free( img->data ); + free( img->data ); img->data = NULL; XDestroyImage( img ); return bitsPerPixel; @@ -669,13 +669,13 @@ XMesaVisual XMesaCreateVisual( Display *display, v->display = display; - /* Save a copy of the XVisualInfo struct because the user may X_mesa_free() + /* Save a copy of the XVisualInfo struct because the user may Xfree() * the struct but we may need some of the information contained in it * at a later time. */ v->visinfo = (XVisualInfo *) MALLOC(sizeof(*visinfo)); if (!v->visinfo) { - _mesa_free(v); + free(v); return NULL; } memcpy(v->visinfo, visinfo, sizeof(*visinfo)); @@ -743,8 +743,8 @@ XMesaVisual XMesaCreateVisual( Display *display, PUBLIC void XMesaDestroyVisual( XMesaVisual v ) { - _mesa_free(v->visinfo); - _mesa_free(v); + free(v->visinfo); + free(v); } @@ -811,7 +811,7 @@ fail: else if (pipe) pipe->destroy(pipe); - _mesa_free(c); + free(c); return NULL; } @@ -828,7 +828,7 @@ void XMesaDestroyContext( XMesaContext c ) screen->destroy(screen); */ - _mesa_free(c); + free(c); } diff --git a/src/glx/glcontextmodes.c b/src/glx/glcontextmodes.c index 257087a802f..eb9037907fc 100644 --- a/src/glx/glcontextmodes.c +++ b/src/glx/glcontextmodes.c @@ -31,39 +31,13 @@ * \author Ian Romanick */ -#if defined(IN_MINI_GLX) -#include -#else -#if defined(HAVE_DIX_CONFIG_H) -# include -#endif -#include #include #include "GL/glxint.h" -#endif - -/* Memory macros */ -#if defined(IN_MINI_GLX) -# include -# include -# define _mesa_malloc(b) malloc(b) -# define _mesa_free(m) free(m) -#else -# ifdef XFree86Server -# include -# include -# define _mesa_malloc(b) xalloc(b) -# define _mesa_free(m) xfree(m) -# else -# include -# define _mesa_malloc(b) Xmalloc(b) -# define _mesa_free(m) Xfree(m) -# endif /* XFree86Server */ -#endif /* !defined(IN_MINI_GLX) */ +#include +#include #include "glcontextmodes.h" -#if !defined(IN_MINI_GLX) #define NUM_VISUAL_TYPES 6 /** @@ -352,7 +326,6 @@ _gl_get_context_mode_data(const __GLcontextModes * mode, int attribute, return GLX_BAD_ATTRIBUTE; } } -#endif /* !defined(IN_MINI_GLX) */ /** @@ -392,7 +365,7 @@ _gl_context_modes_create(unsigned count, size_t minimum_size) next = &base; for (i = 0; i < count; i++) { - *next = (__GLcontextModes *) _mesa_malloc(size); + *next = (__GLcontextModes *) malloc(size); if (*next == NULL) { _gl_context_modes_destroy(base); base = NULL; @@ -438,7 +411,7 @@ _gl_context_modes_destroy(__GLcontextModes * modes) while (modes != NULL) { __GLcontextModes *const next = modes->next; - _mesa_free(modes); + free(modes); modes = next; } } diff --git a/src/glx/glcontextmodes.h b/src/glx/glcontextmodes.h index 6676ae306c2..ecf0280cba3 100644 --- a/src/glx/glcontextmodes.h +++ b/src/glx/glcontextmodes.h @@ -32,14 +32,12 @@ #include "GL/internal/glcore.h" -#if !defined(IN_MINI_GLX) extern GLint _gl_convert_from_x_visual_type(int visualType); extern GLint _gl_convert_to_x_visual_type(int visualType); extern void _gl_copy_visual_to_context_mode(__GLcontextModes * mode, const __GLXvisualConfig * config); extern int _gl_get_context_mode_data(const __GLcontextModes * mode, int attribute, int *value_return); -#endif /* !defined(IN_MINI_GLX) */ extern __GLcontextModes *_gl_context_modes_create(unsigned count, size_t minimum_size); diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 4dd2293b24e..42ab7d4ed60 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -307,7 +307,7 @@ _mesa_meta_free(GLcontext *ctx) * freed by the normal context destruction code. But this would be * the place to free other meta data someday. */ - _mesa_free(ctx->Meta); + free(ctx->Meta); ctx->Meta = NULL; } @@ -1304,7 +1304,7 @@ _mesa_meta_BlitFramebuffer(GLcontext *ctx, } if (mask & GL_DEPTH_BUFFER_BIT) { - GLuint *tmp = (GLuint *) _mesa_malloc(srcW * srcH * sizeof(GLuint)); + GLuint *tmp = (GLuint *) malloc(srcW * srcH * sizeof(GLuint)); if (tmp) { if (!blit->DepthFP) init_blit_depth_pixels(ctx); @@ -1328,7 +1328,7 @@ _mesa_meta_BlitFramebuffer(GLcontext *ctx, _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); mask &= ~GL_DEPTH_BUFFER_BIT; - _mesa_free(tmp); + free(tmp); } } @@ -2065,7 +2065,7 @@ _mesa_meta_Bitmap(GLcontext *ctx, if (!bitmap1) return; - bitmap8 = (GLubyte *) _mesa_calloc(width * height); + bitmap8 = (GLubyte *) calloc(1, width * height); if (bitmap8) { _mesa_expand_bitmap(width, height, &unpackSave, bitmap1, bitmap8, width, 0xff); @@ -2082,7 +2082,7 @@ _mesa_meta_Bitmap(GLcontext *ctx, _mesa_set_enable(ctx, tex->Target, GL_FALSE); - _mesa_free(bitmap8); + free(bitmap8); } _mesa_unmap_pbo_source(ctx, &unpackSave); @@ -2531,7 +2531,7 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, /* * Alloc image buffer (XXX could use a PBO) */ - buf = _mesa_malloc(width * height * bpp); + buf = malloc(width * height * bpp); if (!buf) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims); return; @@ -2592,7 +2592,7 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, _mesa_lock_texture(ctx, texObj); /* re-lock */ - _mesa_free(buf); + free(buf); } @@ -2647,7 +2647,7 @@ copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, /* * Alloc image buffer (XXX could use a PBO) */ - buf = _mesa_malloc(width * height * bpp); + buf = malloc(width * height * bpp); if (!buf) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage%uD", dims); return; @@ -2688,7 +2688,7 @@ copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, _mesa_lock_texture(ctx, texObj); /* re-lock */ - _mesa_free(buf); + free(buf); } @@ -2731,7 +2731,7 @@ _mesa_meta_CopyColorTable(GLcontext *ctx, { GLfloat *buf; - buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat)); if (!buf) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorTable"); return; @@ -2748,7 +2748,7 @@ _mesa_meta_CopyColorTable(GLcontext *ctx, _mesa_meta_end(ctx); - _mesa_free(buf); + free(buf); } @@ -2758,7 +2758,7 @@ _mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start, { GLfloat *buf; - buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat)); if (!buf) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorSubTable"); return; @@ -2775,7 +2775,7 @@ _mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start, _mesa_meta_end(ctx); - _mesa_free(buf); + free(buf); } @@ -2786,7 +2786,7 @@ _mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, { GLfloat *buf; - buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat)); if (!buf) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D"); return; @@ -2805,7 +2805,7 @@ _mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, _mesa_meta_end(ctx); - _mesa_free(buf); + free(buf); } @@ -2816,7 +2816,7 @@ _mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, { GLfloat *buf; - buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!buf) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D"); return; @@ -2836,5 +2836,5 @@ _mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, _mesa_meta_end(ctx); - _mesa_free(buf); + free(buf); } diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 58a94b58682..9142dd72f5a 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -242,12 +242,12 @@ __driUtilUpdateDrawableInfo(__DRIdrawable *pdp) } if (pdp->pClipRects) { - _mesa_free(pdp->pClipRects); + free(pdp->pClipRects); pdp->pClipRects = NULL; } if (pdp->pBackClipRects) { - _mesa_free(pdp->pBackClipRects); + free(pdp->pBackClipRects); pdp->pBackClipRects = NULL; } @@ -324,7 +324,7 @@ static void driSwapBuffers(__DRIdrawable *dPriv) if (!dPriv->numClipRects) return; - rects = _mesa_malloc(sizeof(*rects) * dPriv->numClipRects); + rects = malloc(sizeof(*rects) * dPriv->numClipRects); if (!rects) return; @@ -337,7 +337,7 @@ static void driSwapBuffers(__DRIdrawable *dPriv) } driReportDamage(dPriv, rects, dPriv->numClipRects); - _mesa_free(rects); + free(rects); } static int driDrawableGetMSC( __DRIscreen *sPriv, __DRIdrawable *dPriv, @@ -430,7 +430,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config, */ (void) attrs; - pdp = _mesa_malloc(sizeof *pdp); + pdp = malloc(sizeof *pdp); if (!pdp) { return NULL; } @@ -457,7 +457,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config, if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, &config->modes, renderType == GLX_PIXMAP_BIT)) { - _mesa_free(pdp); + free(pdp); return NULL; } @@ -510,14 +510,14 @@ static void dri_put_drawable(__DRIdrawable *pdp) psp = pdp->driScreenPriv; (*psp->DriverAPI.DestroyBuffer)(pdp); if (pdp->pClipRects && pdp->pClipRects != &pdp->dri2.clipRect) { - _mesa_free(pdp->pClipRects); + free(pdp->pClipRects); pdp->pClipRects = NULL; } if (pdp->pBackClipRects && pdp->pClipRects != &pdp->dri2.clipRect) { - _mesa_free(pdp->pBackClipRects); + free(pdp->pBackClipRects); pdp->pBackClipRects = NULL; } - _mesa_free(pdp); + free(pdp); } } @@ -547,7 +547,7 @@ driDestroyContext(__DRIcontext *pcp) { if (pcp) { (*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp); - _mesa_free(pcp); + free(pcp); } } @@ -577,7 +577,7 @@ driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config, __DRIcontext *pcp; void * const shareCtx = (shared != NULL) ? shared->driverPrivate : NULL; - pcp = _mesa_malloc(sizeof *pcp); + pcp = malloc(sizeof *pcp); if (!pcp) return NULL; @@ -602,7 +602,7 @@ driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config, pcp->hHWContext = hwContext; if ( !(*psp->DriverAPI.CreateContext)(&config->modes, pcp, shareCtx) ) { - _mesa_free(pcp); + free(pcp); return NULL; } @@ -656,7 +656,7 @@ static void driDestroyScreen(__DRIscreen *psp) (void)drmCloseOnce(psp->fd); } - _mesa_free(psp); + free(psp); } } @@ -718,7 +718,7 @@ driCreateNewScreen(int scrn, static const __DRIextension *emptyExtensionList[] = { NULL }; __DRIscreen *psp; - psp = _mesa_calloc(sizeof *psp); + psp = calloc(1, sizeof *psp); if (!psp) return NULL; @@ -763,7 +763,7 @@ driCreateNewScreen(int scrn, *driver_modes = driDriverAPI.InitScreen(psp); if (*driver_modes == NULL) { - _mesa_free(psp); + free(psp); return NULL; } @@ -785,7 +785,7 @@ dri2CreateNewScreen(int scrn, int fd, if (driDriverAPI.InitScreen2 == NULL) return NULL; - psp = _mesa_calloc(sizeof(*psp)); + psp = calloc(1, sizeof(*psp)); if (!psp) return NULL; @@ -807,7 +807,7 @@ dri2CreateNewScreen(int scrn, int fd, psp->DriverAPI = driDriverAPI; *driver_configs = driDriverAPI.InitScreen2(psp); if (*driver_configs == NULL) { - _mesa_free(psp); + free(psp); return NULL; } diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.c b/src/mesa/drivers/dri/common/drirenderbuffer.c index fe38f608a97..48a2c662297 100644 --- a/src/mesa/drivers/dri/common/drirenderbuffer.c +++ b/src/mesa/drivers/dri/common/drirenderbuffer.c @@ -32,7 +32,7 @@ driDeleteRenderbuffer(struct gl_renderbuffer *rb) /* don't free rb->Data Chances are it's a memory mapped region for * the dri drivers. */ - _mesa_free(rb); + free(rb); } @@ -70,7 +70,7 @@ driNewRenderbuffer(gl_format format, GLvoid *addr, assert(cpp > 0); assert(pitch > 0); - drb = _mesa_calloc(sizeof(driRenderbuffer)); + drb = calloc(1, sizeof(driRenderbuffer)); if (drb) { const GLuint name = 0; diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 833f9ad232a..8c15cbbf735 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -108,7 +108,7 @@ driGetRendererString( char * buffer, const char * hardware_name, cpu = _mesa_get_cpu_string(); if (cpu) { offset += sprintf(buffer + offset, " %s", cpu); - _mesa_free(cpu); + free(cpu); } return offset; @@ -559,7 +559,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, } num_modes = num_depth_stencil_bits * num_db_modes * num_accum_bits * num_msaa_modes; - configs = _mesa_calloc((num_modes + 1) * sizeof *configs); + configs = calloc(1, (num_modes + 1) * sizeof *configs); if (configs == NULL) return NULL; @@ -568,7 +568,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, for ( i = 0 ; i < num_db_modes ; i++ ) { for ( h = 0 ; h < num_msaa_modes; h++ ) { for ( j = 0 ; j < num_accum_bits ; j++ ) { - *c = _mesa_malloc (sizeof **c); + *c = malloc (sizeof **c); modes = &(*c)->modes; c++; @@ -653,7 +653,7 @@ __DRIconfig **driConcatConfigs(__DRIconfig **a, while (b[j] != NULL) j++; - all = _mesa_malloc((i + j + 1) * sizeof *all); + all = malloc((i + j + 1) * sizeof *all); index = 0; for (i = 0; a[i] != NULL; i++) all[index++] = a[i]; @@ -661,8 +661,8 @@ __DRIconfig **driConcatConfigs(__DRIconfig **a, all[index++] = b[j]; all[index++] = NULL; - _mesa_free(a); - _mesa_free(b); + free(a); + free(b); return all; } diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index 0675bb9894f..ac07e57db13 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -340,7 +340,7 @@ fbCreateContext( const __GLcontextModes *glVisual, assert(driContextPriv); /* Allocate the Fb context */ - fbmesa = (fbContextPtr) _mesa_calloc( sizeof(*fbmesa) ); + fbmesa = (fbContextPtr) calloc(1, sizeof(*fbmesa) ); if ( !fbmesa ) return GL_FALSE; @@ -358,7 +358,7 @@ fbCreateContext( const __GLcontextModes *glVisual, ctx = fbmesa->glCtx = _mesa_create_context(glVisual, shareCtx, &functions, (void *) fbmesa); if (!fbmesa->glCtx) { - _mesa_free(fbmesa); + free(fbmesa); return GL_FALSE; } driContextPriv->driverPrivate = fbmesa; @@ -406,7 +406,7 @@ fbDestroyContext( __DRIcontext *driContextPriv ) fbmesa->glCtx->DriverCtx = NULL; _mesa_destroy_context( fbmesa->glCtx ); - _mesa_free( fbmesa ); + free( fbmesa ); } } @@ -449,7 +449,7 @@ fbCreateBuffer( __DRIscreen *driScrnPriv, } if (mesaVis->doubleBufferMode) { /* XXX what are the correct origin/stride values? */ - GLvoid *backBuf = _mesa_malloc(driScrnPriv->fbStride + GLvoid *backBuf = malloc(driScrnPriv->fbStride * driScrnPriv->fbHeight); driRenderbuffer *drb = driNewRenderbuffer(MESA_FORMAT_ARGB8888, backBuf, @@ -503,7 +503,7 @@ fbSwapBuffers( __DRIdrawable *dPriv ) if (ctx->Visual.doubleBufferMode) { int i; int offset = 0; - char *tmp = _mesa_malloc(currentPitch); + char *tmp = malloc(currentPitch); _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ @@ -516,7 +516,7 @@ fbSwapBuffers( __DRIdrawable *dPriv ) offset += currentPitch; } - _mesa_free(tmp); + free(tmp); } } else { diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 6cb8edb611f..cb9cd836a07 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -199,7 +199,7 @@ static void prepare_constant_buffer(struct brw_context *brw) return; } - buf = (GLfloat *) _mesa_calloc(bufsz); + buf = (GLfloat *) calloc(1, bufsz); /* fragment shader constants */ if (brw->curbe.wm_size) { @@ -294,12 +294,12 @@ static void prepare_constant_buffer(struct brw_context *brw) bufsz == brw->curbe.last_bufsz && memcmp(buf, brw->curbe.last_buf, bufsz) == 0) { /* constants have not changed */ - _mesa_free(buf); + free(buf); } else { /* constants have changed */ if (brw->curbe.last_buf) - _mesa_free(brw->curbe.last_buf); + free(brw->curbe.last_buf); brw->curbe.last_buf = buf; brw->curbe.last_bufsz = bufsz; diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index c46b9ba89ce..ceaeb923b05 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -320,7 +320,7 @@ copy_array_to_vbo_array( struct brw_context *brw, } else { void *data; - data = _mesa_malloc(dst_stride * element->count); + data = malloc(dst_stride * element->count); dest = data; for (i = 0; i < element->count; i++) { memcpy(dest, src, dst_stride); @@ -333,7 +333,7 @@ copy_array_to_vbo_array( struct brw_context *brw, size, data); - _mesa_free(data); + free(data); } } } diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c index 1df561386e6..4e7c1226ad4 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.c +++ b/src/mesa/drivers/dri/i965/brw_eu.c @@ -237,7 +237,7 @@ brw_resolve_cals(struct brw_compile *c) struct brw_glsl_call *call, *next; for (call = c->first_call; call; call = next) { next = call->next; - _mesa_free(call); + free(call); } c->first_call = NULL; } @@ -247,7 +247,7 @@ brw_resolve_cals(struct brw_compile *c) struct brw_glsl_label *label, *next; for (label = c->first_label; label; label = next) { next = label->next; - _mesa_free(label); + free(label); } c->first_label = NULL; } diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c index 5399a742449..6cce7e50890 100644 --- a/src/mesa/drivers/dri/i965/brw_queryobj.c +++ b/src/mesa/drivers/dri/i965/brw_queryobj.c @@ -73,7 +73,7 @@ brw_new_query_object(GLcontext *ctx, GLuint id) { struct brw_query_object *query; - query = _mesa_calloc(sizeof(struct brw_query_object)); + query = calloc(1, sizeof(struct brw_query_object)); query->Base.Id = id; query->Base.Result = 0; @@ -89,7 +89,7 @@ brw_delete_query(GLcontext *ctx, struct gl_query_object *q) struct brw_query_object *query = (struct brw_query_object *)q; dri_bo_unreference(query->bo); - _mesa_free(query); + free(query); } static void diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c b/src/mesa/drivers/dri/i965/brw_state_batch.c index ed8120d617f..39019412fda 100644 --- a/src/mesa/drivers/dri/i965/brw_state_batch.c +++ b/src/mesa/drivers/dri/i965/brw_state_batch.c @@ -57,8 +57,8 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw, if (item->sz == sz && memcmp(item->header, newheader, sz) == 0) return GL_FALSE; if (item->sz != sz) { - _mesa_free(item->header); - item->header = _mesa_malloc(sz); + free(item->header); + item->header = malloc(sz); item->sz = sz; } goto emit; @@ -68,7 +68,7 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw, assert(!item); item = CALLOC_STRUCT(brw_cached_batch_item); - item->header = _mesa_malloc(sz); + item->header = malloc(sz); item->sz = sz; item->next = brw->cached_batch_items; brw->cached_batch_items = item; diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index 1369d97e21b..dd9894d6819 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -150,7 +150,7 @@ rehash(struct brw_cache *cache) GLuint size, i; size = cache->size * 3; - items = (struct brw_cache_item**) _mesa_calloc(size * sizeof(*items)); + items = (struct brw_cache_item**) calloc(1, size * sizeof(*items)); for (i = 0; i < cache->size; i++) for (c = cache->items[i]; c; c = next) { @@ -237,7 +237,7 @@ brw_upload_cache_with_auxdata(struct brw_cache *cache, /* Set up the memory containing the key, aux_data, and reloc_bufs */ - tmp = _mesa_malloc(key_size + aux_size + relocs_size); + tmp = malloc(key_size + aux_size + relocs_size); memcpy(tmp, key, key_size); memcpy(tmp + key_size, aux, aux_size); @@ -366,7 +366,7 @@ brw_init_non_surface_cache(struct brw_context *brw) cache->size = 7; cache->n_items = 0; cache->items = (struct brw_cache_item **) - _mesa_calloc(cache->size * sizeof(struct brw_cache_item)); + calloc(1, cache->size * sizeof(struct brw_cache_item)); brw_init_cache_id(cache, "CC_VP", BRW_CC_VP); brw_init_cache_id(cache, "CC_UNIT", BRW_CC_UNIT); @@ -403,7 +403,7 @@ brw_init_surface_cache(struct brw_context *brw) cache->size = 7; cache->n_items = 0; cache->items = (struct brw_cache_item **) - _mesa_calloc(cache->size * sizeof(struct brw_cache_item)); + calloc(1, cache->size * sizeof(struct brw_cache_item)); brw_init_cache_id(cache, "SS_SURFACE", BRW_SS_SURFACE); brw_init_cache_id(cache, "SS_SURF_BIND", BRW_SS_SURF_BIND); @@ -444,7 +444,7 @@ brw_clear_cache(struct brw_context *brw, struct brw_cache *cache) cache->n_items = 0; if (brw->curbe.last_buf) { - _mesa_free(brw->curbe.last_buf); + free(brw->curbe.last_buf); brw->curbe.last_buf = NULL; } diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 681319dedfd..0b0be02dd20 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -67,11 +67,11 @@ static void brw_destroy_context( struct intel_context *intel ) brw_draw_destroy( brw ); brw_clear_validated_bos(brw); if (brw->wm.compile_data) { - _mesa_free(brw->wm.compile_data->instruction); - _mesa_free(brw->wm.compile_data->vreg); - _mesa_free(brw->wm.compile_data->refs); - _mesa_free(brw->wm.compile_data->prog_instructions); - _mesa_free(brw->wm.compile_data); + free(brw->wm.compile_data->instruction); + free(brw->wm.compile_data->vreg); + free(brw->wm.compile_data->refs); + free(brw->wm.compile_data->prog_instructions); + free(brw->wm.compile_data); } for (i = 0; i < brw->state.nr_color_regions; i++) diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 9191c81755d..991e1b964b8 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -151,11 +151,11 @@ static void do_wm_prog( struct brw_context *brw, */ return; } - c->instruction = _mesa_calloc(BRW_WM_MAX_INSN * sizeof(*c->instruction)); - c->prog_instructions = _mesa_calloc(BRW_WM_MAX_INSN * + c->instruction = calloc(1, BRW_WM_MAX_INSN * sizeof(*c->instruction)); + c->prog_instructions = calloc(1, BRW_WM_MAX_INSN * sizeof(*c->prog_instructions)); - c->vreg = _mesa_calloc(BRW_WM_MAX_VREG * sizeof(*c->vreg)); - c->refs = _mesa_calloc(BRW_WM_MAX_REF * sizeof(*c->refs)); + c->vreg = calloc(1, BRW_WM_MAX_VREG * sizeof(*c->vreg)); + c->refs = calloc(1, BRW_WM_MAX_REF * sizeof(*c->refs)); } else { void *instruction = c->instruction; void *prog_instructions = c->prog_instructions; diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 3b7015b5ad3..312866d865d 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -113,7 +113,7 @@ intel_bufferobj_free(GLcontext * ctx, struct gl_buffer_object *obj) if (obj->Pointer) intel_bufferobj_unmap(ctx, 0, obj); - _mesa_free(intel_obj->sys_buffer); + free(intel_obj->sys_buffer); if (intel_obj->region) { intel_bufferobj_release_region(intel, intel_obj); } @@ -121,7 +121,7 @@ intel_bufferobj_free(GLcontext * ctx, struct gl_buffer_object *obj) dri_bo_unreference(intel_obj->buffer); } - _mesa_free(intel_obj); + free(intel_obj); } @@ -155,7 +155,7 @@ intel_bufferobj_data(GLcontext * ctx, dri_bo_unreference(intel_obj->buffer); intel_obj->buffer = NULL; } - _mesa_free(intel_obj->sys_buffer); + free(intel_obj->sys_buffer); intel_obj->sys_buffer = NULL; if (size != 0) { @@ -164,7 +164,7 @@ intel_bufferobj_data(GLcontext * ctx, * with their contents anyway. */ if (target == GL_ARRAY_BUFFER || target == GL_ELEMENT_ARRAY_BUFFER) { - intel_obj->sys_buffer = _mesa_malloc(size); + intel_obj->sys_buffer = malloc(size); if (intel_obj->sys_buffer != NULL) { if (data != NULL) memcpy(intel_obj->sys_buffer, data, size); @@ -373,7 +373,7 @@ intel_bufferobj_map_range(GLcontext * ctx, if ((access & GL_MAP_INVALIDATE_RANGE_BIT) && drm_intel_bo_busy(intel_obj->buffer)) { if (access & GL_MAP_FLUSH_EXPLICIT_BIT) { - intel_obj->range_map_buffer = _mesa_malloc(length); + intel_obj->range_map_buffer = malloc(length); obj->Pointer = intel_obj->range_map_buffer; } else { intel_obj->range_map_bo = drm_intel_bo_alloc(intel->bufmgr, @@ -523,7 +523,7 @@ intel_bufferobj_buffer(struct intel_context *intel, intel_obj->Base.Size, sys_buffer, &intel_obj->Base); - _mesa_free(sys_buffer); + free(sys_buffer); intel_obj->sys_buffer = NULL; } diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index d58ffd95fa6..40b867971d7 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -71,13 +71,13 @@ intel_delete_renderbuffer(struct gl_renderbuffer *rb) ASSERT(irb); if (irb->span_cache != NULL) - _mesa_free(irb->span_cache); + free(irb->span_cache); if (intel && irb->region) { intel_region_release(&irb->region); } - _mesa_free(irb); + free(irb); } @@ -316,7 +316,7 @@ intel_create_renderbuffer(gl_format format) default: _mesa_problem(NULL, "Unexpected intFormat in intel_create_renderbuffer"); - _mesa_free(irb); + free(irb); return NULL; } @@ -468,7 +468,7 @@ intel_wrap_texture(GLcontext * ctx, struct gl_texture_image *texImage) irb->Base.ClassID = INTEL_RB_CLASS; if (!intel_update_wrapper(ctx, irb, texImage)) { - _mesa_free(irb); + free(irb); return NULL; } diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index eabfbf4af94..54998a63f66 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -395,7 +395,7 @@ intel_texture_bitmap(GLcontext * ctx, } /* Convert the A1 bitmap to an A8 format suitable for glTexImage */ - a8_bitmap = _mesa_calloc(width * height); + a8_bitmap = calloc(1, width * height); _mesa_expand_bitmap(width, height, unpack, bitmap, a8_bitmap, width, 0xff); if (_mesa_is_bufferobj(unpack->BufferObj)) { @@ -430,7 +430,7 @@ intel_texture_bitmap(GLcontext * ctx, _mesa_PixelStorei(GL_UNPACK_ALIGNMENT, 1); _mesa_TexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, a8_bitmap); - _mesa_free(a8_bitmap); + free(a8_bitmap); meta_set_fragment_program(&intel->meta, &intel->meta.bitmap_fp, fp); _mesa_ProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 0, diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index 10177228bd8..bd1dd13fb7d 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -147,7 +147,7 @@ intel_stencil_drawpixels(GLcontext * ctx, /* Unpack the supplied stencil values into a ubyte buffer. */ assert(sizeof(GLstencil) == sizeof(GLubyte)); - stencil_pixels = _mesa_malloc(width * height * sizeof(GLstencil)); + stencil_pixels = malloc(width * height * sizeof(GLstencil)); for (row = 0; row < height; row++) { GLvoid *source = _mesa_image_address2d(unpack, pixels, width, height, @@ -201,7 +201,7 @@ intel_stencil_drawpixels(GLcontext * ctx, _mesa_TexImage2D(GL_TEXTURE_2D, 0, GL_INTENSITY, width, height, 0, GL_RED, GL_UNSIGNED_BYTE, stencil_pixels); ctx->Unpack = old_unpack; - _mesa_free(stencil_pixels); + free(stencil_pixels); meta_set_passthrough_transform(&intel->meta); diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 97bb97265fb..0072bb15fc3 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -49,7 +49,7 @@ static void get_span_cache(struct intel_renderbuffer *irb, uint32_t offset) { if (irb->span_cache == NULL) { - irb->span_cache = _mesa_malloc(SPAN_CACHE_SIZE); + irb->span_cache = malloc(SPAN_CACHE_SIZE); irb->span_cache_offset = -1; } diff --git a/src/mesa/drivers/dri/intel/intel_syncobj.c b/src/mesa/drivers/dri/intel/intel_syncobj.c index 0d7889d3c25..d67f0cb4a68 100644 --- a/src/mesa/drivers/dri/intel/intel_syncobj.c +++ b/src/mesa/drivers/dri/intel/intel_syncobj.c @@ -50,7 +50,7 @@ intel_new_sync_object(GLcontext *ctx, GLuint id) { struct intel_sync_object *sync; - sync = _mesa_calloc(sizeof(struct intel_sync_object)); + sync = calloc(1, sizeof(struct intel_sync_object)); return &sync->Base; } @@ -61,7 +61,7 @@ intel_delete_sync_object(GLcontext *ctx, struct gl_sync_object *s) struct intel_sync_object *sync = (struct intel_sync_object *)s; drm_intel_bo_unreference(sync->bo); - _mesa_free(sync); + free(sync); } static void diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index acc66e0ae02..a5810ee500d 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -277,7 +277,7 @@ struct r300_fragment_program *r300SelectAndTranslateFragmentShader(GLcontext *ct fp = fp->next; } - fp = _mesa_calloc(sizeof(struct r300_fragment_program)); + fp = calloc(1, sizeof(struct r300_fragment_program)); fp->state = state; diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c index 3638010e486..9c24166ec5b 100644 --- a/src/mesa/drivers/dri/r300/r300_shader.c +++ b/src/mesa/drivers/dri/r300/r300_shader.c @@ -39,7 +39,7 @@ static void freeFragProgCache(GLcontext *ctx, struct r300_fragment_program_cont while (fp) { tmp = fp->next; rc_constants_destroy(&fp->code.constants); - _mesa_free(fp); + free(fp); fp = tmp; } } @@ -52,7 +52,7 @@ static void freeVertProgCache(GLcontext *ctx, struct r300_vertex_program_cont *c tmp = vp->next; rc_constants_destroy(&vp->code.constants); _mesa_reference_vertprog(ctx, &vp->Base, NULL); - _mesa_free(vp); + free(vp); vp = tmp; } } diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index a74b7001dd9..6a366b438b8 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -233,7 +233,7 @@ static struct r300_vertex_program *build_program(GLcontext *ctx, struct r300_vertex_program *vp; struct r300_vertex_program_compiler compiler; - vp = _mesa_calloc(sizeof(*vp)); + vp = calloc(1, sizeof(*vp)); vp->Base = _mesa_clone_vertex_program(ctx, mesa_vp); memcpy(&vp->key, wanted_key, sizeof(vp->key)); diff --git a/src/mesa/drivers/dri/r600/r700_oglprog.c b/src/mesa/drivers/dri/r600/r700_oglprog.c index 2a50361199b..b7124e644a3 100644 --- a/src/mesa/drivers/dri/r600/r700_oglprog.c +++ b/src/mesa/drivers/dri/r600/r700_oglprog.c @@ -53,7 +53,7 @@ static void freeVertProgCache(GLcontext *ctx, struct r700_vertex_program_cont *c Clean_Up_Shader(&(vp->r700Shader)); _mesa_reference_vertprog(ctx, &vp->mesa_program, NULL); - _mesa_free(vp); + free(vp); vp = tmp; } } diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 46481cdff4e..07e0adc8905 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -307,7 +307,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, struct r700_vertex_program *vp; unsigned int i; - vp = _mesa_calloc(sizeof(*vp)); + vp = calloc(1, sizeof(*vp)); vp->mesa_program = _mesa_clone_vertex_program(ctx, mesa_vp); if (mesa_vp->IsPositionInvariant) diff --git a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c index bc5915d3e43..0897dafbd8b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c +++ b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c @@ -70,7 +70,7 @@ radeonDeleteBufferObject(GLcontext * ctx, radeon_bo_unref(radeon_obj->bo); } - _mesa_free(radeon_obj); + free(radeon_obj); } diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 56dcc50785c..a8931e8478d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -66,7 +66,7 @@ radeon_delete_renderbuffer(struct gl_renderbuffer *rb) if (rrb && rrb->bo) { radeon_bo_unref(rrb->bo); } - _mesa_free(rrb); + free(rrb); } static void * @@ -511,7 +511,7 @@ radeon_wrap_texture(GLcontext * ctx, struct gl_texture_image *texImage) rrb->base.ClassID = RADEON_RB_CLASS; if (!radeon_update_wrapper(ctx, rrb, texImage)) { - _mesa_free(rrb); + free(rrb); return NULL; } diff --git a/src/mesa/drivers/dri/radeon/radeon_queryobj.c b/src/mesa/drivers/dri/radeon/radeon_queryobj.c index d0dcf0e431a..04ce12493e6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_queryobj.c +++ b/src/mesa/drivers/dri/radeon/radeon_queryobj.c @@ -81,7 +81,7 @@ static struct gl_query_object * radeonNewQueryObject(GLcontext *ctx, GLuint id) { struct radeon_query_object *query; - query = _mesa_calloc(sizeof(struct radeon_query_object)); + query = calloc(1, sizeof(struct radeon_query_object)); query->Base.Id = id; query->Base.Result = 0; @@ -103,7 +103,7 @@ static void radeonDeleteQuery(GLcontext *ctx, struct gl_query_object *q) radeon_bo_unref(query->bo); } - _mesa_free(query); + free(query); } static void radeonWaitQuery(GLcontext *ctx, struct gl_query_object *q) diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 9b9d90bdd02..ff37fd3e86e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -637,7 +637,7 @@ static GLuint * allocate_image_offsets(GLcontext *ctx, int i; GLuint *offsets; - offsets = _mesa_malloc(depth * sizeof(GLuint)) ; + offsets = malloc(depth * sizeof(GLuint)) ; if (!offsets) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTex[Sub]Image"); return NULL; @@ -736,7 +736,7 @@ static void radeon_store_teximage(GLcontext* ctx, int dims, } if (dims == 3) { - _mesa_free(dstImageOffsets); + free(dstImageOffsets); } radeon_teximage_unmap(image); diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 74a001b7898..6f07ac275e8 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -179,7 +179,7 @@ savageInitDriver(__DRIscreen *sPriv) } /* Allocate the private area */ - savageScreen = (savageScreenPrivate *)_mesa_malloc(sizeof(savageScreenPrivate)); + savageScreen = (savageScreenPrivate *)malloc(sizeof(savageScreenPrivate)); if (!savageScreen) return GL_FALSE; @@ -226,7 +226,7 @@ savageInitDriver(__DRIscreen *sPriv) savageScreen->agpTextures.handle, savageScreen->agpTextures.size, (drmAddress *)&(savageScreen->agpTextures.map)) != 0) { - _mesa_free(savageScreen); + free(savageScreen); sPriv->private = NULL; return GL_FALSE; } @@ -246,7 +246,7 @@ savageInitDriver(__DRIscreen *sPriv) savageScreen->aperture.size, (drmAddress *)&savageScreen->aperture.map) != 0) { - _mesa_free(savageScreen); + free(savageScreen); sPriv->private = NULL; return GL_FALSE; } @@ -282,7 +282,7 @@ savageDestroyScreen(__DRIscreen *sPriv) /* free all option information */ driDestroyOptionInfo (&savageScreen->optionCache); - _mesa_free(savageScreen); + free(savageScreen); sPriv->private = NULL; } @@ -300,7 +300,7 @@ savageCreateContext( const __GLcontextModes *mesaVis, savageScreen->sarea_priv_offset); int textureSize[SAVAGE_NR_TEX_HEAPS]; int i; - imesa = (savageContextPtr)_mesa_calloc(sizeof(savageContext)); + imesa = (savageContextPtr)calloc(1, sizeof(savageContext)); if (!imesa) { return GL_FALSE; } @@ -317,7 +317,7 @@ savageCreateContext( const __GLcontextModes *mesaVis, shareCtx = NULL; ctx = _mesa_create_context(mesaVis, shareCtx, &functions, imesa); if (!ctx) { - _mesa_free(imesa); + free(imesa); return GL_FALSE; } driContextPriv->driverPrivate = imesa; @@ -436,7 +436,7 @@ savageCreateContext( const __GLcontextModes *mesaVis, if (ctx->Const.MaxTextureLevels <= 6) { /*spec requires at least 64x64*/ __driUtilMessage("Not enough texture memory. " "Falling back to indirect rendering."); - _mesa_free(imesa); + free(imesa); return GL_FALSE; } @@ -574,7 +574,7 @@ savageDestroyContext(__DRIcontext *driContextPriv) _mesa_destroy_context(imesa->glCtx); /* no longer use vertex_dma_buf*/ - _mesa_free(imesa); + free(imesa); } } diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c index 394be44eac5..1a748ee1264 100644 --- a/src/mesa/drivers/dri/savage/savagetex.c +++ b/src/mesa/drivers/dri/savage/savagetex.c @@ -603,7 +603,7 @@ _savage_texstore_a1114444(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); return GL_TRUE; } @@ -643,7 +643,7 @@ _savage_texstore_a1118888(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); return GL_TRUE; } diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 40535b03b95..b2e7df34e82 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -155,7 +155,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions, TRACE; - psp = _mesa_calloc(sizeof(*psp)); + psp = calloc(1, sizeof(*psp)); if (!psp) return NULL; @@ -184,7 +184,7 @@ static void driDestroyScreen(__DRIscreen *psp) TRACE; if (psp) { - _mesa_free(psp); + free(psp); } } @@ -241,8 +241,8 @@ swrast_delete_renderbuffer(struct gl_renderbuffer *rb) { TRACE; - _mesa_free(rb->Data); - _mesa_free(rb); + free(rb->Data); + free(rb); } static GLboolean @@ -272,11 +272,11 @@ swrast_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb, TRACE; - _mesa_free(rb->Data); + free(rb->Data); swrast_alloc_front_storage(ctx, rb, internalFormat, width, height); - rb->Data = _mesa_malloc(height * xrb->pitch); + rb->Data = malloc(height * xrb->pitch); return GL_TRUE; } @@ -284,7 +284,7 @@ swrast_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb, static struct swrast_renderbuffer * swrast_new_renderbuffer(const GLvisual *visual, GLboolean front) { - struct swrast_renderbuffer *xrb = _mesa_calloc(sizeof *xrb); + struct swrast_renderbuffer *xrb = calloc(1, sizeof *xrb); GLuint pixel_format; TRACE; @@ -358,7 +358,7 @@ driCreateNewDrawable(__DRIscreen *screen, TRACE; - buf = _mesa_calloc(sizeof *buf); + buf = calloc(1, sizeof *buf); if (!buf) return NULL; @@ -366,7 +366,7 @@ driCreateNewDrawable(__DRIscreen *screen, buf->driScreenPriv = screen; - buf->row = _mesa_malloc(MAX_WIDTH * 4); + buf->row = malloc(MAX_WIDTH * 4); /* basic framebuffer setup */ _mesa_initialize_window_framebuffer(&buf->Base, &config->modes); @@ -401,7 +401,7 @@ driDestroyDrawable(__DRIdrawable *buf) if (buf) { struct gl_framebuffer *fb = &buf->Base; - _mesa_free(buf->row); + free(buf->row); fb->DeletePending = GL_TRUE; _mesa_reference_framebuffer(&fb, NULL); @@ -525,7 +525,7 @@ driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config, TRACE; - ctx = _mesa_calloc(sizeof *ctx); + ctx = calloc(1, sizeof *ctx); if (!ctx) return NULL; @@ -540,7 +540,7 @@ driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config, if (!_mesa_initialize_context(&ctx->Base, &config->modes, shared ? &shared->Base : NULL, &functions, (void *) ctx)) { - _mesa_free(ctx); + free(ctx); return NULL; } diff --git a/src/mesa/drivers/dri/unichrome/via_fb.c b/src/mesa/drivers/dri/unichrome/via_fb.c index e4fb29f6c60..bebf0619d0b 100644 --- a/src/mesa/drivers/dri/unichrome/via_fb.c +++ b/src/mesa/drivers/dri/unichrome/via_fb.c @@ -156,7 +156,7 @@ via_alloc_texture(struct via_context *vmesa, } else if (t->memType == VIA_MEM_SYSTEM) { - t->bufAddr = _mesa_malloc(t->size); + t->bufAddr = malloc(t->size); if (!t->bufAddr) goto cleanup; @@ -226,8 +226,8 @@ via_free_texture(struct via_context *vmesa, struct via_tex_buffer *t) else if (t->memType == VIA_MEM_SYSTEM) { remove_from_list(t); vmesa->total_alloc[t->memType] -= t->size; - _mesa_free(t->bufAddr); - _mesa_free(t); + free(t->bufAddr); + free(t); } else if (t->index && viaCheckBreadcrumb(vmesa, t->lastUsed)) { via_do_free_texture( vmesa, t ); diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 49002512aa3..4e369ceac40 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -392,7 +392,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, break; default: /* unexpected token */ - _mesa_free(vis); + free(vis); return NULL; } } @@ -431,7 +431,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, } else { _mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n"); - _mesa_free(vis); + free(vis); return NULL; } } @@ -445,7 +445,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, } else { _mesa_problem(NULL, "Unsupported fbdev CI visual/bitdepth!\n"); - _mesa_free(vis); + free(vis); return NULL; } } @@ -457,7 +457,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, accumBlueBits, accumAlphaBits, numSamples)) { /* something was invalid */ - _mesa_free(vis); + free(vis); return NULL; } @@ -469,7 +469,7 @@ void glFBDevDestroyVisual( GLFBDevVisualPtr visual ) { if (visual) - _mesa_free(visual); + free(visual); } @@ -488,9 +488,9 @@ delete_renderbuffer(struct gl_renderbuffer *rb) { struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb; if (frb->mallocedBuffer) { - _mesa_free(frb->Base.Data); + free(frb->Base.Data); } - _mesa_free(frb); + free(frb); } @@ -636,10 +636,10 @@ glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo, const int malloced = !backBuffer; if (malloced) { /* malloc a back buffer */ - backBuffer = _mesa_malloc(size); + backBuffer = malloc(size); if (!backBuffer) { _mesa_free_framebuffer_data(&buf->glframebuffer); - _mesa_free(buf); + free(buf); return NULL; } } @@ -769,7 +769,7 @@ glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share ) if (!_mesa_initialize_context(&ctx->glcontext, &visual->glvisual, share ? &share->glcontext : NULL, &functions, (void *) ctx)) { - _mesa_free(ctx); + free(ctx); return NULL; } @@ -818,7 +818,7 @@ glFBDevDestroyContext( GLFBDevContextPtr context ) _mesa_make_current(NULL, NULL, NULL); } _mesa_free_context_data(&context->glcontext); - _mesa_free(context); + free(context); } } diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index d94bf08a882..b78b101240e 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -1628,7 +1628,7 @@ fxDDGetString(GLcontext * ctx, GLenum name) if (ctx->Extensions.String == NULL) { GLubyte *ext = _mesa_make_extension_string(ctx); if (ext != NULL) { - ctx->Extensions.String = _mesa_malloc(strlen((char *)ext) + 256); + ctx->Extensions.String = malloc(strlen((char *)ext) + 256); if (ctx->Extensions.String != NULL) { strcpy((char *)ctx->Extensions.String, (char *)ext); /* put any additional extension names here */ @@ -1641,7 +1641,7 @@ fxDDGetString(GLcontext * ctx, GLenum name) strcat((char *)ctx->Extensions.String, " WGL_EXT_extensions_string WGL_ARB_extensions_string"); #endif /* put any additional extension names here */ - _mesa_free(ext); + free(ext); } else { ctx->Extensions.String = ext; } diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index a87a28ac3e0..b35874fffc3 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1397,10 +1397,10 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, mml->width, mml->height, 1); dstRowStride = _mesa_format_row_stride(texImage->TexFormat, mml->width); - texImage->Data = _mesa_malloc(texImage->CompressedSize); + texImage->Data = malloc(texImage->CompressedSize); } else { dstRowStride = mml->width * texelBytes; - texImage->Data = _mesa_malloc(mml->width * mml->height * texelBytes); + texImage->Data = malloc(mml->width * mml->height * texelBytes); } if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); @@ -1654,7 +1654,7 @@ fxDDCompressedTexImage2D (GLcontext *ctx, GLenum target, texImage->CompressedSize = _mesa_format_image_size(texImage->TexFormat, mml->width, mml->height, 1); - texImage->Data = _mesa_malloc(texImage->CompressedSize); + texImage->Data = malloc(texImage->CompressedSize); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); return; diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c index 9bf37967cd7..9bb352fcb82 100644 --- a/src/mesa/drivers/glide/fxsetup.c +++ b/src/mesa/drivers/glide/fxsetup.c @@ -107,14 +107,14 @@ fxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj) &(mml->wScale), &(mml->hScale)); _w *= mml->wScale; _h *= mml->hScale; - texImage->Data = _mesa_malloc(_w * _h * texelBytes); + texImage->Data = malloc(_w * _h * texelBytes); _mesa_rescale_teximage2d(texelBytes, mml->width, _w * texelBytes, /* dst stride */ mml->width, mml->height, /* src */ _w, _h, /* dst */ texImage_Data /*src*/, texImage->Data /*dst*/ ); - _mesa_free(texImage_Data); + free(texImage_Data); mml->width = _w; mml->height = _h; /* (!) ... and set mml->wScale = _w / texImage->Width */ diff --git a/src/mesa/drivers/glslcompiler/glslcompiler.c b/src/mesa/drivers/glslcompiler/glslcompiler.c index e4527abdeca..448029dacea 100644 --- a/src/mesa/drivers/glslcompiler/glslcompiler.c +++ b/src/mesa/drivers/glslcompiler/glslcompiler.c @@ -119,7 +119,7 @@ CreateContext(void) 0, 0, 0, 0, 1); /* accum */ buf = _mesa_create_framebuffer(vis); - cc = _mesa_calloc(sizeof(*cc)); + cc = calloc(1, sizeof(*cc)); if (!vis || !buf || !cc) { if (vis) _mesa_destroy_visual(vis); @@ -143,7 +143,7 @@ CreateContext(void) !_swsetup_CreateContext( ctx )) { _mesa_destroy_visual(vis); _mesa_free_context_data(ctx); - _mesa_free(cc); + free(cc); return GL_FALSE; } TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline; diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 1c469b15bf0..f9672d888e8 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -818,7 +818,7 @@ compute_row_addresses( OSMesaContext osmesa ) static void osmesa_delete_renderbuffer(struct gl_renderbuffer *rb) { - _mesa_free(rb); + free(rb); } @@ -1189,7 +1189,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, 1 /* num samples */ ); if (!osmesa->gl_visual) { - _mesa_free(osmesa); + free(osmesa); return NULL; } @@ -1206,7 +1206,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, : (GLcontext *) NULL, &functions, (void *) osmesa)) { _mesa_destroy_visual( osmesa->gl_visual ); - _mesa_free(osmesa); + free(osmesa); return NULL; } @@ -1221,7 +1221,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, if (!osmesa->gl_buffer) { _mesa_destroy_visual( osmesa->gl_visual ); _mesa_free_context_data( &osmesa->mesa ); - _mesa_free(osmesa); + free(osmesa); return NULL; } @@ -1260,7 +1260,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, !_swsetup_CreateContext( ctx )) { _mesa_destroy_visual(osmesa->gl_visual); _mesa_free_context_data(ctx); - _mesa_free(osmesa); + free(osmesa); return NULL; } @@ -1305,7 +1305,7 @@ OSMesaDestroyContext( OSMesaContext osmesa ) _mesa_reference_framebuffer( &osmesa->gl_buffer, NULL ); _mesa_free_context_data( &osmesa->mesa ); - _mesa_free( osmesa ); + free( osmesa ); } } diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index d7d6cfa4e2a..baa592f1369 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -868,7 +868,6 @@ EXPORTS _mesa_add_soft_renderbuffers _mesa_add_renderbuffer _mesa_bzero - _mesa_calloc _mesa_check_conditional_render _mesa_choose_tex_format _mesa_create_framebuffer @@ -887,7 +886,6 @@ EXPORTS _mesa_error _mesa_finish_render_texture _mesa_framebuffer_renderbuffer - _mesa_free _mesa_free_context_data _mesa_free_texture_image_data _mesa_generate_mipmap diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index b24b758cfb2..2fdcb387be7 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -1245,7 +1245,7 @@ static void read_rgba_pixels_16(const GLcontext *ctx, static void wmesa_delete_renderbuffer(struct gl_renderbuffer *rb) { - _mesa_free(rb); + free(rb); } @@ -1474,7 +1474,7 @@ WMesaContext WMesaCreateContext(HDC hDC, 1); /* num samples */ if (!visual) { - _mesa_free(c); + free(c); return NULL; } @@ -1512,7 +1512,7 @@ WMesaContext WMesaCreateContext(HDC hDC, !_tnl_CreateContext(ctx) || !_swsetup_CreateContext(ctx)) { _mesa_free_context_data(ctx); - _mesa_free(c); + free(c); return NULL; } _swsetup_Wakeup(ctx); @@ -1557,7 +1557,7 @@ void WMesaDestroyContext( WMesaContext pwc ) _swrast_DestroyContext(ctx); _mesa_free_context_data(ctx); - _mesa_free(pwc); + free(pwc); } diff --git a/src/mesa/drivers/windows/icd/mesa.def b/src/mesa/drivers/windows/icd/mesa.def index f6bd2aa68b8..6f33d170ffe 100644 --- a/src/mesa/drivers/windows/icd/mesa.def +++ b/src/mesa/drivers/windows/icd/mesa.def @@ -32,8 +32,6 @@ EXPORTS _mesa_buffer_data _mesa_buffer_map _mesa_buffer_subdata - _mesa_bzero - _mesa_calloc _mesa_choose_tex_format _mesa_compressed_texture_size _mesa_create_framebuffer @@ -47,7 +45,6 @@ EXPORTS _mesa_enable_1_5_extensions _mesa_enable_sw_extensions _mesa_error - _mesa_free _mesa_free_context_data _mesa_get_current_context _mesa_init_default_imports diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 291e90c822d..f097d93a710 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1381,7 +1381,7 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list ) return xmvis->vishandle; #else /* create a new vishandle - the cached one may be stale */ - xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); + xmvis->vishandle = (XVisualInfo *) malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } @@ -1438,7 +1438,7 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo, xmvis = create_glx_visual( dpy, visinfo ); if (!xmvis) { /* unusable visual */ - _mesa_free(glxCtx); + free(glxCtx); return NULL; } } @@ -1446,7 +1446,7 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo, glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - _mesa_free(glxCtx); + free(glxCtx); return NULL; } @@ -1671,7 +1671,7 @@ Fake_glXDestroyContext( Display *dpy, GLXContext ctx ) MakeCurrent_PrevReadBuffer = 0; XMesaDestroyContext( glxCtx->xmesaContext ); XMesaGarbageCollect(); - _mesa_free(glxCtx); + free(glxCtx); } @@ -2108,7 +2108,7 @@ Fake_glXGetFBConfigs( Display *dpy, int screen, int *nelements ) visuals = XGetVisualInfo(dpy, visMask, &visTemplate, nelements); if (*nelements > 0) { XMesaVisual *results; - results = (XMesaVisual *) _mesa_malloc(*nelements * sizeof(XMesaVisual)); + results = (XMesaVisual *) malloc(*nelements * sizeof(XMesaVisual)); if (!results) { *nelements = 0; return NULL; @@ -2135,7 +2135,7 @@ Fake_glXChooseFBConfig( Display *dpy, int screen, xmvis = choose_visual(dpy, screen, attribList, GL_TRUE); if (xmvis) { - GLXFBConfig *config = (GLXFBConfig *) _mesa_malloc(sizeof(XMesaVisual)); + GLXFBConfig *config = (GLXFBConfig *) malloc(sizeof(XMesaVisual)); if (!config) { *nitems = 0; return NULL; @@ -2160,7 +2160,7 @@ Fake_glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ) return xmvis->vishandle; #else /* create a new vishandle - the cached one may be stale */ - xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); + xmvis->vishandle = (XVisualInfo *) malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } @@ -2469,7 +2469,7 @@ Fake_glXCreateNewContext( Display *dpy, GLXFBConfig config, glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - _mesa_free(glxCtx); + free(glxCtx); return NULL; } @@ -2687,7 +2687,7 @@ Fake_glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int re glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - _mesa_free(glxCtx); + free(glxCtx); return NULL; } diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 98ce6c5831a..ed945023cf3 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -253,7 +253,7 @@ bits_per_pixel( XMesaVisual xmv ) /* grab the bits/pixel value */ bitsPerPixel = img->bits_per_pixel; /* free the XImage */ - _mesa_free( img->data ); + free( img->data ); img->data = NULL; XMesaDestroyImage( img ); return bitsPerPixel; @@ -383,7 +383,7 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, */ b->frontxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual, GL_FALSE); if (!b->frontxrb) { - _mesa_free(b); + free(b); return NULL; } b->frontxrb->Parent = b; @@ -399,7 +399,7 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, b->backxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual, GL_TRUE); if (!b->backxrb) { /* XXX free front xrb too */ - _mesa_free(b); + free(b); return NULL; } b->backxrb->Parent = b; @@ -596,7 +596,7 @@ noFaultXAllocColor( int client, || prevCmapSize != cmapSize || !ctable) { /* free previously cached color table */ if (ctable) - _mesa_free(ctable); + free(ctable); /* Get the color table from X */ ctable = (XMesaColor *) MALLOC(cmapSize * sizeof(XMesaColor)); assert(ctable); @@ -652,8 +652,8 @@ noFaultXAllocColor( int client, *alloced = 0; } #ifdef XFree86Server - _mesa_free(ppixIn); - _mesa_free(ctable); + free(ppixIn); + free(ctable); #else /* don't free table, save it for next time */ #endif @@ -1366,14 +1366,14 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, v->display = display; - /* Save a copy of the XVisualInfo struct because the user may X_mesa_free() + /* Save a copy of the XVisualInfo struct because the user may Xfree() * the struct but we may need some of the information contained in it * at a later time. */ #ifndef XFree86Server v->visinfo = (XVisualInfo *) MALLOC(sizeof(*visinfo)); if(!v->visinfo) { - _mesa_free(v); + free(v); return NULL; } memcpy(v->visinfo, visinfo, sizeof(*visinfo)); @@ -1473,9 +1473,9 @@ PUBLIC void XMesaDestroyVisual( XMesaVisual v ) { #ifndef XFree86Server - _mesa_free(v->visinfo); + free(v->visinfo); #endif - _mesa_free(v); + free(v); } @@ -1514,7 +1514,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) if (!_mesa_initialize_context(mesaCtx, &v->mesa_visual, share_list ? &(share_list->mesa) : (GLcontext *) NULL, &functions, (void *) c)) { - _mesa_free(c); + free(c); return NULL; } @@ -1564,7 +1564,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) !_tnl_CreateContext( mesaCtx ) || !_swsetup_CreateContext( mesaCtx )) { _mesa_free_context_data(&c->mesa); - _mesa_free(c); + free(c); return NULL; } @@ -1598,7 +1598,7 @@ void XMesaDestroyContext( XMesaContext c ) _tnl_DestroyContext( mesaCtx ); _vbo_DestroyContext( mesaCtx ); _mesa_free_context_data( mesaCtx ); - _mesa_free( c ); + free( c ); } diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index bf386292895..5ffe1104846 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -242,7 +242,7 @@ xmesa_delete_renderbuffer(struct gl_renderbuffer *rb) * should probably get freed here, but that's currently done in * XMesaDestroyBuffer(). */ - _mesa_free(rb); + free(rb); } @@ -412,11 +412,11 @@ xmesa_delete_framebuffer(struct gl_framebuffer *fb) } if (b->rowimage) { - _mesa_free( b->rowimage->data ); + free( b->rowimage->data ); b->rowimage->data = NULL; XMesaDestroyImage( b->rowimage ); } _mesa_free_framebuffer_data(fb); - _mesa_free(fb); + free(fb); } diff --git a/src/mesa/es/main/specials_es1.c b/src/mesa/es/main/specials_es1.c index a4f14490f31..c842007c22e 100644 --- a/src/mesa/es/main/specials_es1.c +++ b/src/mesa/es/main/specials_es1.c @@ -167,7 +167,7 @@ compute_es_extensions(void) unsigned int len; len = make_extension_string(ctx, NULL); - s = (char *) _mesa_malloc(len + 1); + s = (char *) malloc(len + 1); if (!s) return NULL; make_extension_string(ctx, s); diff --git a/src/mesa/es/main/specials_es2.c b/src/mesa/es/main/specials_es2.c index e11ade9b948..10b4f25e0f0 100644 --- a/src/mesa/es/main/specials_es2.c +++ b/src/mesa/es/main/specials_es2.c @@ -138,7 +138,7 @@ compute_es_extensions(void) unsigned int len; len = make_extension_string(ctx, NULL); - s = (char *) _mesa_malloc(len + 1); + s = (char *) malloc(len + 1); if (!s) return NULL; make_extension_string(ctx, s); diff --git a/src/mesa/glapi/mesadef.py b/src/mesa/glapi/mesadef.py index 59cea59ac2c..38b0246ba5b 100644 --- a/src/mesa/glapi/mesadef.py +++ b/src/mesa/glapi/mesadef.py @@ -113,8 +113,6 @@ def PrintTail(): print '\t_mesa_buffer_data' print '\t_mesa_buffer_map' print '\t_mesa_buffer_subdata' - print '\t_mesa_bzero' - print '\t_mesa_calloc' print '\t_mesa_choose_tex_format' print '\t_mesa_compressed_texture_size' print '\t_mesa_create_framebuffer' @@ -128,7 +126,6 @@ def PrintTail(): print '\t_mesa_enable_1_5_extensions' print '\t_mesa_enable_sw_extensions' print '\t_mesa_error' - print '\t_mesa_free' print '\t_mesa_free_context_data' print '\t_mesa_get_current_context' print '\t_mesa_init_default_imports' diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index e36137d3782..3a1fd37324b 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -130,7 +130,7 @@ _mesa_delete_array_object( GLcontext *ctx, struct gl_array_object *obj ) (void) ctx; unbind_array_object_vbos(ctx, obj); _glthread_DESTROY_MUTEX(obj->Mutex); - _mesa_free(obj); + free(obj); } diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 44dc3b871ec..9a32bc335d4 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1559,8 +1559,8 @@ _mesa_free_attrib_data(GLcontext *ctx) } next = attr->next; - _mesa_free(attr->data); - _mesa_free(attr); + free(attr->data); + free(attr); attr = next; } } diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 2e9793ea0e5..816465cea18 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -208,14 +208,14 @@ _mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ) (void) ctx; if (bufObj->Data) - _mesa_free(bufObj->Data); + free(bufObj->Data); /* assign strange values here to help w/ debugging */ bufObj->RefCount = -1000; bufObj->Name = ~0; _glthread_DESTROY_MUTEX(bufObj->Mutex); - _mesa_free(bufObj); + free(bufObj); } diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 1c12fb00fab..785813166c5 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -407,8 +407,8 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, _mesa_free_colortable_data(table); if (width > 0) { - table->TableF = (GLfloat *) _mesa_malloc(comps * width * sizeof(GLfloat)); - table->TableUB = (GLubyte *) _mesa_malloc(comps * width * sizeof(GLubyte)); + table->TableF = (GLfloat *) malloc(comps * width * sizeof(GLfloat)); + table->TableUB = (GLubyte *) malloc(comps * width * sizeof(GLubyte)); if (!table->TableF || !table->TableUB) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glColorTable"); @@ -1095,11 +1095,11 @@ void _mesa_free_colortable_data( struct gl_color_table *p ) { if (p->TableF) { - _mesa_free(p->TableF); + free(p->TableF); p->TableF = NULL; } if (p->TableUB) { - _mesa_free(p->TableUB); + free(p->TableUB); p->TableUB = NULL; } } diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index f315f0b212b..4ecbb5ecf66 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -222,7 +222,7 @@ _mesa_create_visual( GLboolean rgbFlag, GLint accumAlphaBits, GLint numSamples ) { - GLvisual *vis = (GLvisual *) _mesa_calloc(sizeof(GLvisual)); + GLvisual *vis = (GLvisual *) calloc(1, sizeof(GLvisual)); if (vis) { if (!_mesa_initialize_visual(vis, rgbFlag, dbFlag, stereoFlag, redBits, greenBits, blueBits, alphaBits, @@ -230,7 +230,7 @@ _mesa_create_visual( GLboolean rgbFlag, accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits, numSamples)) { - _mesa_free(vis); + free(vis); return NULL; } } @@ -320,7 +320,7 @@ _mesa_initialize_visual( GLvisual *vis, void _mesa_destroy_visual( GLvisual *vis ) { - _mesa_free(vis); + free(vis); } /*@}*/ @@ -755,7 +755,7 @@ alloc_dispatch_table(void) GLint numEntries = MAX2(_glapi_get_dispatch_table_size(), sizeof(struct _glapi_table) / sizeof(_glapi_proc)); struct _glapi_table *table = - (struct _glapi_table *) _mesa_malloc(numEntries * sizeof(_glapi_proc)); + (struct _glapi_table *) malloc(numEntries * sizeof(_glapi_proc)); if (table) { _glapi_proc *entry = (_glapi_proc *) table; GLint i; @@ -850,7 +850,7 @@ _mesa_initialize_context(GLcontext *ctx, if (!ctx->Exec || !ctx->Save) { _mesa_release_shared_state(ctx, ctx->Shared); if (ctx->Exec) - _mesa_free(ctx->Exec); + free(ctx->Exec); return GL_FALSE; } #if FEATURE_dispatch @@ -913,7 +913,7 @@ _mesa_create_context(const GLvisual *visual, ASSERT(visual); /*ASSERT(driverContext);*/ - ctx = (GLcontext *) _mesa_calloc(sizeof(GLcontext)); + ctx = (GLcontext *) calloc(1, sizeof(GLcontext)); if (!ctx) return NULL; @@ -922,7 +922,7 @@ _mesa_create_context(const GLvisual *visual, return ctx; } else { - _mesa_free(ctx); + free(ctx); return NULL; } } @@ -989,8 +989,8 @@ _mesa_free_context_data( GLcontext *ctx ) #endif /* free dispatch tables */ - _mesa_free(ctx->Exec); - _mesa_free(ctx->Save); + free(ctx->Exec); + free(ctx->Save); /* Shared context state (display lists, textures, etc) */ _mesa_release_shared_state( ctx, ctx->Shared ); @@ -999,10 +999,10 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_free_display_list_data(ctx); if (ctx->Extensions.String) - _mesa_free((void *) ctx->Extensions.String); + free((void *) ctx->Extensions.String); if (ctx->VersionString) - _mesa_free(ctx->VersionString); + free(ctx->VersionString); /* unbind the context if it's currently bound */ if (ctx == _mesa_get_current_context()) { @@ -1023,7 +1023,7 @@ _mesa_destroy_context( GLcontext *ctx ) { if (ctx) { _mesa_free_context_data(ctx); - _mesa_free( (void *) ctx ); + free( (void *) ctx ); } } diff --git a/src/mesa/main/cpuinfo.c b/src/mesa/main/cpuinfo.c index 79fcbc71c29..35de69b180f 100644 --- a/src/mesa/main/cpuinfo.c +++ b/src/mesa/main/cpuinfo.c @@ -43,7 +43,7 @@ _mesa_get_cpu_features(void) /** * Return a string describing the CPU architexture and extensions that * Mesa is using (such as SSE or Altivec). - * \return information string, free it with _mesa_free() + * \return information string, free it with free() */ char * _mesa_get_cpu_string(void) @@ -51,7 +51,7 @@ _mesa_get_cpu_string(void) #define MAX_STRING 50 char *buffer; - buffer = (char *) _mesa_malloc(MAX_STRING); + buffer = (char *) malloc(MAX_STRING); if (!buffer) return NULL; diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index f2182c05777..79b63e940fa 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -303,7 +303,7 @@ write_texture_image(struct gl_texture_object *texObj, GLubyte *buffer; char s[100]; - buffer = (GLubyte *) _mesa_malloc(img->Width * img->Height + buffer = (GLubyte *) malloc(img->Width * img->Height * img->Depth * 4); store = ctx->Pack; /* save */ @@ -321,7 +321,7 @@ write_texture_image(struct gl_texture_object *texObj, ctx->Pack = store; /* restore */ - _mesa_free(buffer); + free(buffer); } } @@ -350,7 +350,7 @@ write_renderbuffer_image(const struct gl_renderbuffer *rb) return; } - buffer = (GLubyte *) _mesa_malloc(rb->Width * rb->Height * 4); + buffer = (GLubyte *) malloc(rb->Width * rb->Height * 4); ctx->Driver.ReadPixels(ctx, 0, 0, rb->Width, rb->Height, format, type, &ctx->DefaultPacking, buffer); @@ -361,7 +361,7 @@ write_renderbuffer_image(const struct gl_renderbuffer *rb) _mesa_printf(" Writing renderbuffer image to %s\n", s); write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE); - _mesa_free(buffer); + free(buffer); } @@ -481,7 +481,7 @@ _mesa_dump_color_buffer(const char *filename) const GLuint h = ctx->DrawBuffer->Height; GLubyte *buf; - buf = (GLubyte *) _mesa_malloc(w * h * 4); + buf = (GLubyte *) malloc(w * h * 4); _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1); @@ -499,7 +499,7 @@ _mesa_dump_color_buffer(const char *filename) _mesa_PopClientAttrib(); - _mesa_free(buf); + free(buf); } @@ -513,8 +513,8 @@ _mesa_dump_depth_buffer(const char *filename) GLubyte *buf2; GLuint i; - buf = (GLuint *) _mesa_malloc(w * h * 4); /* 4 bpp */ - buf2 = (GLubyte *) _mesa_malloc(w * h * 3); /* 3 bpp */ + buf = (GLuint *) malloc(w * h * 4); /* 4 bpp */ + buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */ _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1); @@ -534,8 +534,8 @@ _mesa_dump_depth_buffer(const char *filename) _mesa_PopClientAttrib(); - _mesa_free(buf); - _mesa_free(buf2); + free(buf); + free(buf2); } @@ -549,8 +549,8 @@ _mesa_dump_stencil_buffer(const char *filename) GLubyte *buf2; GLuint i; - buf = (GLubyte *) _mesa_malloc(w * h); /* 1 bpp */ - buf2 = (GLubyte *) _mesa_malloc(w * h * 3); /* 3 bpp */ + buf = (GLubyte *) malloc(w * h); /* 1 bpp */ + buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */ _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1); @@ -569,8 +569,8 @@ _mesa_dump_stencil_buffer(const char *filename) _mesa_PopClientAttrib(); - _mesa_free(buf); - _mesa_free(buf2); + free(buf); + free(buf2); } diff --git a/src/mesa/main/depthstencil.c b/src/mesa/main/depthstencil.c index 49946a65062..892520b6959 100644 --- a/src/mesa/main/depthstencil.c +++ b/src/mesa/main/depthstencil.c @@ -65,7 +65,7 @@ delete_wrapper(struct gl_renderbuffer *rb) ASSERT(rb->Format == MESA_FORMAT_Z24_S8 || rb->Format == MESA_FORMAT_S8_Z24); _mesa_reference_renderbuffer(&rb->Wrapped, NULL); - _mesa_free(rb); + free(rb); } @@ -818,5 +818,5 @@ _mesa_promote_stencil(GLcontext *ctx, struct gl_renderbuffer *stencilRb) } stencilRb->PutRow(ctx, stencilRb, width, 0, i, depthStencil, NULL); } - _mesa_free(data); + free(data); } diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 740ebfe17a5..87b8ddacc2e 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -472,7 +472,7 @@ make_list(GLuint name, GLuint count) { struct gl_display_list *dlist = CALLOC_STRUCT(gl_display_list); dlist->Name = name; - dlist->Head = (Node *) _mesa_malloc(sizeof(Node) * count); + dlist->Head = (Node *) malloc(sizeof(Node) * count); dlist->Head[0].opcode = OPCODE_END_OF_LIST; return dlist; } @@ -557,108 +557,108 @@ _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) switch (opcode) { /* for some commands, we need to free malloc'd memory */ case OPCODE_MAP1: - _mesa_free(n[6].data); + free(n[6].data); n += InstSize[n[0].opcode]; break; case OPCODE_MAP2: - _mesa_free(n[10].data); + free(n[10].data); n += InstSize[n[0].opcode]; break; case OPCODE_DRAW_PIXELS: - _mesa_free(n[5].data); + free(n[5].data); n += InstSize[n[0].opcode]; break; case OPCODE_BITMAP: - _mesa_free(n[7].data); + free(n[7].data); n += InstSize[n[0].opcode]; break; case OPCODE_COLOR_TABLE: - _mesa_free(n[6].data); + free(n[6].data); n += InstSize[n[0].opcode]; break; case OPCODE_COLOR_SUB_TABLE: - _mesa_free(n[6].data); + free(n[6].data); n += InstSize[n[0].opcode]; break; case OPCODE_CONVOLUTION_FILTER_1D: - _mesa_free(n[6].data); + free(n[6].data); n += InstSize[n[0].opcode]; break; case OPCODE_CONVOLUTION_FILTER_2D: - _mesa_free(n[7].data); + free(n[7].data); n += InstSize[n[0].opcode]; break; case OPCODE_POLYGON_STIPPLE: - _mesa_free(n[1].data); + free(n[1].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_IMAGE1D: - _mesa_free(n[8].data); + free(n[8].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_IMAGE2D: - _mesa_free(n[9].data); + free(n[9].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_IMAGE3D: - _mesa_free(n[10].data); + free(n[10].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_SUB_IMAGE1D: - _mesa_free(n[7].data); + free(n[7].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_SUB_IMAGE2D: - _mesa_free(n[9].data); + free(n[9].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_SUB_IMAGE3D: - _mesa_free(n[11].data); + free(n[11].data); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_IMAGE_1D: - _mesa_free(n[7].data); + free(n[7].data); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_IMAGE_2D: - _mesa_free(n[8].data); + free(n[8].data); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_IMAGE_3D: - _mesa_free(n[9].data); + free(n[9].data); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D: - _mesa_free(n[7].data); + free(n[7].data); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D: - _mesa_free(n[9].data); + free(n[9].data); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D: - _mesa_free(n[11].data); + free(n[11].data); n += InstSize[n[0].opcode]; break; #if FEATURE_NV_vertex_program case OPCODE_LOAD_PROGRAM_NV: - _mesa_free(n[4].data); /* program string */ + free(n[4].data); /* program string */ n += InstSize[n[0].opcode]; break; case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV: - _mesa_free(n[2].data); /* array of program ids */ + free(n[2].data); /* array of program ids */ n += InstSize[n[0].opcode]; break; #endif #if FEATURE_NV_fragment_program case OPCODE_PROGRAM_NAMED_PARAMETER_NV: - _mesa_free(n[3].data); /* parameter name */ + free(n[3].data); /* parameter name */ n += InstSize[n[0].opcode]; break; #endif #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program case OPCODE_PROGRAM_STRING_ARB: - _mesa_free(n[4].data); /* program string */ + free(n[4].data); /* program string */ n += InstSize[n[0].opcode]; break; #endif @@ -670,7 +670,7 @@ _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) case OPCODE_UNIFORM_2IV: case OPCODE_UNIFORM_3IV: case OPCODE_UNIFORM_4IV: - _mesa_free(n[3].data); + free(n[3].data); n += InstSize[n[0].opcode]; break; case OPCODE_UNIFORM_MATRIX22: @@ -682,17 +682,17 @@ _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) case OPCODE_UNIFORM_MATRIX32: case OPCODE_UNIFORM_MATRIX34: case OPCODE_UNIFORM_MATRIX43: - _mesa_free(n[4].data); + free(n[4].data); n += InstSize[n[0].opcode]; break; case OPCODE_CONTINUE: n = (Node *) n[1].next; - _mesa_free(block); + free(block); block = n; break; case OPCODE_END_OF_LIST: - _mesa_free(block); + free(block); done = GL_TRUE; break; default: @@ -703,7 +703,7 @@ _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) } } - _mesa_free(dlist); + free(dlist); } @@ -869,7 +869,7 @@ dlist_alloc(GLcontext *ctx, OpCode opcode, GLuint bytes) Node *newblock; n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos; n[0].opcode = OPCODE_CONTINUE; - newblock = (Node *) _mesa_malloc(sizeof(Node) * BLOCK_SIZE); + newblock = (Node *) malloc(sizeof(Node) * BLOCK_SIZE); if (!newblock) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "Building display list"); return NULL; @@ -2912,7 +2912,7 @@ save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values) if (n) { n[1].e = map; n[2].i = mapsize; - n[3].data = (void *) _mesa_malloc(mapsize * sizeof(GLfloat)); + n[3].data = (void *) malloc(mapsize * sizeof(GLfloat)); memcpy(n[3].data, (void *) values, mapsize * sizeof(GLfloat)); } if (ctx->ExecuteFlag) { @@ -4360,7 +4360,7 @@ save_CompressedTexImage1DARB(GLenum target, GLint level, GLvoid *image; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* make copy of image */ - image = _mesa_malloc(imageSize); + image = malloc(imageSize); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1DARB"); return; @@ -4377,7 +4377,7 @@ save_CompressedTexImage1DARB(GLenum target, GLint level, n[7].data = image; } else if (image) { - _mesa_free(image); + free(image); } if (ctx->ExecuteFlag) { CALL_CompressedTexImage1DARB(ctx->Exec, @@ -4406,7 +4406,7 @@ save_CompressedTexImage2DARB(GLenum target, GLint level, GLvoid *image; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* make copy of image */ - image = _mesa_malloc(imageSize); + image = malloc(imageSize); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB"); return; @@ -4424,7 +4424,7 @@ save_CompressedTexImage2DARB(GLenum target, GLint level, n[8].data = image; } else if (image) { - _mesa_free(image); + free(image); } if (ctx->ExecuteFlag) { CALL_CompressedTexImage2DARB(ctx->Exec, @@ -4453,7 +4453,7 @@ save_CompressedTexImage3DARB(GLenum target, GLint level, GLvoid *image; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* make copy of image */ - image = _mesa_malloc(imageSize); + image = malloc(imageSize); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3DARB"); return; @@ -4472,7 +4472,7 @@ save_CompressedTexImage3DARB(GLenum target, GLint level, n[9].data = image; } else if (image) { - _mesa_free(image); + free(image); } if (ctx->ExecuteFlag) { CALL_CompressedTexImage3DARB(ctx->Exec, @@ -4496,7 +4496,7 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* make copy of image */ - image = _mesa_malloc(imageSize); + image = malloc(imageSize); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage1DARB"); return; @@ -4513,7 +4513,7 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, n[7].data = image; } else if (image) { - _mesa_free(image); + free(image); } if (ctx->ExecuteFlag) { CALL_CompressedTexSubImage1DARB(ctx->Exec, (target, level, xoffset, @@ -4536,7 +4536,7 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* make copy of image */ - image = _mesa_malloc(imageSize); + image = malloc(imageSize); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage2DARB"); return; @@ -4555,7 +4555,7 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, n[9].data = image; } else if (image) { - _mesa_free(image); + free(image); } if (ctx->ExecuteFlag) { CALL_CompressedTexSubImage2DARB(ctx->Exec, @@ -4578,7 +4578,7 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* make copy of image */ - image = _mesa_malloc(imageSize); + image = malloc(imageSize); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage3DARB"); return; @@ -4599,7 +4599,7 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, n[11].data = image; } else if (image) { - _mesa_free(image); + free(image); } if (ctx->ExecuteFlag) { CALL_CompressedTexSubImage3DARB(ctx->Exec, @@ -4788,7 +4788,7 @@ save_LoadProgramNV(GLenum target, GLuint id, GLsizei len, n = alloc_instruction(ctx, OPCODE_LOAD_PROGRAM_NV, 4); if (n) { - GLubyte *programCopy = (GLubyte *) _mesa_malloc(len); + GLubyte *programCopy = (GLubyte *) malloc(len); if (!programCopy) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); return; @@ -4815,7 +4815,7 @@ save_RequestResidentProgramsNV(GLsizei num, const GLuint * ids) n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 2); if (n) { - GLuint *idCopy = (GLuint *) _mesa_malloc(num * sizeof(GLuint)); + GLuint *idCopy = (GLuint *) malloc(num * sizeof(GLuint)); if (!idCopy) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glRequestResidentProgramsNV"); return; @@ -4986,7 +4986,7 @@ save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, n = alloc_instruction(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6); if (n) { - GLubyte *nameCopy = (GLubyte *) _mesa_malloc(len); + GLubyte *nameCopy = (GLubyte *) malloc(len); if (!nameCopy) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramNamedParameter4fNV"); return; @@ -5085,7 +5085,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, n = alloc_instruction(ctx, OPCODE_PROGRAM_STRING_ARB, 4); if (n) { - GLubyte *programCopy = (GLubyte *) _mesa_malloc(len); + GLubyte *programCopy = (GLubyte *) malloc(len); if (!programCopy) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); return; @@ -6199,7 +6199,7 @@ save_Uniform4fARB(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) static void * memdup(const void *src, GLsizei bytes) { - void *b = bytes >= 0 ? _mesa_malloc(bytes) : NULL; + void *b = bytes >= 0 ? malloc(bytes) : NULL; if (b) memcpy(b, src, bytes); return b; diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c index 4c6139985fe..07a7f9fed80 100644 --- a/src/mesa/main/execmem.c +++ b/src/mesa/main/execmem.c @@ -140,14 +140,14 @@ _mesa_exec_free(void *addr) void * _mesa_exec_malloc(GLuint size) { - return _mesa_malloc( size ); + return malloc( size ); } void _mesa_exec_free(void *addr) { - _mesa_free(addr); + free(addr); } diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index f24baf5acdc..2c1120e19f8 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -576,7 +576,7 @@ append(const char *a, const char *b) { const GLuint aLen = a ? strlen(a) : 0; const GLuint bLen = b ? strlen(b) : 0; - char *s = _mesa_calloc(aLen + bLen + 1); + char *s = calloc(1, aLen + bLen + 1); if (s) { if (a) memcpy(s, a, aLen); @@ -585,7 +585,7 @@ append(const char *a, const char *b) s[aLen + bLen] = '\0'; } if (a) - _mesa_free((void *) a); + free((void *) a); return s; } @@ -685,7 +685,7 @@ _mesa_make_extension_string( GLcontext *ctx ) extStrLen += strlen(extraExt) + 1; /* +1 for space */ /* allocate the extension string */ - s = (char *) _mesa_malloc(extStrLen); + s = (char *) malloc(extStrLen); if (!s) return NULL; diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 41b54209432..065e25fd332 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -192,7 +192,7 @@ _mesa_destroy_framebuffer(struct gl_framebuffer *fb) { if (fb) { _mesa_free_framebuffer_data(fb); - _mesa_free(fb); + free(fb); } } diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c index fdfbe6b4f43..975775469d9 100644 --- a/src/mesa/main/hash.c +++ b/src/mesa/main/hash.c @@ -108,13 +108,13 @@ _mesa_DeleteHashTable(struct _mesa_HashTable *table) _mesa_problem(NULL, "In _mesa_DeleteHashTable, found non-freed data"); } - _mesa_free(entry); + free(entry); entry = next; } } _glthread_DESTROY_MUTEX(table->Mutex); _glthread_DESTROY_MUTEX(table->WalkMutex); - _mesa_free(table); + free(table); } @@ -245,7 +245,7 @@ _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key) else { table->Table[pos] = entry->Next; } - _mesa_free(entry); + free(entry); _glthread_UNLOCK_MUTEX(table->Mutex); return; } @@ -282,7 +282,7 @@ _mesa_HashDeleteAll(struct _mesa_HashTable *table, for (entry = table->Table[pos]; entry; entry = next) { callback(entry->Key, entry->Data, userData); next = entry->Next; - _mesa_free(entry); + free(entry); } table->Table[pos] = NULL; } diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index bd03217e2a8..dc8d97728bf 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1038,7 +1038,7 @@ _mesa_unpack_polygon_stipple( const GLubyte *pattern, GLuint dest[32], | (p[3] ); p += 4; } - _mesa_free(ptrn); + free(ptrn); } } @@ -1083,7 +1083,7 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels, /* Alloc dest storage */ bytes = ((width + 7) / 8 * height); - buffer = (GLubyte *) _mesa_malloc( bytes ); + buffer = (GLubyte *) malloc( bytes ); if (!buffer) return NULL; @@ -1094,7 +1094,7 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels, _mesa_image_address2d(packing, pixels, width, height, GL_COLOR_INDEX, GL_BITMAP, row, 0); if (!src) { - _mesa_free(buffer); + free(buffer); return NULL; } @@ -5232,7 +5232,7 @@ _mesa_unpack_image( GLuint dimensions, { GLubyte *destBuffer - = (GLubyte *) _mesa_malloc(bytesPerRow * height * depth); + = (GLubyte *) malloc(bytesPerRow * height * depth); GLubyte *dst; GLint img, row; if (!destBuffer) diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 5c2c863f976..10224f78882 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -71,27 +71,6 @@ extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg); /** \name Memory */ /*@{*/ -/** Wrapper around malloc() */ -void * -_mesa_malloc(size_t bytes) -{ - return malloc(bytes); -} - -/** Wrapper around calloc() */ -void * -_mesa_calloc(size_t bytes) -{ - return calloc(1, bytes); -} - -/** Wrapper around free() */ -void -_mesa_free(void *ptr) -{ - free(ptr); -} - /** * Allocate aligned memory. * @@ -118,7 +97,7 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment) ASSERT( alignment > 0 ); - ptr = (uintptr_t) _mesa_malloc(bytes + alignment + sizeof(void *)); + ptr = (uintptr_t) malloc(bytes + alignment + sizeof(void *)); if (!ptr) return NULL; @@ -138,8 +117,8 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment) } /** - * Same as _mesa_align_malloc(), but using _mesa_calloc() instead of - * _mesa_malloc() + * Same as _mesa_align_malloc(), but using calloc(1, ) instead of + * malloc() */ void * _mesa_align_calloc(size_t bytes, unsigned long alignment) @@ -167,7 +146,7 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment) ASSERT( alignment > 0 ); - ptr = (uintptr_t) _mesa_calloc(bytes + alignment + sizeof(void *)); + ptr = (uintptr_t) calloc(1, bytes + alignment + sizeof(void *)); if (!ptr) return NULL; @@ -203,7 +182,7 @@ _mesa_align_free(void *ptr) #else void **cubbyHole = (void **) ((char *) ptr - sizeof(void *)); void *realAddr = *cubbyHole; - _mesa_free(realAddr); + free(realAddr); #endif /* defined(HAVE_POSIX_MEMALIGN) */ } @@ -236,11 +215,11 @@ void * _mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) { const size_t copySize = (oldSize < newSize) ? oldSize : newSize; - void *newBuffer = _mesa_malloc(newSize); + void *newBuffer = malloc(newSize); if (newBuffer && oldBuffer && copySize > 0) memcpy(newBuffer, oldBuffer, copySize); if (oldBuffer) - _mesa_free(oldBuffer); + free(oldBuffer); return newBuffer; } @@ -798,7 +777,7 @@ _mesa_getenv( const char *var ) /*@{*/ /** - * Implemented using _mesa_malloc() and strcpy. + * Implemented using malloc() and strcpy. * Note that NULL is handled accordingly. */ char * @@ -806,7 +785,7 @@ _mesa_strdup( const char *s ) { if (s) { size_t l = strlen(s); - char *s2 = (char *) _mesa_malloc(l + 1); + char *s2 = (char *) malloc(l + 1); if (s2) strcpy(s2, s); return s2; diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 106dd021a14..4eabdfdb0d2 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -50,15 +50,15 @@ extern "C" { /*@{*/ /** Allocate \p BYTES bytes */ -#define MALLOC(BYTES) _mesa_malloc(BYTES) +#define MALLOC(BYTES) malloc(BYTES) /** Allocate and zero \p BYTES bytes */ -#define CALLOC(BYTES) _mesa_calloc(BYTES) +#define CALLOC(BYTES) calloc(1, BYTES) /** Allocate a structure of type \p T */ -#define MALLOC_STRUCT(T) (struct T *) _mesa_malloc(sizeof(struct T)) +#define MALLOC_STRUCT(T) (struct T *) malloc(sizeof(struct T)) /** Allocate and zero a structure of type \p T */ -#define CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T)) +#define CALLOC_STRUCT(T) (struct T *) calloc(1, sizeof(struct T)) /** Free memory */ -#define FREE(PTR) _mesa_free(PTR) +#define FREE(PTR) free(PTR) /** Allocate \p BYTES aligned at \p N bytes */ #define ALIGN_MALLOC(BYTES, N) _mesa_align_malloc(BYTES, N) @@ -507,15 +507,6 @@ _mesa_little_endian(void) * Functions */ -extern void * -_mesa_malloc( size_t bytes ); - -extern void * -_mesa_calloc( size_t bytes ); - -extern void -_mesa_free( void *ptr ); - extern void * _mesa_align_malloc( size_t bytes, unsigned long alignment ); diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 654faa5c770..6899ed0ddf3 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1433,7 +1433,7 @@ _mesa_free_lighting_data( GLcontext *ctx ) /* Free lighting shininess exponentiation table */ foreach_s( s, tmps, ctx->_ShineTabList ) { - _mesa_free( s ); + free( s ); } - _mesa_free( ctx->_ShineTabList ); + free( ctx->_ShineTabList ); } diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 1da576337f9..415abcdfa1e 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1537,15 +1537,15 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, size = _mesa_bytes_per_pixel(srcImage->_BaseFormat, CHAN_TYPE) * srcImage->Width * srcImage->Height * srcImage->Depth + 20; /* 20 extra bytes, just be safe when calling last FetchTexel */ - srcData = (GLubyte *) _mesa_malloc(size); + srcData = (GLubyte *) malloc(size); if (!srcData) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps"); return; } - dstData = (GLubyte *) _mesa_malloc(size / 2); /* 1/4 would probably be OK */ + dstData = (GLubyte *) malloc(size / 2); /* 1/4 would probably be OK */ if (!dstData) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps"); - _mesa_free((void *) srcData); + free((void *) srcData); return; } @@ -1590,8 +1590,8 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, if (!nextLevel) { /* all done */ if (_mesa_is_format_compressed(srcImage->TexFormat)) { - _mesa_free((void *) srcData); - _mesa_free(dstData); + free((void *) srcData); + free(dstData); } return; } diff --git a/src/mesa/main/mm.c b/src/mesa/main/mm.c index d430bcdb840..3ef38e94be9 100644 --- a/src/mesa/main/mm.c +++ b/src/mesa/main/mm.c @@ -60,13 +60,13 @@ mmInit(unsigned ofs, unsigned size) if (!size) return NULL; - heap = (struct mem_block *) _mesa_calloc(sizeof(struct mem_block)); + heap = (struct mem_block *) calloc(1, sizeof(struct mem_block)); if (!heap) return NULL; - block = (struct mem_block *) _mesa_calloc(sizeof(struct mem_block)); + block = (struct mem_block *) calloc(1, sizeof(struct mem_block)); if (!block) { - _mesa_free(heap); + free(heap); return NULL; } @@ -98,7 +98,7 @@ SliceBlock(struct mem_block *p, /* break left [p, newblock, p->next], then p = newblock */ if (startofs > p->ofs) { - newblock = (struct mem_block*) _mesa_calloc(sizeof(struct mem_block)); + newblock = (struct mem_block*) calloc(1, sizeof(struct mem_block)); if (!newblock) return NULL; newblock->ofs = startofs; @@ -122,7 +122,7 @@ SliceBlock(struct mem_block *p, /* break right, also [p, newblock, p->next] */ if (size < p->size) { - newblock = (struct mem_block*) _mesa_calloc(sizeof(struct mem_block)); + newblock = (struct mem_block*) calloc(1, sizeof(struct mem_block)); if (!newblock) return NULL; newblock->ofs = startofs + size; @@ -225,7 +225,7 @@ Join2Blocks(struct mem_block *p) q->next_free->prev_free = q->prev_free; q->prev_free->next_free = q->next_free; - _mesa_free(q); + free(q); return 1; } return 0; @@ -270,9 +270,9 @@ mmDestroy(struct mem_block *heap) for (p = heap->next; p != heap; ) { struct mem_block *next = p->next; - _mesa_free(p); + free(p); p = next; } - _mesa_free(heap); + free(heap); } diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index 387a82fc9df..471352f472f 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -114,7 +114,7 @@ _mesa_check_query(GLcontext *ctx, struct gl_query_object *q) static void _mesa_delete_query(GLcontext *ctx, struct gl_query_object *q) { - _mesa_free(q); + free(q); } diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index aec22d9d148..c44db255d62 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -1122,7 +1122,7 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, /* free old buffer storage */ if (rb->Data) { - _mesa_free(rb->Data); + free(rb->Data); rb->Data = NULL; } @@ -1179,10 +1179,10 @@ alloc_storage_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, /* next, resize my alpha buffer */ if (arb->Data) { - _mesa_free(arb->Data); + free(arb->Data); } - arb->Data = _mesa_malloc(width * height * sizeof(GLubyte)); + arb->Data = malloc(width * height * sizeof(GLubyte)); if (arb->Data == NULL) { arb->Width = 0; arb->Height = 0; @@ -1204,13 +1204,13 @@ static void delete_renderbuffer_alpha8(struct gl_renderbuffer *arb) { if (arb->Data) { - _mesa_free(arb->Data); + free(arb->Data); } ASSERT(arb->Wrapped); ASSERT(arb != arb->Wrapped); arb->Wrapped->Delete(arb->Wrapped); arb->Wrapped = NULL; - _mesa_free(arb); + free(arb); } @@ -1460,9 +1460,9 @@ void _mesa_delete_renderbuffer(struct gl_renderbuffer *rb) { if (rb->Data) { - _mesa_free(rb->Data); + free(rb->Data); } - _mesa_free(rb); + free(rb); } diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index 91f2a7a7bf4..e6f6add7688 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -434,7 +434,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, * This array holds offsets of where the appropriate string ends, thus the * last element will be set to the total length of the source code. */ - offsets = (GLint *) _mesa_malloc(count * sizeof(GLint)); + offsets = (GLint *) malloc(count * sizeof(GLint)); if (offsets == NULL) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB"); return; @@ -442,7 +442,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, for (i = 0; i < count; i++) { if (string[i] == NULL) { - _mesa_free((GLvoid *) offsets); + free((GLvoid *) offsets); _mesa_error(ctx, GL_INVALID_OPERATION, "glShaderSourceARB(null string)"); return; } @@ -460,9 +460,9 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, * valgrind warnings in the parser/grammer code. */ totalLength = offsets[count - 1] + 2; - source = (GLcharARB *) _mesa_malloc(totalLength * sizeof(GLcharARB)); + source = (GLcharARB *) malloc(totalLength * sizeof(GLcharARB)); if (source == NULL) { - _mesa_free((GLvoid *) offsets); + free((GLvoid *) offsets); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB"); return; } @@ -491,7 +491,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, if (newSource) { _mesa_fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n", shaderObj, checksum, filename); - _mesa_free(source); + free(source); source = newSource; } } @@ -504,7 +504,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, sh->SourceChecksum = checksum; /* save original checksum */ } - _mesa_free(offsets); + free(offsets); } diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c index b889364f0dc..e364e24048f 100644 --- a/src/mesa/main/shared.c +++ b/src/mesa/main/shared.c @@ -362,7 +362,7 @@ free_shared_state(GLcontext *ctx, struct gl_shared_state *shared) _glthread_DESTROY_MUTEX(shared->Mutex); _glthread_DESTROY_MUTEX(shared->TexMutex); - _mesa_free(shared); + free(shared); } diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c index 36b48fd9f26..1bff308177d 100644 --- a/src/mesa/main/syncobj.c +++ b/src/mesa/main/syncobj.c @@ -78,7 +78,7 @@ static void _mesa_delete_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj) { (void) ctx; - _mesa_free(syncObj); + free(syncObj); } diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 73a31a17ec3..71e40dd3e93 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -105,7 +105,7 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS) dst, dstRowStride); if (tempImage) - _mesa_free((void*) tempImage); + free((void*) tempImage); return GL_TRUE; } @@ -162,7 +162,7 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS) dst, dstRowStride); if (tempImage) - _mesa_free((void*) tempImage); + free((void*) tempImage); return GL_TRUE; } @@ -1305,7 +1305,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps, if ((width & 7) | (height & 3)) { GLint newWidth = (width + 7) & ~7; GLint newHeight = (height + 3) & ~3; - newSource = _mesa_malloc(comps * newWidth * newHeight * sizeof(GLchan)); + newSource = malloc(comps * newWidth * newHeight * sizeof(GLchan)); if (!newSource) { GET_CURRENT_CONTEXT(ctx); _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture compression"); @@ -1324,7 +1324,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps, if (CHAN_TYPE != GL_UNSIGNED_BYTE) { const GLuint n = width * height * comps; const GLchan *src = (const GLchan *) source; - GLubyte *dest = (GLubyte *) _mesa_malloc(n * sizeof(GLubyte)); + GLubyte *dest = (GLubyte *) malloc(n * sizeof(GLubyte)); GLuint i; if (!dest) { GET_CURRENT_CONTEXT(ctx); @@ -1335,7 +1335,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps, dest[i] = CHAN_TO_UBYTE(src[i]); } if (newSource != NULL) { - _mesa_free(newSource); + free(newSource); } newSource = dest; /* we'll free this buffer before returning */ source = dest; /* the new, GLubyte incoming image */ @@ -1361,7 +1361,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps, cleanUp: if (newSource != NULL) { - _mesa_free(newSource); + free(newSource); } } diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index b271a539a72..fcd28a4b4e5 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -213,7 +213,7 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS) } if (tempImage) - _mesa_free((void *) tempImage); + free((void *) tempImage); return GL_TRUE; } @@ -275,7 +275,7 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS) } if (tempImage) - _mesa_free((void*) tempImage); + free((void*) tempImage); return GL_TRUE; } @@ -336,7 +336,7 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS) } if (tempImage) - _mesa_free((void *) tempImage); + free((void *) tempImage); return GL_TRUE; } @@ -397,7 +397,7 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS) } if (tempImage) - _mesa_free((void *) tempImage); + free((void *) tempImage); return GL_TRUE; } diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index da3c6f9841f..11e37dc34e5 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -488,8 +488,8 @@ _mesa_delete_texture_image( GLcontext *ctx, struct gl_texture_image *texImage ) ASSERT(texImage->Data == NULL); if (texImage->ImageOffsets) - _mesa_free(texImage->ImageOffsets); - _mesa_free(texImage); + free(texImage->ImageOffsets); + free(texImage); } @@ -843,7 +843,7 @@ clear_teximage_fields(struct gl_texture_image *img) img->Depth = 0; img->RowStride = 0; if (img->ImageOffsets) { - _mesa_free(img->ImageOffsets); + free(img->ImageOffsets); img->ImageOffsets = NULL; } img->Width2 = 0; @@ -932,8 +932,8 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target, * case code in the texstore routines. */ if (img->ImageOffsets) - _mesa_free(img->ImageOffsets); - img->ImageOffsets = (GLuint *) _mesa_malloc(depth * sizeof(GLuint)); + free(img->ImageOffsets); + img->ImageOffsets = (GLuint *) malloc(depth * sizeof(GLuint)); for (i = 0; i < depth; i++) { img->ImageOffsets[i] = i * width * height; } diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 649f3587cb6..feba6e95b6b 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -207,7 +207,7 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj ) _glthread_DESTROY_MUTEX(texObj->Mutex); /* free this object */ - _mesa_free(texObj); + free(texObj); } diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index cf603d46d86..dbed51a77f7 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -414,7 +414,7 @@ static void delete_texture_wrapper(struct gl_renderbuffer *rb) { ASSERT(rb->RefCount == 0); - _mesa_free(rb); + free(rb); } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index ab572a13edf..bd63c77a392 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -347,16 +347,16 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, GLfloat *convImage; /* pre-convolution image buffer (3D) */ - tempImage = (GLfloat *) _mesa_malloc(srcWidth * srcHeight * srcDepth + tempImage = (GLfloat *) malloc(srcWidth * srcHeight * srcDepth * 4 * sizeof(GLfloat)); if (!tempImage) return NULL; /* post-convolution image buffer (2D) */ - convImage = (GLfloat *) _mesa_malloc(srcWidth * srcHeight + convImage = (GLfloat *) malloc(srcWidth * srcHeight * 4 * sizeof(GLfloat)); if (!convImage) { - _mesa_free(tempImage); + free(tempImage); return NULL; } @@ -419,7 +419,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, } } /* loop over 3D image slices */ - _mesa_free(convImage); + free(convImage); /* might need these below */ srcWidth = convWidth; @@ -433,7 +433,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, GLfloat *dst; GLint img, row; - tempImage = (GLfloat *) _mesa_malloc(srcWidth * srcHeight * srcDepth + tempImage = (GLfloat *) malloc(srcWidth * srcHeight * srcDepth * components * sizeof(GLfloat)); if (!tempImage) return NULL; @@ -472,10 +472,10 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, */ ASSERT(texComponents >= logComponents); - newImage = (GLfloat *) _mesa_malloc(srcWidth * srcHeight * srcDepth + newImage = (GLfloat *) malloc(srcWidth * srcHeight * srcDepth * texComponents * sizeof(GLfloat)); if (!newImage) { - _mesa_free(tempImage); + free(tempImage); return NULL; } @@ -495,7 +495,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, } } - _mesa_free(tempImage); + free(tempImage); tempImage = newImage; } @@ -582,11 +582,11 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, #endif /* unpack and transfer the source image */ - tempImage = (GLchan *) _mesa_malloc(srcWidth * srcHeight * srcDepth + tempImage = (GLchan *) malloc(srcWidth * srcHeight * srcDepth * components * sizeof(GLchan)); if (!tempImage) { if (freeSrcImage) { - _mesa_free((void *) srcAddr); + free((void *) srcAddr); } return NULL; } @@ -611,7 +611,7 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, /* If we made a temporary image for convolution, free it here */ if (freeSrcImage) { - _mesa_free((void *) srcAddr); + free((void *) srcAddr); } if (logicalBaseFormat != textureBaseFormat) { @@ -631,10 +631,10 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, */ ASSERT(texComponents >= logComponents); - newImage = (GLchan *) _mesa_malloc(srcWidth * srcHeight * srcDepth + newImage = (GLchan *) malloc(srcWidth * srcHeight * srcDepth * texComponents * sizeof(GLchan)); if (!newImage) { - _mesa_free(tempImage); + free(tempImage); return NULL; } @@ -654,7 +654,7 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, } } - _mesa_free(tempImage); + free(tempImage); tempImage = newImage; } @@ -1267,7 +1267,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -1395,7 +1395,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -1606,7 +1606,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -1733,7 +1733,7 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -1841,7 +1841,7 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -1912,7 +1912,7 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -1970,7 +1970,7 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2040,7 +2040,7 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2143,7 +2143,7 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2218,7 +2218,7 @@ _mesa_texstore_al1616(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2273,7 +2273,7 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2360,7 +2360,7 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) src += srcWidth; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2518,7 +2518,7 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) GLbyte *tempImage, *dst, *src; GLint row; - tempImage = (GLbyte *) _mesa_malloc(srcWidth * srcHeight * srcDepth + tempImage = (GLbyte *) malloc(srcWidth * srcHeight * srcDepth * components * sizeof(GLbyte)); if (!tempImage) return GL_FALSE; @@ -2546,7 +2546,7 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) dst += dstRowStride; src += srcWidth * texelBytes; } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2667,7 +2667,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2925,7 +2925,7 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2996,7 +2996,7 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 9d23c577bd1..e474fe7fa51 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -122,7 +122,7 @@ _mesa_compute_version(GLcontext *ctx) compute_version(ctx, &ctx->VersionMajor, &ctx->VersionMinor); - ctx->VersionString = (char *) _mesa_malloc(max); + ctx->VersionString = (char *) malloc(max); if (ctx->VersionString) { _mesa_snprintf(ctx->VersionString, max, "%u.%u Mesa " MESA_VERSION_STRING, ctx->VersionMajor, ctx->VersionMinor); diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index bdd26b7f3a7..03ff30a2394 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -85,7 +85,7 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, } if (program->Base.String != NULL) - _mesa_free(program->Base.String); + free(program->Base.String); /* Copy the relevant contents of the arb_program struct into the * fragment_program struct. @@ -130,7 +130,7 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, program->Base.InputsRead |= FRAG_BIT_FOGC; if (program->Base.Instructions) - _mesa_free(program->Base.Instructions); + free(program->Base.Instructions); program->Base.Instructions = prog.Instructions; if (program->Base.Parameters) @@ -181,7 +181,7 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, } if (program->Base.String != NULL) - _mesa_free(program->Base.String); + free(program->Base.String); /* Copy the relevant contents of the arb_program struct into the * vertex_program struct. @@ -203,7 +203,7 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, ? GL_TRUE : GL_FALSE; if (program->Base.Instructions) - _mesa_free(program->Base.Instructions); + free(program->Base.Instructions); program->Base.Instructions = prog.Instructions; if (program->Base.Parameters) diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c index fb2fa4b95f9..870f77e30dc 100644 --- a/src/mesa/shader/atifragshader.c +++ b/src/mesa/shader/atifragshader.c @@ -60,11 +60,11 @@ _mesa_delete_ati_fragment_shader(GLcontext *ctx, struct ati_fragment_shader *s) GLuint i; for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { if (s->Instructions[i]) - _mesa_free(s->Instructions[i]); + free(s->Instructions[i]); if (s->SetupInst[i]) - _mesa_free(s->SetupInst[i]); + free(s->SetupInst[i]); } - _mesa_free(s); + free(s); } @@ -293,7 +293,7 @@ _mesa_DeleteFragmentShaderATI(GLuint id) if (prog) { prog->RefCount--; if (prog->RefCount <= 0) { - _mesa_free(prog); + free(prog); } } } @@ -318,9 +318,9 @@ _mesa_BeginFragmentShaderATI(void) /* no idea if it's allowed to redefine a shader */ for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { if (ctx->ATIFragmentShader.Current->Instructions[i]) - _mesa_free(ctx->ATIFragmentShader.Current->Instructions[i]); + free(ctx->ATIFragmentShader.Current->Instructions[i]); if (ctx->ATIFragmentShader.Current->SetupInst[i]) - _mesa_free(ctx->ATIFragmentShader.Current->SetupInst[i]); + free(ctx->ATIFragmentShader.Current->SetupInst[i]); } /* malloc the instructions here - not sure if the best place but its @@ -328,11 +328,11 @@ _mesa_BeginFragmentShaderATI(void) for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { ctx->ATIFragmentShader.Current->Instructions[i] = (struct atifs_instruction *) - _mesa_calloc(sizeof(struct atifs_instruction) * + calloc(1, sizeof(struct atifs_instruction) * (MAX_NUM_INSTRUCTIONS_PER_PASS_ATI)); ctx->ATIFragmentShader.Current->SetupInst[i] = (struct atifs_setupinst *) - _mesa_calloc(sizeof(struct atifs_setupinst) * + calloc(1, sizeof(struct atifs_setupinst) * (MAX_NUM_FRAGMENT_REGISTERS_ATI)); } diff --git a/src/mesa/shader/hash_table.c b/src/mesa/shader/hash_table.c index e89a2564d76..fa6ba2bfdfc 100644 --- a/src/mesa/shader/hash_table.c +++ b/src/mesa/shader/hash_table.c @@ -65,7 +65,7 @@ hash_table_ctor(unsigned num_buckets, hash_func_t hash, num_buckets = 16; } - ht = _mesa_malloc(sizeof(*ht) + ((num_buckets - 1) + ht = malloc(sizeof(*ht) + ((num_buckets - 1) * sizeof(ht->buckets[0]))); if (ht != NULL) { ht->hash = hash; @@ -85,7 +85,7 @@ void hash_table_dtor(struct hash_table *ht) { hash_table_clear(ht); - _mesa_free(ht); + free(ht); } @@ -100,7 +100,7 @@ hash_table_clear(struct hash_table *ht) for (i = 0; i < ht->num_buckets; i++) { foreach_s(node, temp, & ht->buckets[i]) { remove_from_list(node); - _mesa_free(node); + free(node); } assert(is_empty_list(& ht->buckets[i])); @@ -134,7 +134,7 @@ hash_table_insert(struct hash_table *ht, void *data, const void *key) const unsigned bucket = hash_value % ht->num_buckets; struct hash_node *node; - node = _mesa_calloc(sizeof(*node)); + node = calloc(1, sizeof(*node)); node->data = data; node->key = key; diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 639408d82a4..4f02703619c 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -171,7 +171,7 @@ record_error(struct parse_state *parseState, const char *msg, int lineNo) _mesa_debug(parseState->ctx, "nvfragparse.c(%d): line %d, column %d:%s (%s)\n", lineNo, line, column, (char *) lineStr, msg); - _mesa_free((void *) lineStr); + free((void *) lineStr); #else (void) lineNo; #endif @@ -1231,7 +1231,7 @@ Parse_PrintInstruction(struct parse_state *parseState, for (len = 0; str[len] != '\''; len++) /* find closing quote */ ; parseState->pos += len + 1; - msg = (GLubyte*) _mesa_malloc(len + 1); + msg = (GLubyte*) malloc(len + 1); memcpy(msg, str, len); msg[len] = 0; @@ -1548,7 +1548,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, program->Base.String = programString; program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB; if (program->Base.Instructions) { - _mesa_free(program->Base.Instructions); + free(program->Base.Instructions); } program->Base.Instructions = newInst; program->Base.NumInstructions = parseState.numInst; diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 3656438d42c..fb36303bb97 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -82,7 +82,7 @@ record_error(struct parse_state *parseState, const char *msg, int lineNo) _mesa_debug(parseState->ctx, "nvfragparse.c(%d): line %d, column %d:%s (%s)\n", lineNo, line, column, (char *) lineStr, msg); - _mesa_free((void *) lineStr); + free((void *) lineStr); #else (void) lineNo; #endif @@ -1048,7 +1048,7 @@ Parse_PrintInstruction(struct parse_state *parseState, struct prog_instruction * for (len = 0; str[len] != '\''; len++) /* find closing quote */ ; parseState->pos += len + 1; - msg = (GLubyte*) _mesa_malloc(len + 1); + msg = (GLubyte*) malloc(len + 1); memcpy(msg, str, len); msg[len] = 0; @@ -1372,7 +1372,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, newInst = _mesa_alloc_instructions(parseState.numInst); if (!newInst) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); - _mesa_free(programString); + free(programString); return; /* out of memory */ } _mesa_copy_instructions(newInst, instBuffer, parseState.numInst); @@ -1380,12 +1380,12 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, /* install the program */ program->Base.Target = target; if (program->Base.String) { - _mesa_free(program->Base.String); + free(program->Base.String); } program->Base.String = programString; program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB; if (program->Base.Instructions) { - _mesa_free(program->Base.Instructions); + free(program->Base.Instructions); } program->Base.Instructions = newInst; program->Base.InputsRead = parseState.inputsRead; diff --git a/src/mesa/shader/prog_cache.c b/src/mesa/shader/prog_cache.c index 8e54f3a5a03..e5b602fc093 100644 --- a/src/mesa/shader/prog_cache.c +++ b/src/mesa/shader/prog_cache.c @@ -87,7 +87,7 @@ rehash(struct gl_program_cache *cache) cache->last = NULL; size = cache->size * 3; - items = (struct cache_item**) _mesa_malloc(size * sizeof(*items)); + items = (struct cache_item**) malloc(size * sizeof(*items)); memset(items, 0, size * sizeof(*items)); for (i = 0; i < cache->size; i++) @@ -97,7 +97,7 @@ rehash(struct gl_program_cache *cache) items[c->hash % size] = c; } - _mesa_free(cache->items); + free(cache->items); cache->items = items; cache->size = size; } @@ -114,9 +114,9 @@ clear_cache(GLcontext *ctx, struct gl_program_cache *cache) for (i = 0; i < cache->size; i++) { for (c = cache->items[i]; c; c = next) { next = c->next; - _mesa_free(c->key); + free(c->key); _mesa_reference_program(ctx, &c->program, NULL); - _mesa_free(c); + free(c); } cache->items[i] = NULL; } @@ -134,9 +134,9 @@ _mesa_new_program_cache(void) if (cache) { cache->size = 17; cache->items = (struct cache_item **) - _mesa_calloc(cache->size * sizeof(struct cache_item)); + calloc(1, cache->size * sizeof(struct cache_item)); if (!cache->items) { - _mesa_free(cache); + free(cache); return NULL; } } @@ -148,8 +148,8 @@ void _mesa_delete_program_cache(GLcontext *ctx, struct gl_program_cache *cache) { clear_cache(ctx, cache); - _mesa_free(cache->items); - _mesa_free(cache); + free(cache->items); + free(cache); } @@ -188,7 +188,7 @@ _mesa_program_cache_insert(GLcontext *ctx, c->hash = hash; - c->key = _mesa_malloc(keysize); + c->key = malloc(keysize); memcpy(c->key, key, keysize); c->program = program; /* no refcount change */ diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index 0c4da4d1079..81099cb99c5 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -70,7 +70,7 @@ struct prog_instruction * _mesa_alloc_instructions(GLuint numInst) { return (struct prog_instruction *) - _mesa_calloc(numInst * sizeof(struct prog_instruction)); + calloc(1, numInst * sizeof(struct prog_instruction)); } @@ -128,11 +128,11 @@ _mesa_free_instructions(struct prog_instruction *inst, GLuint count) GLuint i; for (i = 0; i < count; i++) { if (inst[i].Data) - _mesa_free(inst[i].Data); + free(inst[i].Data); if (inst[i].Comment) - _mesa_free((char *) inst[i].Comment); + free((char *) inst[i].Comment); } - _mesa_free(inst); + free(inst); } diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index e1ec52254c0..09816d5044d 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -237,7 +237,7 @@ _mesa_remove_dead_code(struct gl_program *prog) } removeInst = (GLboolean *) - _mesa_calloc(prog->NumInstructions * sizeof(GLboolean)); + calloc(1, prog->NumInstructions * sizeof(GLboolean)); /* Determine which temps are read and written */ for (i = 0; i < prog->NumInstructions; i++) { @@ -347,7 +347,7 @@ _mesa_remove_dead_code(struct gl_program *prog) } done: - _mesa_free(removeInst); + free(removeInst); } @@ -538,7 +538,7 @@ _mesa_remove_extra_moves(struct gl_program *prog) } removeInst = (GLboolean *) - _mesa_calloc(prog->NumInstructions * sizeof(GLboolean)); + calloc(1, prog->NumInstructions * sizeof(GLboolean)); /* * Look for sequences such as this: @@ -621,7 +621,7 @@ _mesa_remove_extra_moves(struct gl_program *prog) /* now remove the instructions which aren't needed */ rem = remove_instructions(prog, removeInst); - _mesa_free(removeInst); + free(removeInst); if (dbg) { _mesa_printf("Optimize: End remove extra moves. %u instructions removed\n", rem); diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 1feb7bd71d3..25bb4f3d441 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -54,16 +54,16 @@ _mesa_new_parameter_list_sized(unsigned size) /* alloc arrays */ p->Parameters = (struct gl_program_parameter *) - _mesa_calloc(size * sizeof(struct gl_program_parameter)); + calloc(1, size * sizeof(struct gl_program_parameter)); p->ParameterValues = (GLfloat (*)[4]) _mesa_align_malloc(size * 4 *sizeof(GLfloat), 16); if ((p->Parameters == NULL) || (p->ParameterValues == NULL)) { - _mesa_free(p->Parameters); + free(p->Parameters); _mesa_align_free(p->ParameterValues); - _mesa_free(p); + free(p); p = NULL; } } @@ -81,12 +81,12 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList) GLuint i; for (i = 0; i < paramList->NumParameters; i++) { if (paramList->Parameters[i].Name) - _mesa_free((void *) paramList->Parameters[i].Name); + free((void *) paramList->Parameters[i].Name); } - _mesa_free(paramList->Parameters); + free(paramList->Parameters); if (paramList->ParameterValues) _mesa_align_free(paramList->ParameterValues); - _mesa_free(paramList); + free(paramList); } @@ -486,7 +486,7 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList, paramList->StateFlags |= _mesa_program_state_flags(stateTokens); /* free name string here since we duplicated it in add_parameter() */ - _mesa_free(name); + free(name); return index; } diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 54fd88ad4fb..b238537673e 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -309,7 +309,7 @@ reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode, = prog->Parameters->Parameters + index; char *state = _mesa_program_state_string(param->StateIndexes); _mesa_sprintf(str, state); - _mesa_free(state); + free(state); } break; case PROGRAM_ADDRESS: diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index f5264fa9189..2c844490dd7 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -957,7 +957,7 @@ append_index(char *dst, GLint index) /** * Make a string from the given state vector. * For example, return "state.matrix.texture[2].inverse". - * Use _mesa_free() to deallocate the string. + * Use free() to deallocate the string. */ char * _mesa_program_state_string(const gl_state_index state[STATE_LENGTH]) diff --git a/src/mesa/shader/prog_uniform.c b/src/mesa/shader/prog_uniform.c index a831ce8cb66..c408a8492c6 100644 --- a/src/mesa/shader/prog_uniform.c +++ b/src/mesa/shader/prog_uniform.c @@ -45,10 +45,10 @@ _mesa_free_uniform_list(struct gl_uniform_list *list) { GLuint i; for (i = 0; i < list->NumUniforms; i++) { - _mesa_free((void *) list->Uniforms[i].Name); + free((void *) list->Uniforms[i].Name); } - _mesa_free(list->Uniforms); - _mesa_free(list); + free(list->Uniforms); + free(list); } diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 0c3c5ffbd5f..f4f701b5461 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -127,11 +127,11 @@ _mesa_free_program_data(GLcontext *ctx) if (ctx->ATIFragmentShader.Current) { ctx->ATIFragmentShader.Current->RefCount--; if (ctx->ATIFragmentShader.Current->RefCount <= 0) { - _mesa_free(ctx->ATIFragmentShader.Current); + free(ctx->ATIFragmentShader.Current); } } #endif - _mesa_free((void *) ctx->Program.ErrorString); + free((void *) ctx->Program.ErrorString); } @@ -162,7 +162,7 @@ _mesa_update_default_objects_program(GLcontext *ctx) if (ctx->ATIFragmentShader.Current) { ctx->ATIFragmentShader.Current->RefCount--; if (ctx->ATIFragmentShader.Current->RefCount <= 0) { - _mesa_free(ctx->ATIFragmentShader.Current); + free(ctx->ATIFragmentShader.Current); } } ctx->ATIFragmentShader.Current = (struct ati_fragment_shader *) ctx->Shared->DefaultFragmentShader; @@ -180,7 +180,7 @@ void _mesa_set_program_error(GLcontext *ctx, GLint pos, const char *string) { ctx->Program.ErrorPos = pos; - _mesa_free((void *) ctx->Program.ErrorString); + free((void *) ctx->Program.ErrorString); if (!string) string = ""; ctx->Program.ErrorString = _mesa_strdup(string); @@ -190,7 +190,7 @@ _mesa_set_program_error(GLcontext *ctx, GLint pos, const char *string) /** * Find the line number and column for 'pos' within 'string'. * Return a copy of the line which contains 'pos'. Free the line with - * _mesa_free(). + * free(). * \param string the program string * \param pos the position within the string * \param line returns the line number corresponding to 'pos'. @@ -222,7 +222,7 @@ _mesa_find_line_column(const GLubyte *string, const GLubyte *pos, while (*p != 0 && *p != '\n') p++; len = p - lineStart; - s = (GLubyte *) _mesa_malloc(len + 1); + s = (GLubyte *) malloc(len + 1); memcpy(s, lineStart, len); s[len] = 0; @@ -337,7 +337,7 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog) return; if (prog->String) - _mesa_free(prog->String); + free(prog->String); _mesa_free_instructions(prog->Instructions, prog->NumInstructions); @@ -351,7 +351,7 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog) _mesa_free_parameter_list(prog->Attributes); } - _mesa_free(prog); + free(prog); } diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 182ef4c26d1..e5ef25ec38a 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -3140,7 +3140,7 @@ yyreduce: ? err_str : "invalid condition code"); if (err_str != NULL) { - _mesa_free(err_str); + free(err_str); } YYERROR; @@ -3166,7 +3166,7 @@ yyreduce: ? err_str : "invalid condition code"); if (err_str != NULL) { - _mesa_free(err_str); + free(err_str); } YYERROR; @@ -4547,7 +4547,7 @@ yyreduce: ? err_str : "invalid storage size specifier"); if (err_str != NULL) { - _mesa_free(err_str); + free(err_str); } YYERROR; @@ -5403,7 +5403,7 @@ int add_state_reference(struct gl_program_parameter_list *param_list, param_list->StateFlags |= _mesa_program_state_flags(tokens); /* free name string here since we duplicated it in add_parameter() */ - _mesa_free(name); + free(name); return index; } @@ -5568,7 +5568,7 @@ make_error_string(const char *fmt, ...) */ length = 1 + vsnprintf(NULL, 0, fmt, args); - str = _mesa_malloc(length); + str = malloc(length); if (str) { vsnprintf(str, length, fmt, args); } @@ -5588,7 +5588,7 @@ yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s) err_str = make_error_string("glProgramStringARB(%s)\n", s); if (err_str) { _mesa_error(state->ctx, GL_INVALID_OPERATION, err_str); - _mesa_free(err_str); + free(err_str); } err_str = make_error_string("line %u, char %u: error: %s\n", @@ -5596,7 +5596,7 @@ yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s) _mesa_set_program_error(state->ctx, locp->position, err_str); if (err_str) { - _mesa_free(err_str); + free(err_str); } } @@ -5618,7 +5618,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, /* Make a copy of the program string and force it to be NUL-terminated. */ - strz = (GLubyte *) _mesa_malloc(len + 1); + strz = (GLubyte *) malloc(len + 1); if (strz == NULL) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); return GL_FALSE; @@ -5706,7 +5706,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, error: for (inst = state->inst_head; inst != NULL; inst = temp) { temp = inst->next; - _mesa_free(inst); + free(inst); } state->inst_head = NULL; @@ -5715,8 +5715,8 @@ error: for (sym = state->sym; sym != NULL; sym = temp) { temp = sym->next; - _mesa_free((void *) sym->name); - _mesa_free(sym); + free((void *) sym->name); + free(sym); } state->sym = NULL; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 577bd2c38d1..299e2477e48 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -1056,7 +1056,7 @@ ccMaskRule: IDENTIFIER ? err_str : "invalid condition code"); if (err_str != NULL) { - _mesa_free(err_str); + free(err_str); } YYERROR; @@ -1079,7 +1079,7 @@ ccMaskRule2: USED_IDENTIFIER ? err_str : "invalid condition code"); if (err_str != NULL) { - _mesa_free(err_str); + free(err_str); } YYERROR; @@ -1956,7 +1956,7 @@ optVarSize: string ? err_str : "invalid storage size specifier"); if (err_str != NULL) { - _mesa_free(err_str); + free(err_str); } YYERROR; @@ -2442,7 +2442,7 @@ int add_state_reference(struct gl_program_parameter_list *param_list, param_list->StateFlags |= _mesa_program_state_flags(tokens); /* free name string here since we duplicated it in add_parameter() */ - _mesa_free(name); + free(name); return index; } @@ -2607,7 +2607,7 @@ make_error_string(const char *fmt, ...) */ length = 1 + vsnprintf(NULL, 0, fmt, args); - str = _mesa_malloc(length); + str = malloc(length); if (str) { vsnprintf(str, length, fmt, args); } @@ -2627,7 +2627,7 @@ yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s) err_str = make_error_string("glProgramStringARB(%s)\n", s); if (err_str) { _mesa_error(state->ctx, GL_INVALID_OPERATION, err_str); - _mesa_free(err_str); + free(err_str); } err_str = make_error_string("line %u, char %u: error: %s\n", @@ -2635,7 +2635,7 @@ yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s) _mesa_set_program_error(state->ctx, locp->position, err_str); if (err_str) { - _mesa_free(err_str); + free(err_str); } } @@ -2657,7 +2657,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, /* Make a copy of the program string and force it to be NUL-terminated. */ - strz = (GLubyte *) _mesa_malloc(len + 1); + strz = (GLubyte *) malloc(len + 1); if (strz == NULL) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); return GL_FALSE; @@ -2745,7 +2745,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, error: for (inst = state->inst_head; inst != NULL; inst = temp) { temp = inst->next; - _mesa_free(inst); + free(inst); } state->inst_head = NULL; @@ -2754,8 +2754,8 @@ error: for (sym = state->sym; sym != NULL; sym = temp) { temp = sym->next; - _mesa_free((void *) sym->name); - _mesa_free(sym); + free((void *) sym->name); + free(sym); } state->sym = NULL; diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 7e2a60f74b7..ad3ff26c58f 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -115,12 +115,12 @@ _mesa_free_shader_program_data(GLcontext *ctx, shProg->NumShaders = 0; if (shProg->Shaders) { - _mesa_free(shProg->Shaders); + free(shProg->Shaders); shProg->Shaders = NULL; } if (shProg->InfoLog) { - _mesa_free(shProg->InfoLog); + free(shProg->InfoLog); shProg->InfoLog = NULL; } } @@ -134,7 +134,7 @@ _mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg) { _mesa_free_shader_program_data(ctx, shProg); - _mesa_free(shProg); + free(shProg); } @@ -262,11 +262,11 @@ void _mesa_free_shader(GLcontext *ctx, struct gl_shader *sh) { if (sh->Source) - _mesa_free((void *) sh->Source); + free((void *) sh->Source); if (sh->InfoLog) - _mesa_free(sh->InfoLog); + free(sh->InfoLog); _mesa_reference_program(ctx, &sh->Program, NULL); - _mesa_free(sh); + free(sh); } @@ -709,7 +709,7 @@ _mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader) /* alloc new, smaller array */ newList = (struct gl_shader **) - _mesa_malloc((n - 1) * sizeof(struct gl_shader *)); + malloc((n - 1) * sizeof(struct gl_shader *)); if (!newList) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDetachShader"); return; @@ -719,7 +719,7 @@ _mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader) } while (++i < n) newList[j++] = shProg->Shaders[i]; - _mesa_free(shProg->Shaders); + free(shProg->Shaders); shProg->Shaders = newList; shProg->NumShaders = n - 1; @@ -1377,7 +1377,7 @@ _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name) if (c) { /* truncate name at [ */ const GLint len = c - name; - GLchar *newName = _mesa_malloc(len + 1); + GLchar *newName = malloc(len + 1); if (!newName) return -1; /* out of mem */ memcpy(newName, name, len); @@ -1400,7 +1400,7 @@ _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name) } } - _mesa_free(newName); + free(newName); } } @@ -1431,7 +1431,7 @@ _mesa_shader_source(GLcontext *ctx, GLuint shader, const GLchar *source) /* free old shader source string and install new one */ if (sh->Source) { - _mesa_free((void *) sh->Source); + free((void *) sh->Source); } sh->Source = source; sh->CompileStatus = GL_FALSE; @@ -2155,7 +2155,7 @@ _mesa_validate_program(GLcontext *ctx, GLuint program) if (!shProg->Validated) { /* update info log */ if (shProg->InfoLog) { - _mesa_free(shProg->InfoLog); + free(shProg->InfoLog); } shProg->InfoLog = _mesa_strdup(errMsg); } diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 2280ceb9ee8..6901b93d5de 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -3639,7 +3639,7 @@ make_constant_array(slang_assemble_ctx *A, assert(initializer->type == SLANG_OPER_CALL); assert(initializer->array_constructor); - values = (GLfloat *) _mesa_malloc(numElements * 4 * sizeof(GLfloat)); + values = (GLfloat *) malloc(numElements * 4 * sizeof(GLfloat)); /* convert constructor params into ordinary floats */ for (i = 0; i < numElements; i++) { @@ -3670,7 +3670,7 @@ make_constant_array(slang_assemble_ctx *A, } assert(var->store->Size == size); - _mesa_free(values); + free(values); return GL_TRUE; } @@ -5321,7 +5321,7 @@ _slang_codegen_function(slang_assemble_ctx * A, slang_function * fun) /* free codegen context */ /* - _mesa_free(A->codegen); + free(A->codegen); */ return success; diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 41d51cd98a5..4280698cc94 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2948,7 +2948,7 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) /* free shader's prev info log */ if (shader->InfoLog) { - _mesa_free(shader->InfoLog); + free(shader->InfoLog); shader->InfoLog = NULL; } diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c index eab912710e8..23c08a9039d 100644 --- a/src/mesa/shader/slang/slang_compile_variable.c +++ b/src/mesa/shader/slang/slang_compile_variable.c @@ -182,7 +182,7 @@ slang_variable_destruct(slang_variable * var) } #if 0 if (var->aux) { - _mesa_free(var->aux); + free(var->aux); } #endif } diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index b621e892c33..8bd699ff9dc 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -2528,7 +2528,7 @@ _slang_resolve_subroutines(slang_emit_info *emitInfo) GLuint *subroutineLoc, i, total; subroutineLoc - = (GLuint *) _mesa_malloc(emitInfo->NumSubroutines * sizeof(GLuint)); + = (GLuint *) malloc(emitInfo->NumSubroutines * sizeof(GLuint)); /* total number of instructions */ total = mainP->NumInstructions; @@ -2566,7 +2566,7 @@ _slang_resolve_subroutines(slang_emit_info *emitInfo) /* free subroutine list */ if (emitInfo->Subroutines) { - _mesa_free(emitInfo->Subroutines); + free(emitInfo->Subroutines); emitInfo->Subroutines = NULL; } emitInfo->NumSubroutines = 0; @@ -2585,7 +2585,7 @@ _slang_resolve_subroutines(slang_emit_info *emitInfo) } } - _mesa_free(subroutineLoc); + free(subroutineLoc); } diff --git a/src/mesa/shader/slang/slang_label.c b/src/mesa/shader/slang/slang_label.c index 12406213656..7e00b5787fb 100644 --- a/src/mesa/shader/slang/slang_label.c +++ b/src/mesa/shader/slang/slang_label.c @@ -34,7 +34,7 @@ _slang_label_new_unique(const char *name) if (l) { l->Name = (char *) _slang_alloc(strlen(name) + 10); if (!l->Name) { - _mesa_free(l); + free(l); return NULL; } _mesa_sprintf(l->Name, "%s_%d", name, id); diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 68129d4c5a0..89658c1a398 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -68,7 +68,7 @@ static void link_error(struct gl_shader_program *shProg, const char *msg) { if (shProg->InfoLog) { - _mesa_free(shProg->InfoLog); + free(shProg->InfoLog); } shProg->InfoLog = _mesa_strdup(msg); shProg->LinkStatus = GL_FALSE; @@ -103,7 +103,7 @@ link_varying_vars(GLcontext *ctx, GLuint *map, i, firstVarying, newFile; GLbitfield *inOutFlags; - map = (GLuint *) _mesa_malloc(prog->Varying->NumParameters * sizeof(GLuint)); + map = (GLuint *) malloc(prog->Varying->NumParameters * sizeof(GLuint)); if (!map) return GL_FALSE; @@ -134,7 +134,7 @@ link_varying_vars(GLcontext *ctx, &shProg->Varying->Parameters[j]; if (var->Size != v->Size) { link_error(shProg, "mismatched varying variable types"); - _mesa_free(map); + free(map); return GL_FALSE; } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_CENTROID)) { @@ -142,7 +142,7 @@ link_varying_vars(GLcontext *ctx, _mesa_snprintf(msg, sizeof(msg), "centroid modifier mismatch for '%s'", var->Name); link_error(shProg, msg); - _mesa_free(map); + free(map); return GL_FALSE; } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_INVARIANT)) { @@ -150,7 +150,7 @@ link_varying_vars(GLcontext *ctx, _mesa_snprintf(msg, sizeof(msg), "invariant modifier mismatch for '%s'", var->Name); link_error(shProg, msg); - _mesa_free(map); + free(map); return GL_FALSE; } } @@ -162,7 +162,7 @@ link_varying_vars(GLcontext *ctx, if (shProg->Varying->NumParameters > ctx->Const.MaxVarying) { link_error(shProg, "Too many varying variables"); - _mesa_free(map); + free(map); return GL_FALSE; } @@ -202,7 +202,7 @@ link_varying_vars(GLcontext *ctx, } } - _mesa_free(map); + free(map); /* these will get recomputed before linking is completed */ prog->InputsRead = 0x0; @@ -594,7 +594,7 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) GLuint totalLen = 0, len = 0; GLuint i; - shaderLengths = (GLuint *)_mesa_malloc(shProg->NumShaders * sizeof(GLuint)); + shaderLengths = (GLuint *)malloc(shProg->NumShaders * sizeof(GLuint)); if (!shaderLengths) { return NULL; } @@ -611,13 +611,13 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) } if (totalLen == 0) { - _mesa_free(shaderLengths); + free(shaderLengths); return NULL; } - source = (GLchar *) _mesa_malloc(totalLen + 1); + source = (GLchar *) malloc(totalLen + 1); if (!source) { - _mesa_free(shaderLengths); + free(shaderLengths); return NULL; } @@ -634,13 +634,13 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) _mesa_printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source); */ - _mesa_free(shaderLengths); + free(shaderLengths); remove_extra_version_directives(source); newShader = CALLOC_STRUCT(gl_shader); if (!newShader) { - _mesa_free(source); + free(source); return NULL; } diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c index 4f6b8541c5a..23917fbd2cf 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -43,7 +43,7 @@ void slang_info_log_destruct(slang_info_log * log) { if (!log->dont_free_text) - _mesa_free(log->text); + free(log->text); } static int @@ -63,7 +63,7 @@ slang_info_log_message(slang_info_log * log, const char *prefix, _mesa_realloc(log->text, old_len + 1, old_len + size); } else { - log->text = (char *) (_mesa_malloc(size)); + log->text = (char *) (malloc(size)); if (log->text != NULL) log->text[0] = '\0'; } diff --git a/src/mesa/shader/slang/slang_mem.c b/src/mesa/shader/slang/slang_mem.c index 54f5196617f..5eaa7c44272 100644 --- a/src/mesa/shader/slang/slang_mem.c +++ b/src/mesa/shader/slang/slang_mem.c @@ -56,12 +56,12 @@ struct slang_mempool_ slang_mempool * _slang_new_mempool(GLuint initialSize) { - slang_mempool *pool = (slang_mempool *) _mesa_calloc(sizeof(slang_mempool)); + slang_mempool *pool = (slang_mempool *) calloc(1, sizeof(slang_mempool)); if (pool) { - pool->Data = (char *) _mesa_calloc(initialSize); + pool->Data = (char *) calloc(1, initialSize); /*printf("ALLOC MEMPOOL %d at %p\n", initialSize, pool->Data);*/ if (!pool->Data) { - _mesa_free(pool); + free(pool); return NULL; } pool->Size = initialSize; @@ -82,8 +82,8 @@ _slang_delete_mempool(slang_mempool *pool) pool->Used, pool->Size, pool->Count, pool->Largest); */ total += pool->Used; - _mesa_free(pool->Data); - _mesa_free(pool); + free(pool->Data); + free(pool); pool = next; } /*printf("TOTAL ALLOCATED: %u\n", total);*/ @@ -125,7 +125,7 @@ void * _slang_alloc(GLuint bytes) { #if USE_MALLOC_FREE - return _mesa_calloc(bytes); + return calloc(1, bytes); #else slang_mempool *pool; GET_CURRENT_CONTEXT(ctx); @@ -231,7 +231,7 @@ void _slang_free(void *addr) { #if USE_MALLOC_FREE - _mesa_free(addr); + free(addr); #else if (addr) { GET_CURRENT_CONTEXT(ctx); diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index 56a33e6f6b5..dc1e196bde5 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -54,7 +54,7 @@ GLvoid slang_string_free (slang_string *self) { if (self->data != NULL) - _mesa_free (self->data); + free(self->data); } GLvoid diff --git a/src/mesa/shader/symbol_table.c b/src/mesa/shader/symbol_table.c index 1f6d9b844d6..6a5d6868974 100644 --- a/src/mesa/shader/symbol_table.c +++ b/src/mesa/shader/symbol_table.c @@ -354,7 +354,7 @@ _mesa_symbol_table_dtor(struct _mesa_symbol_table *table) for (hdr = table->hdr; hdr != NULL; hdr = next) { next = hdr->next; - _mesa_free(hdr); + free(hdr); } hash_table_dtor(table->ht); diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c index 1be72e729e4..33e43ddcc4c 100644 --- a/src/mesa/state_tracker/st_cb_accum.c +++ b/src/mesa/state_tracker/st_cb_accum.c @@ -143,7 +143,7 @@ accum_accum(struct st_context *st, GLfloat value, PIPE_TRANSFER_READ, xpos, ypos, width, height); - buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf); @@ -165,7 +165,7 @@ accum_accum(struct st_context *st, GLfloat value, _mesa_problem(NULL, "unexpected format in st_clear_accum_buffer()"); } - _mesa_free(buf); + free(buf); screen->tex_transfer_destroy(color_trans); } @@ -192,7 +192,7 @@ accum_load(struct st_context *st, GLfloat value, PIPE_TRANSFER_READ, xpos, ypos, width, height); - buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf); @@ -214,7 +214,7 @@ accum_load(struct st_context *st, GLfloat value, _mesa_problem(NULL, "unexpected format in st_clear_accum_buffer()"); } - _mesa_free(buf); + free(buf); screen->tex_transfer_destroy(color_trans); } @@ -237,7 +237,7 @@ accum_return(GLcontext *ctx, GLfloat value, if (ST_DEBUG & DEBUG_FALLBACK) debug_printf("%s: fallback processing\n", __FUNCTION__); - buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!colormask[0] || !colormask[1] || !colormask[2] || !colormask[3]) usage = PIPE_TRANSFER_READ_WRITE; @@ -282,7 +282,7 @@ accum_return(GLcontext *ctx, GLfloat value, pipe_put_tile_rgba(color_trans, 0, 0, width, height, buf); - _mesa_free(buf); + free(buf); screen->tex_transfer_destroy(color_trans); } diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index e029ea7ffce..5968426a1d7 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -837,7 +837,7 @@ st_destroy_bitmap(struct st_context *st) screen->tex_transfer_destroy(cache->trans); } pipe_texture_reference(&st->bitmap.cache->texture, NULL); - _mesa_free(st->bitmap.cache); + free(st->bitmap.cache); st->bitmap.cache = NULL; } } diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index c92af34378d..b55a085cc7c 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -80,7 +80,7 @@ st_bufferobj_free(GLcontext *ctx, struct gl_buffer_object *obj) if (st_obj->buffer) pipe_buffer_reference(&st_obj->buffer, NULL); - _mesa_free(st_obj); + free(st_obj); } diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 36c0a2b0e1e..4e86450edf4 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -828,7 +828,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, ubyte *buffer; int i; - buffer = _mesa_malloc(width * height * sizeof(ubyte)); + buffer = malloc(width * height * sizeof(ubyte)); if (!buffer) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels(stencil)"); return; @@ -907,7 +907,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, } } - _mesa_free(buffer); + free(buffer); /* unmap the stencil buffer */ screen->transfer_unmap(screen, ptDraw); @@ -1089,19 +1089,19 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, if (type == GL_COLOR) { /* alternate path using get/put_tile() */ - GLfloat *buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(ptRead, 0, 0, width, height, buf); pipe_put_tile_rgba(ptTex, 0, 0, width, height, buf); - _mesa_free(buf); + free(buf); } else { /* GL_DEPTH */ - GLuint *buf = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); + GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint)); pipe_get_tile_z(ptRead, 0, 0, width, height, buf); pipe_put_tile_z(ptTex, 0, 0, width, height, buf); - _mesa_free(buf); + free(buf); } screen->tex_transfer_destroy(ptRead); diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 4638879fc2b..bfa8e21095c 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -102,14 +102,14 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, if(strb->software) { size_t size; - _mesa_free(strb->data); + free(strb->data); assert(strb->format != PIPE_FORMAT_NONE); strb->stride = util_format_get_stride(strb->format, width); size = util_format_get_2d_size(strb->format, strb->stride, height); - strb->data = _mesa_malloc(size); + strb->data = malloc(size); return strb->data != NULL; } @@ -181,8 +181,8 @@ st_renderbuffer_delete(struct gl_renderbuffer *rb) ASSERT(strb); pipe_surface_reference(&strb->surface, NULL); pipe_texture_reference(&strb->texture, NULL); - _mesa_free(strb->data); - _mesa_free(strb); + free(strb->data); + free(strb); } @@ -286,7 +286,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) default: _mesa_problem(NULL, "Unexpected format in st_new_renderbuffer_fb"); - _mesa_free(strb); + free(strb); return NULL; } diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c index dc40c5d269d..c66729b1244 100644 --- a/src/mesa/state_tracker/st_cb_queryobj.c +++ b/src/mesa/state_tracker/st_cb_queryobj.c @@ -69,7 +69,7 @@ st_DeleteQuery(GLcontext *ctx, struct gl_query_object *q) stq->pq = NULL; } - _mesa_free(stq); + free(stq); } diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c index 4692891c8aa..752b411b5fc 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/src/mesa/state_tracker/st_cb_rasterpos.c @@ -101,7 +101,7 @@ rastpos_line( struct draw_stage *stage, struct prim_header *prim ) static void rastpos_destroy(struct draw_stage *stage) { - _mesa_free(stage); + free(stage); } diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 13f050900a6..7e50e2ab2df 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1319,7 +1319,7 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, else { /* RGBA format */ GLfloat *tempSrc = - (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (tempSrc && texDest) { const GLint dims = 2; @@ -1359,7 +1359,7 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, } if (tempSrc) - _mesa_free(tempSrc); + free(tempSrc); } st_texture_image_unmap(ctx->st, stImage); diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 5b3987d73ae..de8beaf5e25 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -222,7 +222,7 @@ static void st_destroy_context_priv( struct st_context *st ) st->default_texture = NULL; } - _mesa_free( st ); + free( st ); } @@ -257,7 +257,7 @@ void st_destroy_context( struct st_context *st ) pipe->destroy( pipe ); - _mesa_free(ctx); + free(ctx); } diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 50e98d7146a..13b7b0e22d7 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -239,7 +239,7 @@ st_fb_orientation(const struct gl_framebuffer *fb) /** clear-alloc a struct-sized object, with casting */ -#define ST_CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T)) +#define ST_CALLOC_STRUCT(T) (struct T *) calloc(1, sizeof(struct T)) extern int diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 537a6a86482..807d21a7197 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -1055,7 +1055,7 @@ out: /** - * Tokens cannot be free with _mesa_free otherwise the builtin gallium + * Tokens cannot be free with free otherwise the builtin gallium * malloc debugging will get confused. */ void diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c index f73ac78ae26..753f3136f55 100644 --- a/src/mesa/swrast/s_blit.c +++ b/src/mesa/swrast/s_blit.c @@ -198,14 +198,14 @@ blit_nearest(GLcontext *ctx, } /* allocate the src/dst row buffers */ - srcBuffer = _mesa_malloc(pixelSize * srcWidth); + srcBuffer = malloc(pixelSize * srcWidth); if (!srcBuffer) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); return; } - dstBuffer = _mesa_malloc(pixelSize * dstWidth); + dstBuffer = malloc(pixelSize * dstWidth); if (!dstBuffer) { - _mesa_free(srcBuffer); + free(srcBuffer); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); return; } @@ -235,8 +235,8 @@ blit_nearest(GLcontext *ctx, drawRb->PutRow(ctx, drawRb, dstWidth, dstXpos, dstY, dstBuffer, NULL); } - _mesa_free(srcBuffer); - _mesa_free(dstBuffer); + free(srcBuffer); + free(dstBuffer); } @@ -366,21 +366,21 @@ blit_linear(GLcontext *ctx, /* Allocate the src/dst row buffers. * Keep two adjacent src rows around for bilinear sampling. */ - srcBuffer0 = _mesa_malloc(pixelSize * srcWidth); + srcBuffer0 = malloc(pixelSize * srcWidth); if (!srcBuffer0) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); return; } - srcBuffer1 = _mesa_malloc(pixelSize * srcWidth); + srcBuffer1 = malloc(pixelSize * srcWidth); if (!srcBuffer1) { - _mesa_free(srcBuffer0); + free(srcBuffer0); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); return; } - dstBuffer = _mesa_malloc(pixelSize * dstWidth); + dstBuffer = malloc(pixelSize * dstWidth); if (!dstBuffer) { - _mesa_free(srcBuffer0); - _mesa_free(srcBuffer1); + free(srcBuffer0); + free(srcBuffer1); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); return; } @@ -444,9 +444,9 @@ blit_linear(GLcontext *ctx, drawRb->PutRow(ctx, drawRb, dstWidth, dstXpos, dstY, dstBuffer, NULL); } - _mesa_free(srcBuffer0); - _mesa_free(srcBuffer1); - _mesa_free(dstBuffer); + free(srcBuffer0); + free(srcBuffer1); + free(dstBuffer); } @@ -535,7 +535,7 @@ simple_blit(GLcontext *ctx, } /* allocate the row buffer */ - rowBuffer = _mesa_malloc(bytesPerRow); + rowBuffer = malloc(bytesPerRow); if (!rowBuffer) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); return; @@ -548,7 +548,7 @@ simple_blit(GLcontext *ctx, dstY += yStep; } - _mesa_free(rowBuffer); + free(rowBuffer); } diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index b69be50f519..3f37c027e4a 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -114,14 +114,14 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, span.arrayAttribs = FRAG_BIT_COL0; /* allocate space for GLfloat image */ - tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + tmpImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!tmpImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); return; } - convImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + convImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!convImage) { - _mesa_free(tmpImage); + free(tmpImage); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); return; } @@ -150,7 +150,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, ASSERT(ctx->Pixel.Separable2DEnabled); _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage); } - _mesa_free(tmpImage); + free(tmpImage); /* do remaining post-convolution image transfer ops */ for (row = 0; row < height; row++) { @@ -185,7 +185,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, span.array->ChanType = CHAN_TYPE; } - _mesa_free(convImage); + free(convImage); } @@ -246,7 +246,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, span.arrayAttribs = FRAG_BIT_COL0; /* we'll fill in COL0 attrib values */ if (overlapping) { - tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4); + tmpImage = (GLfloat *) malloc(width * height * sizeof(GLfloat) * 4); if (!tmpImage) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); return; @@ -303,7 +303,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, span.array->ChanType = CHAN_TYPE; /* restore */ if (overlapping) - _mesa_free(tmpImage); + free(tmpImage); } @@ -352,7 +352,7 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, if (overlapping) { GLint ssy = sy; - tmpImage = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); + tmpImage = (GLuint *) malloc(width * height * sizeof(GLuint)); if (!tmpImage) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); return; @@ -397,7 +397,7 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, } if (overlapping) - _mesa_free(tmpImage); + free(tmpImage); } @@ -487,7 +487,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, if (overlapping) { GLint ssy = sy; - tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat)); + tmpImage = (GLfloat *) malloc(width * height * sizeof(GLfloat)); if (!tmpImage) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); return; @@ -537,7 +537,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, } if (overlapping) - _mesa_free(tmpImage); + free(tmpImage); } @@ -584,7 +584,7 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, if (overlapping) { GLint ssy = sy; - tmpImage = (GLstencil *) _mesa_malloc(width * height * sizeof(GLstencil)); + tmpImage = (GLstencil *) malloc(width * height * sizeof(GLstencil)); if (!tmpImage) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); return; @@ -626,7 +626,7 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, } if (overlapping) - _mesa_free(tmpImage); + free(tmpImage); } @@ -688,7 +688,7 @@ copy_depth_stencil_pixels(GLcontext *ctx, if (stencilMask != 0x0) { tempStencilImage - = (GLstencil *) _mesa_malloc(width * height * sizeof(GLstencil)); + = (GLstencil *) malloc(width * height * sizeof(GLstencil)); if (!tempStencilImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); return; @@ -706,10 +706,10 @@ copy_depth_stencil_pixels(GLcontext *ctx, if (ctx->Depth.Mask) { tempDepthImage - = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat)); + = (GLfloat *) malloc(width * height * sizeof(GLfloat)); if (!tempDepthImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); - _mesa_free(tempStencilImage); + free(tempStencilImage); return; } @@ -799,10 +799,10 @@ copy_depth_stencil_pixels(GLcontext *ctx, } if (tempStencilImage) - _mesa_free(tempStencilImage); + free(tempStencilImage); if (tempDepthImage) - _mesa_free(tempDepthImage); + free(tempDepthImage); } diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 136c296e98a..7571d5b8c0d 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -566,14 +566,14 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, GLint row; GLfloat *dest, *tmpImage; - tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + tmpImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!tmpImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); return; } - convImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + convImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!convImage) { - _mesa_free(tmpImage); + free(tmpImage); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); return; } @@ -597,7 +597,7 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, ASSERT(ctx->Pixel.Separable2DEnabled); _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage); } - _mesa_free(tmpImage); + free(tmpImage); /* continue transfer ops and draw the convolved image */ unpack = &ctx->DefaultPacking; @@ -677,7 +677,7 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, } if (convImage) { - _mesa_free(convImage); + free(convImage); } } diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 94fb974eab0..41911337b84 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -358,14 +358,14 @@ read_rgba_pixels( GLcontext *ctx, GLfloat *dest, *src, *tmpImage, *convImage; GLint row; - tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + tmpImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!tmpImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); return; } - convImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + convImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!convImage) { - _mesa_free(tmpImage); + free(tmpImage); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); return; } @@ -399,7 +399,7 @@ read_rgba_pixels( GLcontext *ctx, ASSERT(ctx->Pixel.Separable2DEnabled); _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage); } - _mesa_free(tmpImage); + free(tmpImage); /* finish transfer ops and pack the resulting image */ src = convImage; @@ -412,7 +412,7 @@ read_rgba_pixels( GLcontext *ctx, transferOps & IMAGE_POST_CONVOLUTION_BITS); src += width * 4; } - _mesa_free(convImage); + free(convImage); } else { /* no convolution */ diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 149f6937115..8a2787a139c 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -41,7 +41,7 @@ static GLubyte *get_space(GLcontext *ctx, GLuint bytes) { TNLcontext *tnl = TNL_CONTEXT(ctx); - GLubyte *space = _mesa_malloc(bytes); + GLubyte *space = malloc(bytes); tnl->block[tnl->nr_blocks++] = space; return space; @@ -53,7 +53,7 @@ static void free_space(GLcontext *ctx) TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint i; for (i = 0; i < tnl->nr_blocks; i++) - _mesa_free(tnl->block[i]); + free(tnl->block[i]); tnl->nr_blocks = 0; } diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c index 693d3dc118d..61ac4095733 100644 --- a/src/mesa/tnl/t_vb_normals.c +++ b/src/mesa/tnl/t_vb_normals.c @@ -152,7 +152,7 @@ alloc_normal_data(GLcontext *ctx, struct tnl_pipeline_stage *stage) TNLcontext *tnl = TNL_CONTEXT(ctx); struct normal_stage_data *store; - stage->privatePtr = _mesa_malloc(sizeof(*store)); + stage->privatePtr = malloc(sizeof(*store)); store = NORMAL_STAGE_DATA(stage); if (!store) return GL_FALSE; @@ -171,7 +171,7 @@ free_normal_data(struct tnl_pipeline_stage *stage) struct normal_stage_data *store = NORMAL_STAGE_DATA(stage); if (store) { _mesa_vector4f_free( &store->normal ); - _mesa_free( store ); + free( store ); stage->privatePtr = NULL; } } diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c index ab8ea60cf24..20634c80d1d 100644 --- a/src/mesa/tnl/t_vb_points.c +++ b/src/mesa/tnl/t_vb_points.c @@ -81,7 +81,7 @@ alloc_point_data(GLcontext *ctx, struct tnl_pipeline_stage *stage) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct point_stage_data *store; - stage->privatePtr = _mesa_malloc(sizeof(*store)); + stage->privatePtr = malloc(sizeof(*store)); store = POINT_STAGE_DATA(stage); if (!store) return GL_FALSE; @@ -97,7 +97,7 @@ free_point_data(struct tnl_pipeline_stage *stage) struct point_stage_data *store = POINT_STAGE_DATA(stage); if (store) { _mesa_vector4f_free( &store->PointSize ); - _mesa_free( store ); + free( store ); stage->privatePtr = NULL; } } diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index 2b8c962f063..ed66c35be79 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -88,7 +88,7 @@ void _tnl_register_fastpath( struct tnl_clipspace *vtx, fastpath->match_strides = match_strides; fastpath->func = vtx->emit; fastpath->attr = (struct tnl_attr_type *) - _mesa_malloc(vtx->attr_count * sizeof(fastpath->attr[0])); + malloc(vtx->attr_count * sizeof(fastpath->attr[0])); for (i = 0; i < vtx->attr_count; i++) { fastpath->attr[i].format = vtx->attr[i].format; diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index a284e4047f3..f2f1674b6a7 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -854,7 +854,7 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, return; } - prim = _mesa_calloc(primcount * sizeof(*prim)); + prim = calloc(1, primcount * sizeof(*prim)); if (prim == NULL) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMultiDrawElements"); return; @@ -960,7 +960,7 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, } } - _mesa_free(prim); + free(prim); } diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/vbo/vbo_rebase.c index 55a82ee369e..1db36de3de2 100644 --- a/src/mesa/vbo/vbo_rebase.c +++ b/src/mesa/vbo/vbo_rebase.c @@ -134,7 +134,7 @@ void vbo_rebase_prims( GLcontext *ctx, /* If we can just tell the hardware or the TNL to interpret our * indices with a different base, do so. */ - tmp_prims = (struct _mesa_prim *)_mesa_malloc(sizeof(*prim) * nr_prims); + tmp_prims = (struct _mesa_prim *)malloc(sizeof(*prim) * nr_prims); for (i = 0; i < nr_prims; i++) { tmp_prims[i] = prim[i]; @@ -187,7 +187,7 @@ void vbo_rebase_prims( GLcontext *ctx, else { /* Otherwise the primitives need adjustment. */ - tmp_prims = (struct _mesa_prim *)_mesa_malloc(sizeof(*prim) * nr_prims); + tmp_prims = (struct _mesa_prim *)malloc(sizeof(*prim) * nr_prims); for (i = 0; i < nr_prims; i++) { /* If this fails, it could indicate an application error: @@ -229,10 +229,10 @@ void vbo_rebase_prims( GLcontext *ctx, max_index - min_index ); if (tmp_indices) - _mesa_free(tmp_indices); + free(tmp_indices); if (tmp_prims) - _mesa_free(tmp_prims); + free(tmp_prims); } diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index 2ca111217ce..2fae267ff54 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -466,7 +466,7 @@ replay_init( struct copy_context *copy ) switch (copy->ib->type) { case GL_UNSIGNED_BYTE: - copy->translated_elt_buf = _mesa_malloc(sizeof(GLuint) * copy->ib->count); + copy->translated_elt_buf = malloc(sizeof(GLuint) * copy->ib->count); copy->srcelt = copy->translated_elt_buf; for (i = 0; i < copy->ib->count; i++) @@ -474,7 +474,7 @@ replay_init( struct copy_context *copy ) break; case GL_UNSIGNED_SHORT: - copy->translated_elt_buf = _mesa_malloc(sizeof(GLuint) * copy->ib->count); + copy->translated_elt_buf = malloc(sizeof(GLuint) * copy->ib->count); copy->srcelt = copy->translated_elt_buf; for (i = 0; i < copy->ib->count; i++) @@ -500,7 +500,7 @@ replay_init( struct copy_context *copy ) * * XXX: This should be a VBO! */ - copy->dstbuf = _mesa_malloc(copy->dstbuf_size * copy->vertex_size); + copy->dstbuf = malloc(copy->dstbuf_size * copy->vertex_size); copy->dstptr = copy->dstbuf; /* Setup new vertex arrays to point into the output buffer: @@ -529,7 +529,7 @@ replay_init( struct copy_context *copy ) copy->ib->count * 2 + 3); copy->dstelt_size = MIN2(copy->dstelt_size, copy->limits->max_indices); - copy->dstelt = _mesa_malloc(sizeof(GLuint) * copy->dstelt_size); + copy->dstelt = malloc(sizeof(GLuint) * copy->dstelt_size); copy->dstelt_nr = 0; /* Setup the new index buffer to point to the allocated element @@ -553,9 +553,9 @@ replay_finish( struct copy_context *copy ) /* Free our vertex and index buffers: */ - _mesa_free(copy->translated_elt_buf); - _mesa_free(copy->dstbuf); - _mesa_free(copy->dstelt); + free(copy->translated_elt_buf); + free(copy->dstbuf); + free(copy->dstelt); /* Unmap VBO's */ diff --git a/src/mesa/vf/vf.c b/src/mesa/vf/vf.c index 15a78c4c0af..dab436e2abe 100644 --- a/src/mesa/vf/vf.c +++ b/src/mesa/vf/vf.c @@ -86,7 +86,7 @@ void vf_register_fastpath( struct vertex_fetch *vf, fastpath->match_strides = match_strides; fastpath->func = vf->emit; fastpath->attr = (struct vf_attr_type *) - _mesa_malloc(vf->attr_count * sizeof(fastpath->attr[0])); + malloc(vf->attr_count * sizeof(fastpath->attr[0])); for (i = 0; i < vf->attr_count; i++) { fastpath->attr[i].format = vf->attr[i].format; -- cgit v1.2.3 From 298be2b028263b2c343a707662c6fbfa18293cb2 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 19 Feb 2010 12:32:24 -0500 Subject: Replace the _mesa_*printf() wrappers with the plain libc versions --- src/gallium/auxiliary/util/u_gen_mipmap.c | 2 +- src/gallium/drivers/cell/spu/spu_tri.c | 2 +- src/gallium/state_trackers/glx/xlib/glx_api.c | 8 +- src/gallium/state_trackers/glx/xlib/xm_api.c | 8 +- src/mesa/drivers/common/meta.c | 6 +- src/mesa/drivers/dri/i915/i915_context.c | 2 +- src/mesa/drivers/dri/i915/i915_debug.c | 178 ++++++------ src/mesa/drivers/dri/i915/i915_debug_fp.c | 80 +++--- src/mesa/drivers/dri/i915/i915_tex_layout.c | 4 +- src/mesa/drivers/dri/i915/intel_tris.c | 8 +- src/mesa/drivers/dri/i965/brw_context.c | 4 +- src/mesa/drivers/dri/i965/brw_curbe.c | 26 +- src/mesa/drivers/dri/i965/brw_draw.c | 4 +- src/mesa/drivers/dri/i965/brw_draw_upload.c | 4 +- src/mesa/drivers/dri/i965/brw_eu_debug.c | 14 +- src/mesa/drivers/dri/i965/brw_eu_emit.c | 4 +- src/mesa/drivers/dri/i965/brw_state_cache.c | 10 +- src/mesa/drivers/dri/i965/brw_urb.c | 6 +- src/mesa/drivers/dri/i965/brw_vs_emit.c | 14 +- src/mesa/drivers/dri/i965/brw_wm_debug.c | 68 ++--- src/mesa/drivers/dri/i965/brw_wm_emit.c | 12 +- src/mesa/drivers/dri/i965/brw_wm_fp.c | 14 +- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 10 +- src/mesa/drivers/dri/i965/brw_wm_pass0.c | 4 +- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 4 +- src/mesa/drivers/dri/intel/intel_context.c | 2 +- src/mesa/drivers/dri/intel/intel_context.h | 2 +- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 4 +- src/mesa/drivers/dri/intel/intel_pixel_read.c | 14 +- src/mesa/drivers/dri/intel/intel_tex.c | 4 +- src/mesa/drivers/dri/nouveau/nouveau_driver.h | 2 +- src/mesa/drivers/dri/r300/r300_fragprog_common.c | 2 +- src/mesa/drivers/dri/r300/r300_render.c | 2 +- src/mesa/drivers/dri/r300/r300_state.c | 2 +- src/mesa/drivers/dri/r600/r700_state.c | 2 +- src/mesa/drivers/dri/radeon/radeon_fbo.c | 2 +- src/mesa/drivers/dri/swrast/swrast_priv.h | 4 +- src/mesa/drivers/x11/fakeglx.c | 10 +- src/mesa/drivers/x11/xm_api.c | 12 +- src/mesa/drivers/x11/xm_tri.c | 92 +++---- src/mesa/glapi/gl_enums.py | 2 +- src/mesa/main/arrayobj.c | 10 +- src/mesa/main/bufferobj.c | 8 +- src/mesa/main/debug.c | 56 ++-- src/mesa/main/dlist.c | 130 ++++----- src/mesa/main/enums.c | 2 +- src/mesa/main/execmem.c | 2 +- src/mesa/main/fbobject.c | 50 ++-- src/mesa/main/ffvertex_prog.c | 8 +- src/mesa/main/imports.c | 67 +---- src/mesa/main/imports.h | 16 -- src/mesa/main/mipmap.c | 2 +- src/mesa/main/shaders.c | 2 +- src/mesa/main/state.c | 2 +- src/mesa/main/texenvprogram.c | 2 +- src/mesa/main/teximage.c | 4 +- src/mesa/main/texobj.c | 6 +- src/mesa/main/texstate.c | 38 +-- src/mesa/main/texstore.c | 20 +- src/mesa/main/varray.c | 18 +- src/mesa/main/version.c | 4 +- src/mesa/math/m_debug_clip.c | 44 +-- src/mesa/math/m_debug_norm.c | 34 +-- src/mesa/math/m_debug_xform.c | 32 +-- src/mesa/math/m_vector.c | 16 +- src/mesa/shader/arbprogparse.c | 4 +- src/mesa/shader/nvfragparse.c | 6 +- src/mesa/shader/nvvertparse.c | 6 +- src/mesa/shader/prog_execute.c | 4 +- src/mesa/shader/prog_instruction.c | 2 +- src/mesa/shader/prog_optimize.c | 62 ++--- src/mesa/shader/prog_print.c | 330 +++++++++++------------ src/mesa/shader/prog_statevars.c | 6 +- src/mesa/shader/program_parse.tab.c | 6 +- src/mesa/shader/program_parse.y | 6 +- src/mesa/shader/shader_api.c | 36 +-- src/mesa/shader/slang/slang_codegen.c | 4 +- src/mesa/shader/slang/slang_emit.c | 4 +- src/mesa/shader/slang/slang_label.c | 2 +- src/mesa/shader/slang/slang_link.c | 26 +- src/mesa/shader/slang/slang_log.c | 6 +- src/mesa/shader/slang/slang_utility.c | 2 +- src/mesa/state_tracker/st_atom.c | 10 +- src/mesa/swrast/s_lines.c | 2 +- src/mesa/tnl/t_draw.c | 10 +- src/mesa/tnl/t_vb_cliptmp.h | 16 +- src/mesa/tnl/t_vertex.c | 10 +- src/mesa/tnl/t_vertex_sse.c | 8 +- src/mesa/vbo/vbo_exec_api.c | 6 +- src/mesa/vbo/vbo_exec_array.c | 70 ++--- src/mesa/vbo/vbo_exec_draw.c | 32 +-- src/mesa/vbo/vbo_rebase.c | 2 +- src/mesa/vbo/vbo_save_api.c | 8 +- src/mesa/vbo/vbo_save_draw.c | 2 +- src/mesa/vbo/vbo_save_loopback.c | 12 +- src/mesa/vbo/vbo_split_copy.c | 36 +-- src/mesa/vf/vf.c | 10 +- src/mesa/vf/vf_sse.c | 8 +- src/mesa/x86/rtasm/x86sse.c | 2 +- 99 files changed, 951 insertions(+), 1032 deletions(-) (limited to 'src/mesa/shader/nvfragparse.c') diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index 4e358d3938c..1d7329d422b 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -1069,7 +1069,7 @@ reduce_3d(enum pipe_format pformat, */ /* - _mesa_printf("mip3d %d x %d x %d -> %d x %d x %d\n", + printf("mip3d %d x %d x %d -> %d x %d x %d\n", srcWidth, srcHeight, srcDepth, dstWidth, dstHeight, dstDepth); */ diff --git a/src/gallium/drivers/cell/spu/spu_tri.c b/src/gallium/drivers/cell/spu/spu_tri.c index 58be001be4c..f619380d807 100644 --- a/src/gallium/drivers/cell/spu/spu_tri.c +++ b/src/gallium/drivers/cell/spu/spu_tri.c @@ -752,7 +752,7 @@ subtriangle(struct edge *eleft, struct edge *eright, unsigned lines) finish_y -= sy; /* - _mesa_printf("%s %d %d\n", __FUNCTION__, start_y, finish_y); + printf("%s %d %d\n", __FUNCTION__, start_y, finish_y); */ for (y = start_y; y < finish_y; y++) { diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index 0932569bd3e..656a69131e9 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -1679,8 +1679,8 @@ PUBLIC const char * glXQueryServerString( Display *dpy, int screen, int name ) { static char version[1000]; - _mesa_sprintf(version, "%d.%d %s", - SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION); + sprintf(version, "%d.%d %s", + SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION); (void) dpy; (void) screen; @@ -1704,8 +1704,8 @@ PUBLIC const char * glXGetClientString( Display *dpy, int name ) { static char version[1000]; - _mesa_sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION, - CLIENT_MINOR_VERSION, MESA_GLX_VERSION); + sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION, + CLIENT_MINOR_VERSION, MESA_GLX_VERSION); (void) dpy; diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 61af6634364..a274da0c62f 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -550,10 +550,10 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, * reports bugs. */ if (_mesa_getenv("MESA_INFO")) { - _mesa_printf("X/Mesa visual = %p\n", (void *) v); - _mesa_printf("X/Mesa level = %d\n", v->mesa_visual.level); - _mesa_printf("X/Mesa depth = %d\n", v->visinfo->depth); - _mesa_printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel); + printf("X/Mesa visual = %p\n", (void *) v); + printf("X/Mesa level = %d\n", v->mesa_visual.level); + printf("X/Mesa depth = %d\n", v->visinfo->depth); + printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel); } if (b && window) { diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 42ab7d4ed60..3aa70ddbf04 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -1047,7 +1047,7 @@ init_blit_depth_pixels(GLcontext *ctx) texTarget = "RECT"; else texTarget = "2D"; - _mesa_snprintf(program2, sizeof(program2), program, texTarget); + snprintf(program2, sizeof(program2), program, texTarget); _mesa_GenPrograms(1, &blit->DepthFP); _mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, blit->DepthFP); @@ -1670,7 +1670,7 @@ init_draw_stencil_pixels(GLcontext *ctx) texTarget = "RECT"; else texTarget = "2D"; - _mesa_snprintf(program2, sizeof(program2), program, texTarget); + snprintf(program2, sizeof(program2), program, texTarget); _mesa_GenPrograms(1, &drawpix->StencilFP); _mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, drawpix->StencilFP); @@ -1704,7 +1704,7 @@ init_draw_depth_pixels(GLcontext *ctx) texTarget = "RECT"; else texTarget = "2D"; - _mesa_snprintf(program2, sizeof(program2), program, texTarget); + snprintf(program2, sizeof(program2), program, texTarget); _mesa_GenPrograms(1, &drawpix->DepthFP); _mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, drawpix->DepthFP); diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index ed9a44ff246..4d86aae87d9 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -108,7 +108,7 @@ i915CreateContext(const __GLcontextModes * mesaVis, return GL_FALSE; if (0) - _mesa_printf("\ntexmem-0-3 branch\n\n"); + printf("\ntexmem-0-3 branch\n\n"); i915InitVtbl(i915); diff --git a/src/mesa/drivers/dri/i915/i915_debug.c b/src/mesa/drivers/dri/i915/i915_debug.c index fecfac30339..4569fb918ea 100644 --- a/src/mesa/drivers/dri/i915/i915_debug.c +++ b/src/mesa/drivers/dri/i915/i915_debug.c @@ -31,27 +31,25 @@ #include "i915_context.h" #include "i915_debug.h" -#define PRINTF( ... ) _mesa_printf( __VA_ARGS__ ) - static GLboolean debug( struct debug_stream *stream, const char *name, GLuint len ) { GLuint i; GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); if (len == 0) { - PRINTF("Error - zero length packet (0x%08x)\n", stream->ptr[0]); + printf("Error - zero length packet (0x%08x)\n", stream->ptr[0]); assert(0); return GL_FALSE; } if (stream->print_addresses) - PRINTF("%08x: ", stream->offset); + printf("%08x: ", stream->offset); - PRINTF("%s (%d dwords):\n", name, len); + printf("%s (%d dwords):\n", name, len); for (i = 0; i < len; i++) - PRINTF("\t0x%08x\n", ptr[i]); - PRINTF("\n"); + printf("\t0x%08x\n", ptr[i]); + printf("\n"); stream->offset += len * sizeof(GLuint); @@ -88,17 +86,17 @@ static GLboolean debug_prim( struct debug_stream *stream, const char *name, - PRINTF("%s %s (%d dwords):\n", name, prim, len); - PRINTF("\t0x%08x\n", ptr[0]); + printf("%s %s (%d dwords):\n", name, prim, len); + printf("\t0x%08x\n", ptr[0]); for (i = 1; i < len; i++) { if (dump_floats) - PRINTF("\t0x%08x // %f\n", ptr[i], *(GLfloat *)&ptr[i]); + printf("\t0x%08x // %f\n", ptr[i], *(GLfloat *)&ptr[i]); else - PRINTF("\t0x%08x\n", ptr[i]); + printf("\t0x%08x\n", ptr[i]); } - PRINTF("\n"); + printf("\n"); stream->offset += len * sizeof(GLuint); @@ -113,15 +111,15 @@ static GLboolean debug_program( struct debug_stream *stream, const char *name, G GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); if (len == 0) { - PRINTF("Error - zero length packet (0x%08x)\n", stream->ptr[0]); + printf("Error - zero length packet (0x%08x)\n", stream->ptr[0]); assert(0); return GL_FALSE; } if (stream->print_addresses) - PRINTF("%08x: ", stream->offset); + printf("%08x: ", stream->offset); - PRINTF("%s (%d dwords):\n", name, len); + printf("%s (%d dwords):\n", name, len); i915_disassemble_program( ptr, len ); stream->offset += len * sizeof(GLuint); @@ -135,17 +133,17 @@ static GLboolean debug_chain( struct debug_stream *stream, const char *name, GLu GLuint old_offset = stream->offset + len * sizeof(GLuint); GLuint i; - PRINTF("%s (%d dwords):\n", name, len); + printf("%s (%d dwords):\n", name, len); for (i = 0; i < len; i++) - PRINTF("\t0x%08x\n", ptr[i]); + printf("\t0x%08x\n", ptr[i]); stream->offset = ptr[1] & ~0x3; if (stream->offset < old_offset) - PRINTF("\n... skipping backwards from 0x%x --> 0x%x ...\n\n", + printf("\n... skipping backwards from 0x%x --> 0x%x ...\n\n", old_offset, stream->offset ); else - PRINTF("\n... skipping from 0x%x --> 0x%x ...\n\n", + printf("\n... skipping from 0x%x --> 0x%x ...\n\n", old_offset, stream->offset ); @@ -165,10 +163,10 @@ static GLboolean debug_variable_length_prim( struct debug_stream *stream ) len = 1+(i+2)/2; - PRINTF("3DPRIM, %s variable length %d indicies (%d dwords):\n", prim, i, len); + printf("3DPRIM, %s variable length %d indicies (%d dwords):\n", prim, i, len); for (i = 0; i < len; i++) - PRINTF("\t0x%08x\n", ptr[i]); - PRINTF("\n"); + printf("\t0x%08x\n", ptr[i]); + printf("\n"); stream->offset += len * sizeof(GLuint); return GL_TRUE; @@ -178,9 +176,9 @@ static GLboolean debug_variable_length_prim( struct debug_stream *stream ) #define BITS( dw, hi, lo, ... ) \ do { \ unsigned himask = 0xffffffffU >> (31 - (hi)); \ - PRINTF("\t\t "); \ - PRINTF(__VA_ARGS__); \ - PRINTF(": 0x%x\n", ((dw) & himask) >> (lo)); \ + printf("\t\t "); \ + printf(__VA_ARGS__); \ + printf(": 0x%x\n", ((dw) & himask) >> (lo)); \ } while (0) #define MBZ( dw, hi, lo) do { \ @@ -194,9 +192,9 @@ do { \ #define FLAG( dw, bit, ... ) \ do { \ if (((dw) >> (bit)) & 1) { \ - PRINTF("\t\t "); \ - PRINTF(__VA_ARGS__); \ - PRINTF("\n"); \ + printf("\t\t "); \ + printf(__VA_ARGS__); \ + printf("\n"); \ } \ } while (0) @@ -208,17 +206,17 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, GLuint bits = (ptr[0] >> 4) & 0xff; GLuint j = 0; - PRINTF("%s (%d dwords, flags: %x):\n", name, len, bits); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords, flags: %x):\n", name, len, bits); + printf("\t0x%08x\n", ptr[j++]); if (bits & (1<<0)) { - PRINTF("\t LIS0: 0x%08x\n", ptr[j]); - PRINTF("\t vb address: 0x%08x\n", (ptr[j] & ~0x3)); + printf("\t LIS0: 0x%08x\n", ptr[j]); + printf("\t vb address: 0x%08x\n", (ptr[j] & ~0x3)); BITS(ptr[j], 0, 0, "vb invalidate disable"); j++; } if (bits & (1<<1)) { - PRINTF("\t LIS1: 0x%08x\n", ptr[j]); + printf("\t LIS1: 0x%08x\n", ptr[j]); BITS(ptr[j], 29, 24, "vb dword width"); BITS(ptr[j], 21, 16, "vb dword pitch"); BITS(ptr[j], 15, 0, "vb max index"); @@ -226,7 +224,7 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, } if (bits & (1<<2)) { int i; - PRINTF("\t LIS2: 0x%08x\n", ptr[j]); + printf("\t LIS2: 0x%08x\n", ptr[j]); for (i = 0; i < 8; i++) { unsigned tc = (ptr[j] >> (i * 4)) & 0xf; if (tc != 0xf) @@ -235,11 +233,11 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, j++; } if (bits & (1<<3)) { - PRINTF("\t LIS3: 0x%08x\n", ptr[j]); + printf("\t LIS3: 0x%08x\n", ptr[j]); j++; } if (bits & (1<<4)) { - PRINTF("\t LIS4: 0x%08x\n", ptr[j]); + printf("\t LIS4: 0x%08x\n", ptr[j]); BITS(ptr[j], 31, 23, "point width"); BITS(ptr[j], 22, 19, "line width"); FLAG(ptr[j], 18, "alpha flatshade"); @@ -261,7 +259,7 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, j++; } if (bits & (1<<5)) { - PRINTF("\t LIS5: 0x%08x\n", ptr[j]); + printf("\t LIS5: 0x%08x\n", ptr[j]); BITS(ptr[j], 31, 28, "rgba write disables"); FLAG(ptr[j], 27, "force dflt point width"); FLAG(ptr[j], 26, "last pixel enable"); @@ -279,7 +277,7 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, j++; } if (bits & (1<<6)) { - PRINTF("\t LIS6: 0x%08x\n", ptr[j]); + printf("\t LIS6: 0x%08x\n", ptr[j]); FLAG(ptr[j], 31, "alpha test enable"); BITS(ptr[j], 30, 28, "alpha func"); BITS(ptr[j], 27, 20, "alpha ref"); @@ -296,7 +294,7 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, } - PRINTF("\n"); + printf("\n"); assert(j == len); @@ -315,34 +313,34 @@ static GLboolean debug_load_indirect( struct debug_stream *stream, GLuint bits = (ptr[0] >> 8) & 0x3f; GLuint i, j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); for (i = 0; i < 6; i++) { if (bits & (1<ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); BR13(stream, ptr[j++]); BR2223(stream, ptr[j], ptr[j+1]); @@ -460,8 +458,8 @@ static GLboolean debug_color_blit( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); BR13(stream, ptr[j++]); BR2223(stream, ptr[j], ptr[j+1]); @@ -481,8 +479,8 @@ static GLboolean debug_modes4( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j]); BITS(ptr[j], 21, 18, "logicop func"); FLAG(ptr[j], 17, "stencil test mask modify-enable"); FLAG(ptr[j], 16, "stencil write mask modify-enable"); @@ -502,26 +500,26 @@ static GLboolean debug_map_state( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); { - PRINTF("\t0x%08x\n", ptr[j]); + printf("\t0x%08x\n", ptr[j]); BITS(ptr[j], 15, 0, "map mask"); j++; } while (j < len) { { - PRINTF("\t TMn.0: 0x%08x\n", ptr[j]); - PRINTF("\t map address: 0x%08x\n", (ptr[j] & ~0x3)); + printf("\t TMn.0: 0x%08x\n", ptr[j]); + printf("\t map address: 0x%08x\n", (ptr[j] & ~0x3)); FLAG(ptr[j], 1, "vertical line stride"); FLAG(ptr[j], 0, "vertical line stride offset"); j++; } { - PRINTF("\t TMn.1: 0x%08x\n", ptr[j]); + printf("\t TMn.1: 0x%08x\n", ptr[j]); BITS(ptr[j], 31, 21, "height"); BITS(ptr[j], 20, 10, "width"); BITS(ptr[j], 9, 7, "surface format"); @@ -532,7 +530,7 @@ static GLboolean debug_map_state( struct debug_stream *stream, j++; } { - PRINTF("\t TMn.2: 0x%08x\n", ptr[j]); + printf("\t TMn.2: 0x%08x\n", ptr[j]); BITS(ptr[j], 31, 21, "dword pitch"); BITS(ptr[j], 20, 15, "cube face enables"); BITS(ptr[j], 14, 9, "max lod"); @@ -554,18 +552,18 @@ static GLboolean debug_sampler_state( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); { - PRINTF("\t0x%08x\n", ptr[j]); + printf("\t0x%08x\n", ptr[j]); BITS(ptr[j], 15, 0, "sampler mask"); j++; } while (j < len) { { - PRINTF("\t TSn.0: 0x%08x\n", ptr[j]); + printf("\t TSn.0: 0x%08x\n", ptr[j]); FLAG(ptr[j], 31, "reverse gamma"); FLAG(ptr[j], 30, "planar to packed"); FLAG(ptr[j], 29, "yuv->rgb"); @@ -582,7 +580,7 @@ static GLboolean debug_sampler_state( struct debug_stream *stream, } { - PRINTF("\t TSn.1: 0x%08x\n", ptr[j]); + printf("\t TSn.1: 0x%08x\n", ptr[j]); BITS(ptr[j], 31, 24, "min lod"); MBZ( ptr[j], 23, 18 ); FLAG(ptr[j], 17, "kill pixel enable"); @@ -597,7 +595,7 @@ static GLboolean debug_sampler_state( struct debug_stream *stream, j++; } { - PRINTF("\t TSn.2: 0x%08x (default color)\n", ptr[j]); + printf("\t TSn.2: 0x%08x (default color)\n", ptr[j]); j++; } } @@ -614,11 +612,11 @@ static GLboolean debug_dest_vars( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); { - PRINTF("\t0x%08x\n", ptr[j]); + printf("\t0x%08x\n", ptr[j]); FLAG(ptr[j], 31, "early classic ztest"); FLAG(ptr[j], 30, "opengl tex default color"); FLAG(ptr[j], 29, "bypass iz"); @@ -649,11 +647,11 @@ static GLboolean debug_buf_info( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); { - PRINTF("\t0x%08x\n", ptr[j]); + printf("\t0x%08x\n", ptr[j]); BITS(ptr[j], 28, 28, "aux buffer id"); BITS(ptr[j], 27, 24, "buffer id (7=depth, 3=back)"); FLAG(ptr[j], 23, "use fence regs"); @@ -665,7 +663,7 @@ static GLboolean debug_buf_info( struct debug_stream *stream, j++; } - PRINTF("\t0x%08x -- buffer base address\n", ptr[j++]); + printf("\t0x%08x -- buffer base address\n", ptr[j++]); stream->offset += len * sizeof(GLuint); assert(j == len); @@ -826,7 +824,7 @@ i915_dump_batchbuffer( GLuint *start, GLuint bytes = (end - start) * 4; GLboolean done = GL_FALSE; - PRINTF("\n\nBATCH: (%d)\n", bytes / 4); + printf("\n\nBATCH: (%d)\n", bytes / 4); stream.offset = 0; stream.ptr = (char *)start; @@ -843,7 +841,7 @@ i915_dump_batchbuffer( GLuint *start, stream.offset >= 0); } - PRINTF("END-BATCH\n\n\n"); + printf("END-BATCH\n\n\n"); } diff --git a/src/mesa/drivers/dri/i915/i915_debug_fp.c b/src/mesa/drivers/dri/i915/i915_debug_fp.c index bf500e54fa2..adfc9e89454 100644 --- a/src/mesa/drivers/dri/i915/i915_debug_fp.c +++ b/src/mesa/drivers/dri/i915/i915_debug_fp.c @@ -31,8 +31,6 @@ #include "i915_debug.h" #include "main/imports.h" -#define PRINTF( ... ) _mesa_printf( __VA_ARGS__ ) - static const char *opcodes[0x20] = { "NOP", "ADD", @@ -123,27 +121,27 @@ print_reg_type_nr(GLuint type, GLuint nr) case REG_TYPE_T: switch (nr) { case T_DIFFUSE: - PRINTF("T_DIFFUSE"); + printf("T_DIFFUSE"); return; case T_SPECULAR: - PRINTF("T_SPECULAR"); + printf("T_SPECULAR"); return; case T_FOG_W: - PRINTF("T_FOG_W"); + printf("T_FOG_W"); return; default: - PRINTF("T_TEX%d", nr); + printf("T_TEX%d", nr); return; } case REG_TYPE_OC: if (nr == 0) { - PRINTF("oC"); + printf("oC"); return; } break; case REG_TYPE_OD: if (nr == 0) { - PRINTF("oD"); + printf("oD"); return; } break; @@ -151,7 +149,7 @@ print_reg_type_nr(GLuint type, GLuint nr) break; } - PRINTF("%s[%d]", regname[type], nr); + printf("%s[%d]", regname[type], nr); } #define REG_SWIZZLE_MASK 0x7777 @@ -172,33 +170,33 @@ print_reg_neg_swizzle(GLuint reg) (reg & REG_NEGATE_MASK) == 0) return; - PRINTF("."); + printf("."); for (i = 3; i >= 0; i--) { if (reg & (1 << ((i * 4) + 3))) - PRINTF("-"); + printf("-"); switch ((reg >> (i * 4)) & 0x7) { case 0: - PRINTF("x"); + printf("x"); break; case 1: - PRINTF("y"); + printf("y"); break; case 2: - PRINTF("z"); + printf("z"); break; case 3: - PRINTF("w"); + printf("w"); break; case 4: - PRINTF("0"); + printf("0"); break; case 5: - PRINTF("1"); + printf("1"); break; default: - PRINTF("?"); + printf("?"); break; } } @@ -223,15 +221,15 @@ print_dest_reg(GLuint dword) print_reg_type_nr(type, nr); if ((dword & A0_DEST_CHANNEL_ALL) == A0_DEST_CHANNEL_ALL) return; - PRINTF("."); + printf("."); if (dword & A0_DEST_CHANNEL_X) - PRINTF("x"); + printf("x"); if (dword & A0_DEST_CHANNEL_Y) - PRINTF("y"); + printf("y"); if (dword & A0_DEST_CHANNEL_Z) - PRINTF("z"); + printf("z"); if (dword & A0_DEST_CHANNEL_W) - PRINTF("w"); + printf("w"); } @@ -246,29 +244,29 @@ print_arith_op(GLuint opcode, const GLuint * program) if (opcode != A0_NOP) { print_dest_reg(program[0]); if (program[0] & A0_DEST_SATURATE) - PRINTF(" = SATURATE "); + printf(" = SATURATE "); else - PRINTF(" = "); + printf(" = "); } - PRINTF("%s ", opcodes[opcode]); + printf("%s ", opcodes[opcode]); print_src_reg(GET_SRC0_REG(program[0], program[1])); if (args[opcode] == 1) { - PRINTF("\n"); + printf("\n"); return; } - PRINTF(", "); + printf(", "); print_src_reg(GET_SRC1_REG(program[1], program[2])); if (args[opcode] == 2) { - PRINTF("\n"); + printf("\n"); return; } - PRINTF(", "); + printf(", "); print_src_reg(GET_SRC2_REG(program[2])); - PRINTF("\n"); + printf("\n"); return; } @@ -277,24 +275,24 @@ static void print_tex_op(GLuint opcode, const GLuint * program) { print_dest_reg(program[0] | A0_DEST_CHANNEL_ALL); - PRINTF(" = "); + printf(" = "); - PRINTF("%s ", opcodes[opcode]); + printf("%s ", opcodes[opcode]); - PRINTF("S[%d],", program[0] & T0_SAMPLER_NR_MASK); + printf("S[%d],", program[0] & T0_SAMPLER_NR_MASK); print_reg_type_nr((program[1] >> T1_ADDRESS_REG_TYPE_SHIFT) & REG_TYPE_MASK, (program[1] >> T1_ADDRESS_REG_NR_SHIFT) & REG_NR_MASK); - PRINTF("\n"); + printf("\n"); } static void print_dcl_op(GLuint opcode, const GLuint * program) { - PRINTF("%s ", opcodes[opcode]); + printf("%s ", opcodes[opcode]); print_dest_reg(program[0] | A0_DEST_CHANNEL_ALL); - PRINTF("\n"); + printf("\n"); } @@ -304,7 +302,7 @@ i915_disassemble_program(const GLuint * program, GLuint sz) GLuint size = program[0] & 0x1ff; GLint i; - PRINTF("\t\tBEGIN\n"); + printf("\t\tBEGIN\n"); assert(size + 2 == sz); @@ -312,7 +310,7 @@ i915_disassemble_program(const GLuint * program, GLuint sz) for (i = 1; i < sz; i += 3, program += 3) { GLuint opcode = program[0] & (0x1f << 24); - PRINTF("\t\t"); + printf("\t\t"); if ((GLint) opcode >= A0_NOP && opcode <= A0_SLT) print_arith_op(opcode >> 24, program); @@ -321,10 +319,10 @@ i915_disassemble_program(const GLuint * program, GLuint sz) else if (opcode == D0_DCL) print_dcl_op(opcode >> 24, program); else - PRINTF("Unknown opcode 0x%x\n", opcode); + printf("Unknown opcode 0x%x\n", opcode); } - PRINTF("\t\tEND\n\n"); + printf("\t\tEND\n\n"); } diff --git a/src/mesa/drivers/dri/i915/i915_tex_layout.c b/src/mesa/drivers/dri/i915/i915_tex_layout.c index d9588e5b56d..fe3908f580a 100644 --- a/src/mesa/drivers/dri/i915/i915_tex_layout.c +++ b/src/mesa/drivers/dri/i915/i915_tex_layout.c @@ -145,8 +145,8 @@ i915_miptree_layout_cube(struct intel_context *intel, intel_miptree_set_image_offset(mt, level, face, x, y); if (d == 0) - _mesa_printf("cube mipmap %d/%d (%d..%d) is 0x0\n", - face, level, mt->first_level, mt->last_level); + printf("cube mipmap %d/%d (%d..%d) is 0x0\n", + face, level, mt->first_level, mt->last_level); d >>= 1; x += step_offsets[face][0] * d; diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index 6d498c56542..3816adae942 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -66,7 +66,7 @@ intel_flush_inline_primitive(struct intel_context *intel) assert(intel->prim.primitive != ~0); -/* _mesa_printf("/\n"); */ +/* printf("/\n"); */ if (used < 8) goto do_discard; @@ -93,7 +93,7 @@ static void intel_start_inline(struct intel_context *intel, uint32_t prim) intel->no_batch_wrap = GL_TRUE; - /*_mesa_printf("%s *", __progname);*/ + /*printf("%s *", __progname);*/ /* Emit a slot which will be filled with the inline primitive * command later. @@ -111,7 +111,7 @@ static void intel_start_inline(struct intel_context *intel, uint32_t prim) ADVANCE_BATCH(); intel->no_batch_wrap = GL_FALSE; -/* _mesa_printf(">"); */ +/* printf(">"); */ } static void intel_wrap_inline(struct intel_context *intel) @@ -133,7 +133,7 @@ static GLuint *intel_extend_inline(struct intel_context *intel, GLuint dwords) if (intel_batchbuffer_space(intel->batch) < sz) intel_wrap_inline(intel); -/* _mesa_printf("."); */ +/* printf("."); */ intel->vtbl.assert_not_dirty(intel); diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 65f51be3410..2ca29b7ae11 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -78,7 +78,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, GLcontext *ctx = &intel->ctx; if (!brw) { - _mesa_printf("%s: failed to alloc context\n", __FUNCTION__); + printf("%s: failed to alloc context\n", __FUNCTION__); return GL_FALSE; } @@ -87,7 +87,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, if (!intelInitContext( intel, mesaVis, driContextPriv, sharedContextPrivate, &functions )) { - _mesa_printf("%s: failed to init intel context\n", __FUNCTION__); + printf("%s: failed to init intel context\n", __FUNCTION__); FREE(brw); return GL_FALSE; } diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index cb9cd836a07..6f2ead793d2 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -114,13 +114,13 @@ static void calculate_curbe_offsets( struct brw_context *brw ) brw->curbe.total_size = reg; if (0) - _mesa_printf("curbe wm %d+%d clip %d+%d vs %d+%d\n", - brw->curbe.wm_start, - brw->curbe.wm_size, - brw->curbe.clip_start, - brw->curbe.clip_size, - brw->curbe.vs_start, - brw->curbe.vs_size ); + printf("curbe wm %d+%d clip %d+%d vs %d+%d\n", + brw->curbe.wm_start, + brw->curbe.wm_size, + brw->curbe.clip_start, + brw->curbe.clip_size, + brw->curbe.vs_start, + brw->curbe.vs_size ); brw->state.dirty.brw |= BRW_NEW_CURBE_OFFSETS; } @@ -280,13 +280,13 @@ static void prepare_constant_buffer(struct brw_context *brw) if (0) { for (i = 0; i < sz*16; i+=4) - _mesa_printf("curbe %d.%d: %f %f %f %f\n", i/8, i&4, - buf[i+0], buf[i+1], buf[i+2], buf[i+3]); + printf("curbe %d.%d: %f %f %f %f\n", i/8, i&4, + buf[i+0], buf[i+1], buf[i+2], buf[i+3]); - _mesa_printf("last_buf %p buf %p sz %d/%d cmp %d\n", - brw->curbe.last_buf, buf, - bufsz, brw->curbe.last_bufsz, - brw->curbe.last_buf ? memcmp(buf, brw->curbe.last_buf, bufsz) : -1); + printf("last_buf %p buf %p sz %d/%d cmp %d\n", + brw->curbe.last_buf, buf, + bufsz, brw->curbe.last_bufsz, + brw->curbe.last_buf ? memcmp(buf, brw->curbe.last_buf, bufsz) : -1); } if (brw->curbe.curbe_bo != NULL && diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 976249091e9..e348d4686b1 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -82,7 +82,7 @@ static GLuint brw_set_prim(struct brw_context *brw, GLenum prim) GLcontext *ctx = &brw->intel.ctx; if (INTEL_DEBUG & DEBUG_PRIMS) - _mesa_printf("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim)); + printf("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim)); /* Slight optimization to avoid the GS program when not needed: */ @@ -125,7 +125,7 @@ static void brw_emit_prim(struct brw_context *brw, struct intel_context *intel = &brw->intel; if (INTEL_DEBUG & DEBUG_PRIMS) - _mesa_printf("PRIM: %s %d %d\n", _mesa_lookup_enum_by_nr(prim->mode), + printf("PRIM: %s %d %d\n", _mesa_lookup_enum_by_nr(prim->mode), prim->start, prim->count); prim_packet.header.opcode = CMD_3D_PRIM; diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index ceaeb923b05..106454de4a8 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -169,7 +169,7 @@ static GLuint get_surface_type( GLenum type, GLuint size, GLenum format, GLboolean normalized ) { if (INTEL_DEBUG & DEBUG_VERTS) - _mesa_printf("type %s size %d normalized %d\n", + printf("type %s size %d normalized %d\n", _mesa_lookup_enum_by_nr(type), size, normalized); if (normalized) { @@ -355,7 +355,7 @@ static void brw_prepare_vertices(struct brw_context *brw) /* First build an array of pointers to ve's in vb.inputs_read */ if (0) - _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); + printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); /* Accumulate the list of enabled arrays. */ brw->vb.nr_enabled = 0; diff --git a/src/mesa/drivers/dri/i965/brw_eu_debug.c b/src/mesa/drivers/dri/i965/brw_eu_debug.c index 29f3f6d02fa..99453afdcaf 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_debug.c +++ b/src/mesa/drivers/dri/i965/brw_eu_debug.c @@ -54,9 +54,9 @@ void brw_print_reg( struct brw_reg hwreg ) "f" }; - _mesa_printf("%s%s", - hwreg.abs ? "abs/" : "", - hwreg.negate ? "-" : ""); + printf("%s%s", + hwreg.abs ? "abs/" : "", + hwreg.negate ? "-" : ""); if (hwreg.file == BRW_GENERAL_REGISTER_FILE && hwreg.nr % 2 == 0 && @@ -66,7 +66,7 @@ void brw_print_reg( struct brw_reg hwreg ) hwreg.hstride == BRW_HORIZONTAL_STRIDE_1 && hwreg.type == BRW_REGISTER_TYPE_F) { /* vector register */ - _mesa_printf("vec%d", hwreg.nr); + printf("vec%d", hwreg.nr); } else if (hwreg.file == BRW_GENERAL_REGISTER_FILE && hwreg.vstride == BRW_VERTICAL_STRIDE_0 && @@ -74,13 +74,13 @@ void brw_print_reg( struct brw_reg hwreg ) hwreg.hstride == BRW_HORIZONTAL_STRIDE_0 && hwreg.type == BRW_REGISTER_TYPE_F) { /* "scalar" register */ - _mesa_printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4); + printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4); } else if (hwreg.file == BRW_IMMEDIATE_VALUE) { - _mesa_printf("imm %f", hwreg.dw1.f); + printf("imm %f", hwreg.dw1.f); } else { - _mesa_printf("%s%d.%d<%d;%d,%d>:%s", + printf("%s%d.%d<%d;%d,%d>:%s", file[hwreg.file], hwreg.nr, hwreg.subnr / type_sz(hwreg.type), diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 8d6ac008396..b832c7165d2 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -1272,7 +1272,7 @@ void brw_SAMPLE(struct brw_compile *p, GLboolean need_stall = 0; if (writemask == 0) { - /*_mesa_printf("%s: zero writemask??\n", __FUNCTION__); */ + /*printf("%s: zero writemask??\n", __FUNCTION__); */ return; } @@ -1304,7 +1304,7 @@ void brw_SAMPLE(struct brw_compile *p, if (newmask != writemask) { need_stall = 1; - /* _mesa_printf("need stall %x %x\n", newmask , writemask); */ + /* printf("need stall %x %x\n", newmask , writemask); */ } else { struct brw_reg m1 = brw_message_reg(msg_reg_nr); diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index dd9894d6819..4bb98d8d5d5 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -266,7 +266,7 @@ brw_upload_cache_with_auxdata(struct brw_cache *cache, } if (INTEL_DEBUG & DEBUG_STATE) - _mesa_printf("upload %s: %d bytes to cache id %d\n", + printf("upload %s: %d bytes to cache id %d\n", cache->name[cache_id], data_size, cache_id); @@ -425,7 +425,7 @@ brw_clear_cache(struct brw_context *brw, struct brw_cache *cache) GLuint i; if (INTEL_DEBUG & DEBUG_STATE) - _mesa_printf("%s\n", __FUNCTION__); + printf("%s\n", __FUNCTION__); for (i = 0; i < cache->size; i++) { for (c = cache->items[i]; c; c = next) { @@ -465,7 +465,7 @@ brw_state_cache_bo_delete(struct brw_cache *cache, dri_bo *bo) GLuint i; if (INTEL_DEBUG & DEBUG_STATE) - _mesa_printf("%s\n", __FUNCTION__); + printf("%s\n", __FUNCTION__); for (i = 0; i < cache->size; i++) { for (prev = &cache->items[i]; *prev;) { @@ -493,7 +493,7 @@ void brw_state_cache_check_size(struct brw_context *brw) { if (INTEL_DEBUG & DEBUG_STATE) - _mesa_printf("%s (n_items=%d)\n", __FUNCTION__, brw->cache.n_items); + printf("%s (n_items=%d)\n", __FUNCTION__, brw->cache.n_items); /* un-tuned guess. We've got around 20 state objects for a total of around * 32k, so 1000 of them is around 1.5MB. @@ -512,7 +512,7 @@ brw_destroy_cache(struct brw_context *brw, struct brw_cache *cache) GLuint i; if (INTEL_DEBUG & DEBUG_STATE) - _mesa_printf("%s\n", __FUNCTION__); + printf("%s\n", __FUNCTION__); brw_clear_cache(brw, cache); for (i = 0; i < BRW_MAX_CACHE; i++) { diff --git a/src/mesa/drivers/dri/i965/brw_urb.c b/src/mesa/drivers/dri/i965/brw_urb.c index f2cdb203b85..4f6b9002ad5 100644 --- a/src/mesa/drivers/dri/i965/brw_urb.c +++ b/src/mesa/drivers/dri/i965/brw_urb.c @@ -186,17 +186,17 @@ static void recalculate_urb_fence( struct brw_context *brw ) * entries and the values for minimum nr of entries * provided above. */ - _mesa_printf("couldn't calculate URB layout!\n"); + printf("couldn't calculate URB layout!\n"); exit(1); } if (INTEL_DEBUG & (DEBUG_URB|DEBUG_FALLBACKS)) - _mesa_printf("URB CONSTRAINED\n"); + printf("URB CONSTRAINED\n"); } done: if (INTEL_DEBUG & DEBUG_URB) - _mesa_printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n", + printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n", brw->urb.vs_start, brw->urb.gs_start, brw->urb.clip_start, diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 4f4eef85e8c..88327d9927d 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -287,9 +287,9 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) c->prog_data.total_grf = reg; if (INTEL_DEBUG & DEBUG_VS) { - _mesa_printf("%s NumAddrRegs %d\n", __FUNCTION__, c->vp->program.Base.NumAddressRegs); - _mesa_printf("%s NumTemps %d\n", __FUNCTION__, c->vp->program.Base.NumTemporaries); - _mesa_printf("%s reg = %d\n", __FUNCTION__, reg); + printf("%s NumAddrRegs %d\n", __FUNCTION__, c->vp->program.Base.NumAddressRegs); + printf("%s NumTemps %d\n", __FUNCTION__, c->vp->program.Base.NumTemporaries); + printf("%s reg = %d\n", __FUNCTION__, reg); } } @@ -1444,9 +1444,9 @@ void brw_vs_emit(struct brw_vs_compile *c ) GLuint file; if (INTEL_DEBUG & DEBUG_VS) { - _mesa_printf("vs-mesa:\n"); + printf("vs-mesa:\n"); _mesa_print_program(&c->vp->program.Base); - _mesa_printf("\n"); + printf("\n"); } brw_set_compression_control(p, BRW_COMPRESSION_NONE); @@ -1796,9 +1796,9 @@ void brw_vs_emit(struct brw_vs_compile *c ) if (INTEL_DEBUG & DEBUG_VS) { int i; - _mesa_printf("vs-native:\n"); + printf("vs-native:\n"); for (i = 0; i < p->nr_insn; i++) brw_disasm(stderr, &p->store[i]); - _mesa_printf("\n"); + printf("\n"); } } diff --git a/src/mesa/drivers/dri/i965/brw_wm_debug.c b/src/mesa/drivers/dri/i965/brw_wm_debug.c index 220821087c1..a78cc8b54e5 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_debug.c +++ b/src/mesa/drivers/dri/i965/brw_wm_debug.c @@ -41,21 +41,21 @@ void brw_wm_print_value( struct brw_wm_compile *c, if (c->state >= PASS2_DONE) brw_print_reg(value->hw_reg); else if( value == &c->undef_value ) - _mesa_printf("undef"); + printf("undef"); else if( value - c->vreg >= 0 && value - c->vreg < BRW_WM_MAX_VREG) - _mesa_printf("r%d", value - c->vreg); + printf("r%d", value - c->vreg); else if (value - c->creg >= 0 && value - c->creg < BRW_WM_MAX_PARAM) - _mesa_printf("c%d", value - c->creg); + printf("c%d", value - c->creg); else if (value - c->payload.input_interp >= 0 && value - c->payload.input_interp < FRAG_ATTRIB_MAX) - _mesa_printf("i%d", value - c->payload.input_interp); + printf("i%d", value - c->payload.input_interp); else if (value - c->payload.depth >= 0 && value - c->payload.depth < FRAG_ATTRIB_MAX) - _mesa_printf("d%d", value - c->payload.depth); + printf("d%d", value - c->payload.depth); else - _mesa_printf("?"); + printf("?"); } void brw_wm_print_ref( struct brw_wm_compile *c, @@ -64,16 +64,16 @@ void brw_wm_print_ref( struct brw_wm_compile *c, struct brw_reg hw_reg = ref->hw_reg; if (ref->unspill_reg) - _mesa_printf("UNSPILL(%x)/", ref->value->spill_slot); + printf("UNSPILL(%x)/", ref->value->spill_slot); if (c->state >= PASS2_DONE) brw_print_reg(ref->hw_reg); else { - _mesa_printf("%s", hw_reg.negate ? "-" : ""); - _mesa_printf("%s", hw_reg.abs ? "abs/" : ""); + printf("%s", hw_reg.negate ? "-" : ""); + printf("%s", hw_reg.abs ? "abs/" : ""); brw_wm_print_value(c, ref->value); if ((hw_reg.nr&1) || hw_reg.subnr) { - _mesa_printf("->%d.%d", (hw_reg.nr&1), hw_reg.subnr); + printf("->%d.%d", (hw_reg.nr&1), hw_reg.subnr); } } } @@ -84,22 +84,22 @@ void brw_wm_print_insn( struct brw_wm_compile *c, GLuint i, arg; GLuint nr_args = brw_wm_nr_args(inst->opcode); - _mesa_printf("["); + printf("["); for (i = 0; i < 4; i++) { if (inst->dst[i]) { brw_wm_print_value(c, inst->dst[i]); if (inst->dst[i]->spill_slot) - _mesa_printf("/SPILL(%x)",inst->dst[i]->spill_slot); + printf("/SPILL(%x)",inst->dst[i]->spill_slot); } else - _mesa_printf("#"); + printf("#"); if (i < 3) - _mesa_printf(","); + printf(","); } - _mesa_printf("]"); + printf("]"); if (inst->writemask != WRITEMASK_XYZW) - _mesa_printf(".%s%s%s%s", + printf(".%s%s%s%s", GET_BIT(inst->writemask, 0) ? "x" : "", GET_BIT(inst->writemask, 1) ? "y" : "", GET_BIT(inst->writemask, 2) ? "z" : "", @@ -107,58 +107,58 @@ void brw_wm_print_insn( struct brw_wm_compile *c, switch (inst->opcode) { case WM_PIXELXY: - _mesa_printf(" = PIXELXY"); + printf(" = PIXELXY"); break; case WM_DELTAXY: - _mesa_printf(" = DELTAXY"); + printf(" = DELTAXY"); break; case WM_PIXELW: - _mesa_printf(" = PIXELW"); + printf(" = PIXELW"); break; case WM_WPOSXY: - _mesa_printf(" = WPOSXY"); + printf(" = WPOSXY"); break; case WM_PINTERP: - _mesa_printf(" = PINTERP"); + printf(" = PINTERP"); break; case WM_LINTERP: - _mesa_printf(" = LINTERP"); + printf(" = LINTERP"); break; case WM_CINTERP: - _mesa_printf(" = CINTERP"); + printf(" = CINTERP"); break; case WM_FB_WRITE: - _mesa_printf(" = FB_WRITE"); + printf(" = FB_WRITE"); break; case WM_FRONTFACING: - _mesa_printf(" = FRONTFACING"); + printf(" = FRONTFACING"); break; default: - _mesa_printf(" = %s", _mesa_opcode_string(inst->opcode)); + printf(" = %s", _mesa_opcode_string(inst->opcode)); break; } if (inst->saturate) - _mesa_printf("_SAT"); + printf("_SAT"); for (arg = 0; arg < nr_args; arg++) { - _mesa_printf(" ["); + printf(" ["); for (i = 0; i < 4; i++) { if (inst->src[arg][i]) { brw_wm_print_ref(c, inst->src[arg][i]); } else - _mesa_printf("%%"); + printf("%%"); if (i < 3) - _mesa_printf(","); + printf(","); else - _mesa_printf("]"); + printf("]"); } } - _mesa_printf("\n"); + printf("\n"); } void brw_wm_print_program( struct brw_wm_compile *c, @@ -166,9 +166,9 @@ void brw_wm_print_program( struct brw_wm_compile *c, { GLuint insn; - _mesa_printf("%s:\n", stage); + printf("%s:\n", stage); for (insn = 0; insn < c->nr_insns; insn++) brw_wm_print_insn(c, &c->instruction[insn]); - _mesa_printf("\n"); + printf("\n"); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index fa0898c5862..9315bca3156 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -1622,10 +1622,10 @@ void brw_wm_emit( struct brw_wm_compile *c ) break; default: - _mesa_printf("Unsupported opcode %i (%s) in fragment shader\n", - inst->opcode, inst->opcode < MAX_OPCODE ? - _mesa_opcode_string(inst->opcode) : - "unknown"); + printf("Unsupported opcode %i (%s) in fragment shader\n", + inst->opcode, inst->opcode < MAX_OPCODE ? + _mesa_opcode_string(inst->opcode) : + "unknown"); } for (i = 0; i < 4; i++) @@ -1638,9 +1638,9 @@ void brw_wm_emit( struct brw_wm_compile *c ) if (INTEL_DEBUG & DEBUG_WM) { int i; - _mesa_printf("wm-native:\n"); + printf("wm-native:\n"); for (i = 0; i < p->nr_insn; i++) brw_disasm(stderr, &p->store[i]); - _mesa_printf("\n"); + printf("\n"); } } diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 3737faf26fb..d73c3915824 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -159,7 +159,7 @@ static struct prog_dst_register get_temp( struct brw_wm_compile *c ) int bit = _mesa_ffs( ~c->fp_temp ); if (!bit) { - _mesa_printf("%s: out of temporaries\n", __FILE__); + printf("%s: out of temporaries\n", __FILE__); exit(1); } @@ -1034,7 +1034,7 @@ static void print_insns( const struct prog_instruction *insn, { GLuint i; for (i = 0; i < nr; i++, insn++) { - _mesa_printf("%3d: ", i); + printf("%3d: ", i); if (insn->Opcode < MAX_OPCODE) _mesa_print_instruction(insn); else if (insn->Opcode < MAX_WM_OPCODE) { @@ -1045,7 +1045,7 @@ static void print_insns( const struct prog_instruction *insn, 3); } else - _mesa_printf("965 Opcode %d\n", insn->Opcode); + printf("965 Opcode %d\n", insn->Opcode); } } @@ -1060,9 +1060,9 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) GLuint insn; if (INTEL_DEBUG & DEBUG_WM) { - _mesa_printf("pre-fp:\n"); + printf("pre-fp:\n"); _mesa_print_program(&fp->program.Base); - _mesa_printf("\n"); + printf("\n"); } c->pixel_xy = src_undef(); @@ -1168,9 +1168,9 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) } if (INTEL_DEBUG & DEBUG_WM) { - _mesa_printf("pass_fp:\n"); + printf("pass_fp:\n"); print_insns( c->prog_instructions, c->nr_fp_insns ); - _mesa_printf("\n"); + printf("\n"); } } diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index fde83eea620..562608e2ecd 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -1849,7 +1849,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) c->cur_inst = i; #if 0 - _mesa_printf("Inst %d: ", i); + printf("Inst %d: ", i); _mesa_print_instruction(inst); #endif @@ -2115,7 +2115,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) } break; default: - _mesa_printf("unsupported IR in fragment shader %d\n", + printf("unsupported IR in fragment shader %d\n", inst->Opcode); } @@ -2127,10 +2127,10 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) post_wm_emit(c); if (INTEL_DEBUG & DEBUG_WM) { - _mesa_printf("wm-native:\n"); + printf("wm-native:\n"); for (i = 0; i < p->nr_insn; i++) brw_disasm(stderr, &p->store[i]); - _mesa_printf("\n"); + printf("\n"); } } @@ -2141,7 +2141,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) void brw_wm_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c) { if (INTEL_DEBUG & DEBUG_WM) { - _mesa_printf("brw_wm_glsl_emit:\n"); + printf("brw_wm_glsl_emit:\n"); } /* initial instruction translation/simplification */ diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass0.c b/src/mesa/drivers/dri/i965/brw_wm_pass0.c index ff4c082d5e8..60bd92ed223 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass0.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass0.c @@ -105,7 +105,7 @@ static const struct brw_wm_ref *get_param_ref( struct brw_wm_compile *c, GLuint i = c->prog_data.nr_params++; if (i >= BRW_WM_MAX_PARAM) { - _mesa_printf("%s: out of params\n", __FUNCTION__); + printf("%s: out of params\n", __FUNCTION__); c->prog_data.error = 1; return NULL; } @@ -154,7 +154,7 @@ static const struct brw_wm_ref *get_const_ref( struct brw_wm_compile *c, return c->constref[i].ref; } else { - _mesa_printf("%s: out of constrefs\n", __FUNCTION__); + printf("%s: out of constrefs\n", __FUNCTION__); c->prog_data.error = 1; return NULL; } diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index ae0f8a16f95..c9841724ee6 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -209,8 +209,8 @@ intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, int ret; if (batch->ptr - batch->map > batch->buf->size) - _mesa_printf ("bad relocation ptr %p map %p offset %d size %d\n", - batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size); + printf ("bad relocation ptr %p map %p offset %d size %d\n", + batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size); ret = dri_bo_emit_reloc(batch->buf, read_domains, write_domain, delta, batch->ptr - batch->map, buffer); diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 8f37fb82c1a..3a0830a85b8 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -592,7 +592,7 @@ intelInitContext(struct intel_context *intel, if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx, functions, (void *) intel)) { - _mesa_printf("%s: failed to init mesa context\n", __FUNCTION__); + printf("%s: failed to init mesa context\n", __FUNCTION__); return GL_FALSE; } diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index da5d901abf9..d20d44497e1 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -345,7 +345,7 @@ extern int INTEL_DEBUG; #define DBG(...) do { \ if (INTEL_DEBUG & FILE_DEBUG_FLAG) \ - _mesa_printf(__VA_ARGS__); \ + printf(__VA_ARGS__); \ } while(0) #define PCI_CHIP_845_G 0x2562 diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 54998a63f66..076fee89bdd 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -123,7 +123,7 @@ static GLuint get_bitmap_rect(GLsizei width, GLsizei height, GLuint count = 0; if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n", + printf("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n", __FUNCTION__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask); if (invert) { @@ -516,7 +516,7 @@ intelBitmap(GLcontext * ctx, return; if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s: fallback to swrast\n", __FUNCTION__); + printf("%s: fallback to swrast\n", __FUNCTION__); _swrast_Bitmap(ctx, x, y, width, height, unpack, pixels); } diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c index 514a17e2aa3..2ac3da7f42f 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_read.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c @@ -80,7 +80,7 @@ do_blit_readpixels(GLcontext * ctx, GLint dst_x, dst_y; if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s\n", __FUNCTION__); + printf("%s\n", __FUNCTION__); if (!src) return GL_FALSE; @@ -89,7 +89,7 @@ do_blit_readpixels(GLcontext * ctx, /* PBO only for now: */ if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s - not PBO\n", __FUNCTION__); + printf("%s - not PBO\n", __FUNCTION__); return GL_FALSE; } @@ -97,13 +97,13 @@ do_blit_readpixels(GLcontext * ctx, if (ctx->_ImageTransferState || !intel_check_blit_format(src, format, type)) { if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s - bad format for blit\n", __FUNCTION__); + printf("%s - bad format for blit\n", __FUNCTION__); return GL_FALSE; } if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) { if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s: bad packing params\n", __FUNCTION__); + printf("%s: bad packing params\n", __FUNCTION__); return GL_FALSE; } @@ -114,7 +114,7 @@ do_blit_readpixels(GLcontext * ctx, if (pack->Invert) { if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__); + printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__); return GL_FALSE; } else { @@ -159,7 +159,7 @@ do_blit_readpixels(GLcontext * ctx, } if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s - DONE\n", __FUNCTION__); + printf("%s - DONE\n", __FUNCTION__); return GL_TRUE; } @@ -181,7 +181,7 @@ intelReadPixels(GLcontext * ctx, return; if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s: fallback to swrast\n", __FUNCTION__); + printf("%s: fallback to swrast\n", __FUNCTION__); /* Update Mesa state before calling down into _swrast_ReadPixels, as * the spans code requires the computed buffer states to be up to date, diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index 215a534a5c5..8bb6ae99fb1 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -146,7 +146,7 @@ timed_memcpy(void *dest, const void *src, size_t n) double rate; if ((((unsigned) src) & 63) || (((unsigned) dest) & 63)) - _mesa_printf("Warning - non-aligned texture copy!\n"); + printf("Warning - non-aligned texture copy!\n"); t1 = fastrdtsc(); ret = do_memcpy(dest, src, n); @@ -154,7 +154,7 @@ timed_memcpy(void *dest, const void *src, size_t n) rate = time_diff(t1, t2); rate /= (double) n; - _mesa_printf("timed_memcpy: %u %u --> %f clocks/byte\n", t1, t2, rate); + printf("timed_memcpy: %u %u --> %f clocks/byte\n", t1, t2, rate); return ret; } #endif /* DO_DEBUG */ diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.h b/src/mesa/drivers/dri/nouveau/nouveau_driver.h index 54bf981a0f5..283f6eac2c8 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_driver.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.h @@ -70,7 +70,7 @@ struct nouveau_driver { }; #define nouveau_error(format, ...) \ - _mesa_fprintf(stderr, "%s: " format, __func__, ## __VA_ARGS__) + fprintf(stderr, "%s: " format, __func__, ## __VA_ARGS__) void nouveau_clear(GLcontext *ctx, GLbitfield buffers); diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index a5810ee500d..61ea5e4d9a3 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -227,7 +227,7 @@ static void translate_fragment_program(GLcontext *ctx, struct r300_fragment_prog if (compiler.Base.Debug) { fflush(stderr); - _mesa_printf("Fragment Program: Initial program:\n"); + printf("Fragment Program: Initial program:\n"); _mesa_print_program(&cont->Base.Base); fflush(stderr); } diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index e3e62857840..95961314863 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -440,7 +440,7 @@ void r300SwitchFallback(GLcontext *ctx, uint32_t bit, GLboolean mode) if (mode) { if ((fallback_warn & bit) == 0) { if (RADEON_DEBUG & RADEON_FALLBACKS) - _mesa_fprintf(stderr, "WARNING! Falling back to software for %s\n", getFallbackString(bit)); + fprintf(stderr, "WARNING! Falling back to software for %s\n", getFallbackString(bit)); fallback_warn |= bit; } rmesa->fallback |= bit; diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 017d45a5039..9d1ff6e2ba2 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1970,7 +1970,7 @@ void r300UpdateShaders(r300ContextPtr rmesa) /* should only happenen once, just after context is created */ /* TODO: shouldn't we fallback to sw here? */ if (!ctx->FragmentProgram._Current) { - _mesa_fprintf(stderr, "No ctx->FragmentProgram._Current!!\n"); + fprintf(stderr, "No ctx->FragmentProgram._Current!!\n"); return; } diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 0240eefd5c2..4ebdbbfad25 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -65,7 +65,7 @@ void r700UpdateShaders(GLcontext * ctx) /* should only happenen once, just after context is created */ /* TODO: shouldn't we fallback to sw here? */ if (!ctx->FragmentProgram._Current) { - _mesa_fprintf(stderr, "No ctx->FragmentProgram._Current!!\n"); + fprintf(stderr, "No ctx->FragmentProgram._Current!!\n"); return; } diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index a8931e8478d..3b066f5eef6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -43,7 +43,7 @@ #define FILE_DEBUG_FLAG RADEON_TEXTURE #define DBG(...) do { \ if (RADEON_DEBUG & FILE_DEBUG_FLAG) \ - _mesa_printf(__VA_ARGS__); \ + printf(__VA_ARGS__); \ } while(0) static struct gl_framebuffer * diff --git a/src/mesa/drivers/dri/swrast/swrast_priv.h b/src/mesa/drivers/dri/swrast/swrast_priv.h index 1a5fb31d5a8..59b4a6d2282 100644 --- a/src/mesa/drivers/dri/swrast/swrast_priv.h +++ b/src/mesa/drivers/dri/swrast/swrast_priv.h @@ -43,13 +43,13 @@ #define DEBUG_SPAN 0 #if DEBUG_CORE -#define TRACE _mesa_printf("--> %s\n", __FUNCTION__) +#define TRACE printf("--> %s\n", __FUNCTION__) #else #define TRACE #endif #if DEBUG_SPAN -#define TRACE_SPAN _mesa_printf("--> %s\n", __FUNCTION__) +#define TRACE_SPAN printf("--> %s\n", __FUNCTION__) #else #define TRACE_SPAN #endif diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index f097d93a710..33a3ff6d5f3 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -53,7 +53,7 @@ #include "xmesaP.h" #ifdef __VMS -#define _mesa_sprintf sprintf +#define sprintf sprintf #endif /* This indicates the client-side GLX API and GLX encoder version. */ @@ -2032,8 +2032,8 @@ static const char * Fake_glXQueryServerString( Display *dpy, int screen, int name ) { static char version[1000]; - _mesa_sprintf(version, "%d.%d %s", - SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION); + sprintf(version, "%d.%d %s", + SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION); (void) dpy; (void) screen; @@ -2057,8 +2057,8 @@ static const char * Fake_glXGetClientString( Display *dpy, int name ) { static char version[1000]; - _mesa_sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION, - CLIENT_MINOR_VERSION, MESA_GLX_VERSION); + sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION, + CLIENT_MINOR_VERSION, MESA_GLX_VERSION); (void) dpy; diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index ed945023cf3..3711c881482 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1110,12 +1110,12 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, * reports bugs. */ if (_mesa_getenv("MESA_INFO")) { - _mesa_printf("X/Mesa visual = %p\n", (void *) v); - _mesa_printf("X/Mesa dithered pf = %u\n", v->dithered_pf); - _mesa_printf("X/Mesa undithered pf = %u\n", v->undithered_pf); - _mesa_printf("X/Mesa level = %d\n", v->mesa_visual.level); - _mesa_printf("X/Mesa depth = %d\n", GET_VISUAL_DEPTH(v)); - _mesa_printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel); + printf("X/Mesa visual = %p\n", (void *) v); + printf("X/Mesa dithered pf = %u\n", v->dithered_pf); + printf("X/Mesa undithered pf = %u\n", v->undithered_pf); + printf("X/Mesa level = %d\n", v->mesa_visual.level); + printf("X/Mesa depth = %d\n", GET_VISUAL_DEPTH(v)); + printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel); } if (b && window) { diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c index 3a0cf801397..a6efb35e3c3 100644 --- a/src/mesa/drivers/x11/xm_tri.c +++ b/src/mesa/drivers/x11/xm_tri.c @@ -1330,97 +1330,97 @@ extern void _xmesa_print_triangle_func( swrast_tri_func triFunc ); void _xmesa_print_triangle_func( swrast_tri_func triFunc ) { - _mesa_printf("XMesa tri func = "); + printf("XMesa tri func = "); if (triFunc ==smooth_TRUECOLOR_z_triangle) - _mesa_printf("smooth_TRUECOLOR_z_triangle\n"); + printf("smooth_TRUECOLOR_z_triangle\n"); else if (triFunc ==smooth_8A8B8G8R_z_triangle) - _mesa_printf("smooth_8A8B8G8R_z_triangle\n"); + printf("smooth_8A8B8G8R_z_triangle\n"); else if (triFunc ==smooth_8A8R8G8B_z_triangle) - _mesa_printf("smooth_8A8R8G8B_z_triangle\n"); + printf("smooth_8A8R8G8B_z_triangle\n"); else if (triFunc ==smooth_8R8G8B_z_triangle) - _mesa_printf("smooth_8R8G8B_z_triangle\n"); + printf("smooth_8R8G8B_z_triangle\n"); else if (triFunc ==smooth_8R8G8B24_z_triangle) - _mesa_printf("smooth_8R8G8B24_z_triangle\n"); + printf("smooth_8R8G8B24_z_triangle\n"); else if (triFunc ==smooth_TRUEDITHER_z_triangle) - _mesa_printf("smooth_TRUEDITHER_z_triangle\n"); + printf("smooth_TRUEDITHER_z_triangle\n"); else if (triFunc ==smooth_5R6G5B_z_triangle) - _mesa_printf("smooth_5R6G5B_z_triangle\n"); + printf("smooth_5R6G5B_z_triangle\n"); else if (triFunc ==smooth_DITHER_5R6G5B_z_triangle) - _mesa_printf("smooth_DITHER_5R6G5B_z_triangle\n"); + printf("smooth_DITHER_5R6G5B_z_triangle\n"); else if (triFunc ==smooth_HPCR_z_triangle) - _mesa_printf("smooth_HPCR_z_triangle\n"); + printf("smooth_HPCR_z_triangle\n"); else if (triFunc ==smooth_DITHER8_z_triangle) - _mesa_printf("smooth_DITHER8_z_triangle\n"); + printf("smooth_DITHER8_z_triangle\n"); else if (triFunc ==smooth_LOOKUP8_z_triangle) - _mesa_printf("smooth_LOOKUP8_z_triangle\n"); + printf("smooth_LOOKUP8_z_triangle\n"); else if (triFunc ==flat_TRUECOLOR_z_triangle) - _mesa_printf("flat_TRUECOLOR_z_triangle\n"); + printf("flat_TRUECOLOR_z_triangle\n"); else if (triFunc ==flat_8A8B8G8R_z_triangle) - _mesa_printf("flat_8A8B8G8R_z_triangle\n"); + printf("flat_8A8B8G8R_z_triangle\n"); else if (triFunc ==flat_8A8R8G8B_z_triangle) - _mesa_printf("flat_8A8R8G8B_z_triangle\n"); + printf("flat_8A8R8G8B_z_triangle\n"); else if (triFunc ==flat_8R8G8B_z_triangle) - _mesa_printf("flat_8R8G8B_z_triangle\n"); + printf("flat_8R8G8B_z_triangle\n"); else if (triFunc ==flat_8R8G8B24_z_triangle) - _mesa_printf("flat_8R8G8B24_z_triangle\n"); + printf("flat_8R8G8B24_z_triangle\n"); else if (triFunc ==flat_TRUEDITHER_z_triangle) - _mesa_printf("flat_TRUEDITHER_z_triangle\n"); + printf("flat_TRUEDITHER_z_triangle\n"); else if (triFunc ==flat_5R6G5B_z_triangle) - _mesa_printf("flat_5R6G5B_z_triangle\n"); + printf("flat_5R6G5B_z_triangle\n"); else if (triFunc ==flat_DITHER_5R6G5B_z_triangle) - _mesa_printf("flat_DITHER_5R6G5B_z_triangle\n"); + printf("flat_DITHER_5R6G5B_z_triangle\n"); else if (triFunc ==flat_HPCR_z_triangle) - _mesa_printf("flat_HPCR_z_triangle\n"); + printf("flat_HPCR_z_triangle\n"); else if (triFunc ==flat_DITHER8_z_triangle) - _mesa_printf("flat_DITHER8_z_triangle\n"); + printf("flat_DITHER8_z_triangle\n"); else if (triFunc ==flat_LOOKUP8_z_triangle) - _mesa_printf("flat_LOOKUP8_z_triangle\n"); + printf("flat_LOOKUP8_z_triangle\n"); else if (triFunc ==smooth_TRUECOLOR_triangle) - _mesa_printf("smooth_TRUECOLOR_triangle\n"); + printf("smooth_TRUECOLOR_triangle\n"); else if (triFunc ==smooth_8A8B8G8R_triangle) - _mesa_printf("smooth_8A8B8G8R_triangle\n"); + printf("smooth_8A8B8G8R_triangle\n"); else if (triFunc ==smooth_8A8R8G8B_triangle) - _mesa_printf("smooth_8A8R8G8B_triangle\n"); + printf("smooth_8A8R8G8B_triangle\n"); else if (triFunc ==smooth_8R8G8B_triangle) - _mesa_printf("smooth_8R8G8B_triangle\n"); + printf("smooth_8R8G8B_triangle\n"); else if (triFunc ==smooth_8R8G8B24_triangle) - _mesa_printf("smooth_8R8G8B24_triangle\n"); + printf("smooth_8R8G8B24_triangle\n"); else if (triFunc ==smooth_TRUEDITHER_triangle) - _mesa_printf("smooth_TRUEDITHER_triangle\n"); + printf("smooth_TRUEDITHER_triangle\n"); else if (triFunc ==smooth_5R6G5B_triangle) - _mesa_printf("smooth_5R6G5B_triangle\n"); + printf("smooth_5R6G5B_triangle\n"); else if (triFunc ==smooth_DITHER_5R6G5B_triangle) - _mesa_printf("smooth_DITHER_5R6G5B_triangle\n"); + printf("smooth_DITHER_5R6G5B_triangle\n"); else if (triFunc ==smooth_HPCR_triangle) - _mesa_printf("smooth_HPCR_triangle\n"); + printf("smooth_HPCR_triangle\n"); else if (triFunc ==smooth_DITHER8_triangle) - _mesa_printf("smooth_DITHER8_triangle\n"); + printf("smooth_DITHER8_triangle\n"); else if (triFunc ==smooth_LOOKUP8_triangle) - _mesa_printf("smooth_LOOKUP8_triangle\n"); + printf("smooth_LOOKUP8_triangle\n"); else if (triFunc ==flat_TRUECOLOR_triangle) - _mesa_printf("flat_TRUECOLOR_triangle\n"); + printf("flat_TRUECOLOR_triangle\n"); else if (triFunc ==flat_TRUEDITHER_triangle) - _mesa_printf("flat_TRUEDITHER_triangle\n"); + printf("flat_TRUEDITHER_triangle\n"); else if (triFunc ==flat_8A8B8G8R_triangle) - _mesa_printf("flat_8A8B8G8R_triangle\n"); + printf("flat_8A8B8G8R_triangle\n"); else if (triFunc ==flat_8A8R8G8B_triangle) - _mesa_printf("flat_8A8R8G8B_triangle\n"); + printf("flat_8A8R8G8B_triangle\n"); else if (triFunc ==flat_8R8G8B_triangle) - _mesa_printf("flat_8R8G8B_triangle\n"); + printf("flat_8R8G8B_triangle\n"); else if (triFunc ==flat_8R8G8B24_triangle) - _mesa_printf("flat_8R8G8B24_triangle\n"); + printf("flat_8R8G8B24_triangle\n"); else if (triFunc ==flat_5R6G5B_triangle) - _mesa_printf("flat_5R6G5B_triangle\n"); + printf("flat_5R6G5B_triangle\n"); else if (triFunc ==flat_DITHER_5R6G5B_triangle) - _mesa_printf("flat_DITHER_5R6G5B_triangle\n"); + printf("flat_DITHER_5R6G5B_triangle\n"); else if (triFunc ==flat_HPCR_triangle) - _mesa_printf("flat_HPCR_triangle\n"); + printf("flat_HPCR_triangle\n"); else if (triFunc ==flat_DITHER8_triangle) - _mesa_printf("flat_DITHER8_triangle\n"); + printf("flat_DITHER8_triangle\n"); else if (triFunc ==flat_LOOKUP8_triangle) - _mesa_printf("flat_LOOKUP8_triangle\n"); + printf("flat_LOOKUP8_triangle\n"); else - _mesa_printf("???\n"); + printf("???\n"); } #endif diff --git a/src/mesa/glapi/gl_enums.py b/src/mesa/glapi/gl_enums.py index adb0ca526ce..3a9ea3c86c7 100644 --- a/src/mesa/glapi/gl_enums.py +++ b/src/mesa/glapi/gl_enums.py @@ -105,7 +105,7 @@ const char *_mesa_lookup_enum_by_nr( int nr ) } else { /* this is not re-entrant safe, no big deal here */ - _mesa_sprintf(token_tmp, "0x%x", nr); + sprintf(token_tmp, "0x%x", nr); return token_tmp; } } diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index 3a1fd37324b..7feaee316d6 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -295,11 +295,11 @@ compute_max_element(struct gl_client_array *array) - (GLsizeiptrARB) array->Ptr + array->StrideB - array->_ElementSize) / array->StrideB; if (0) - _mesa_printf("%s Object %u Size %u MaxElement %u\n", - __FUNCTION__, - array->BufferObj->Name, - (GLuint) array->BufferObj->Size, - array->_MaxElement); + printf("%s Object %u Size %u MaxElement %u\n", + __FUNCTION__, + array->BufferObj->Name, + (GLuint) array->BufferObj->Size, + array->_MaxElement); } else { /* user-space array, no idea how big it is */ diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 816465cea18..971b280f3bb 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1155,7 +1155,7 @@ _mesa_BufferDataARB(GLenum target, GLsizeiptrARB size, bufObj->Written = GL_TRUE; #ifdef VBO_DEBUG - _mesa_printf("glBufferDataARB(%u, sz %ld, from %p, usage 0x%x)\n", + printf("glBufferDataARB(%u, sz %ld, from %p, usage 0x%x)\n", bufObj->Name, size, data, usage); #endif @@ -1272,8 +1272,8 @@ _mesa_MapBufferARB(GLenum target, GLenum access) bufObj->Written = GL_TRUE; #ifdef VBO_DEBUG - _mesa_printf("glMapBufferARB(%u, sz %ld, access 0x%x)\n", - bufObj->Name, bufObj->Size, access); + printf("glMapBufferARB(%u, sz %ld, access 0x%x)\n", + bufObj->Name, bufObj->Size, access); if (access == GL_WRITE_ONLY_ARB) { GLuint i; GLubyte *b = (GLubyte *) bufObj->Pointer; @@ -1349,7 +1349,7 @@ _mesa_UnmapBufferARB(GLenum target) } } if (unchanged) { - _mesa_printf("glUnmapBufferARB(%u): %u of %ld unchanged, starting at %d\n", + printf("glUnmapBufferARB(%u): %u of %ld unchanged, starting at %d\n", bufObj->Name, unchanged, bufObj->Size, pos); } } diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 79b63e940fa..246dbd436d8 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -314,9 +314,9 @@ write_texture_image(struct gl_texture_object *texObj, buffer, texObj, img); /* make filename */ - _mesa_sprintf(s, "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face); + sprintf(s, "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face); - _mesa_printf(" Writing image level %u to %s\n", level, s); + printf(" Writing image level %u to %s\n", level, s); write_ppm(s, buffer, img->Width, img->Height, 4, 0, 1, 2, GL_FALSE); ctx->Pack = store; /* restore */ @@ -356,9 +356,9 @@ write_renderbuffer_image(const struct gl_renderbuffer *rb) format, type, &ctx->DefaultPacking, buffer); /* make filename */ - _mesa_sprintf(s, "/tmp/renderbuffer%u.ppm", rb->Name); + sprintf(s, "/tmp/renderbuffer%u.ppm", rb->Name); - _mesa_printf(" Writing renderbuffer image to %s\n", s); + printf(" Writing renderbuffer image to %s\n", s); write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE); free(buffer); @@ -380,17 +380,17 @@ dump_texture(struct gl_texture_object *texObj, GLuint writeImages) GLboolean written = GL_FALSE; GLuint i, j; - _mesa_printf("Texture %u\n", texObj->Name); - _mesa_printf(" Target %s\n", tex_target_name(texObj->Target)); + printf("Texture %u\n", texObj->Name); + printf(" Target %s\n", tex_target_name(texObj->Target)); for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { for (j = 0; j < numFaces; j++) { struct gl_texture_image *texImg = texObj->Image[j][i]; if (texImg) { - _mesa_printf(" Face %u level %u: %d x %d x %d, format %s at %p\n", - j, i, - texImg->Width, texImg->Height, texImg->Depth, - _mesa_get_format_name(texImg->TexFormat), - texImg->Data); + printf(" Face %u level %u: %d x %d x %d, format %s at %p\n", + j, i, + texImg->Width, texImg->Height, texImg->Depth, + _mesa_get_format_name(texImg->TexFormat), + texImg->Data); if (writeImages == WRITE_ALL || (writeImages == WRITE_ONE && !written)) { write_texture_image(texObj, j, i); @@ -441,9 +441,9 @@ _mesa_dump_textures(GLuint writeImages) static void dump_renderbuffer(const struct gl_renderbuffer *rb, GLboolean writeImage) { - _mesa_printf("Renderbuffer %u: %u x %u IntFormat = %s\n", - rb->Name, rb->Width, rb->Height, - _mesa_lookup_enum_by_nr(rb->InternalFormat)); + printf("Renderbuffer %u: %u x %u IntFormat = %s\n", + rb->Name, rb->Width, rb->Height, + _mesa_lookup_enum_by_nr(rb->InternalFormat)); if (writeImage) { write_renderbuffer_image(rb); } @@ -489,12 +489,12 @@ _mesa_dump_color_buffer(const char *filename) _mesa_ReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buf); - _mesa_printf("ReadBuffer %p 0x%x DrawBuffer %p 0x%x\n", - ctx->ReadBuffer->_ColorReadBuffer, - ctx->ReadBuffer->ColorReadBuffer, - ctx->DrawBuffer->_ColorDrawBuffers[0], - ctx->DrawBuffer->ColorDrawBuffer[0]); - _mesa_printf("Writing %d x %d color buffer to %s\n", w, h, filename); + printf("ReadBuffer %p 0x%x DrawBuffer %p 0x%x\n", + ctx->ReadBuffer->_ColorReadBuffer, + ctx->ReadBuffer->ColorReadBuffer, + ctx->DrawBuffer->_ColorDrawBuffers[0], + ctx->DrawBuffer->ColorDrawBuffer[0]); + printf("Writing %d x %d color buffer to %s\n", w, h, filename); write_ppm(filename, buf, w, h, 4, 0, 1, 2, GL_TRUE); _mesa_PopClientAttrib(); @@ -529,7 +529,7 @@ _mesa_dump_depth_buffer(const char *filename) buf2[i*3+2] = (buf[i] >> 8) & 0xff; } - _mesa_printf("Writing %d x %d depth buffer to %s\n", w, h, filename); + printf("Writing %d x %d depth buffer to %s\n", w, h, filename); write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE); _mesa_PopClientAttrib(); @@ -564,7 +564,7 @@ _mesa_dump_stencil_buffer(const char *filename) buf2[i*3+2] = (buf[i] - 128) * 2; } - _mesa_printf("Writing %d x %d stencil buffer to %s\n", w, h, filename); + printf("Writing %d x %d stencil buffer to %s\n", w, h, filename); write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE); _mesa_PopClientAttrib(); @@ -587,7 +587,7 @@ _mesa_print_texture(GLcontext *ctx, const struct gl_texture_image *img) const GLubyte *data = (const GLubyte *) img->Data; if (!data) { - _mesa_printf("No texture data\n"); + printf("No texture data\n"); return; } @@ -619,17 +619,17 @@ _mesa_print_texture(GLcontext *ctx, const struct gl_texture_image *img) for (i = 0; i < img->Height; i++) { for (j = 0; j < img->Width; j++) { if (c==1) - _mesa_printf("%02x ", data[0]); + printf("%02x ", data[0]); else if (c==2) - _mesa_printf("%02x%02x ", data[0], data[1]); + printf("%02x%02x ", data[0], data[1]); else if (c==3) - _mesa_printf("%02x%02x%02x ", data[0], data[1], data[2]); + printf("%02x%02x%02x ", data[0], data[1], data[2]); else if (c==4) - _mesa_printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]); + printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]); data += (img->RowStride - img->Width) * c; } /* XXX use img->ImageStride here */ - _mesa_printf("\n"); + printf("\n"); } #endif } diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 87b8ddacc2e..9ef7fcae907 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -7685,7 +7685,7 @@ execute_list(GLcontext *ctx, GLuint list) default: { char msg[1000]; - _mesa_sprintf(msg, "Error in execute_list: opcode=%d", + sprintf(msg, "Error in execute_list: opcode=%d", (int) opcode); _mesa_problem(ctx, msg); } @@ -9320,7 +9320,7 @@ print_list(GLcontext *ctx, GLuint list) GLboolean done; if (!islist(ctx, list)) { - _mesa_printf("%u is not a display list ID\n", list); + printf("%u is not a display list ID\n", list); return; } @@ -9330,7 +9330,7 @@ print_list(GLcontext *ctx, GLuint list) n = dlist->Head; - _mesa_printf("START-LIST %u, address %p\n", list, (void *) n); + printf("START-LIST %u, address %p\n", list, (void *) n); done = n ? GL_FALSE : GL_TRUE; while (!done) { @@ -9342,196 +9342,196 @@ print_list(GLcontext *ctx, GLuint list) else { switch (opcode) { case OPCODE_ACCUM: - _mesa_printf("Accum %s %g\n", enum_string(n[1].e), n[2].f); + printf("Accum %s %g\n", enum_string(n[1].e), n[2].f); break; case OPCODE_BITMAP: - _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i, + printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data); break; case OPCODE_CALL_LIST: - _mesa_printf("CallList %d\n", (int) n[1].ui); + printf("CallList %d\n", (int) n[1].ui); break; case OPCODE_CALL_LIST_OFFSET: - _mesa_printf("CallList %d + offset %u = %u\n", (int) n[1].ui, + printf("CallList %d + offset %u = %u\n", (int) n[1].ui, ctx->List.ListBase, ctx->List.ListBase + n[1].ui); break; case OPCODE_COLOR_TABLE_PARAMETER_FV: - _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n", + printf("ColorTableParameterfv %s %s %f %f %f %f\n", enum_string(n[1].e), enum_string(n[2].e), n[3].f, n[4].f, n[5].f, n[6].f); break; case OPCODE_COLOR_TABLE_PARAMETER_IV: - _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n", + printf("ColorTableParameteriv %s %s %d %d %d %d\n", enum_string(n[1].e), enum_string(n[2].e), n[3].i, n[4].i, n[5].i, n[6].i); break; case OPCODE_DISABLE: - _mesa_printf("Disable %s\n", enum_string(n[1].e)); + printf("Disable %s\n", enum_string(n[1].e)); break; case OPCODE_ENABLE: - _mesa_printf("Enable %s\n", enum_string(n[1].e)); + printf("Enable %s\n", enum_string(n[1].e)); break; case OPCODE_FRUSTUM: - _mesa_printf("Frustum %g %g %g %g %g %g\n", + printf("Frustum %g %g %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f); break; case OPCODE_LINE_STIPPLE: - _mesa_printf("LineStipple %d %x\n", n[1].i, (int) n[2].us); + printf("LineStipple %d %x\n", n[1].i, (int) n[2].us); break; case OPCODE_LOAD_IDENTITY: - _mesa_printf("LoadIdentity\n"); + printf("LoadIdentity\n"); break; case OPCODE_LOAD_MATRIX: - _mesa_printf("LoadMatrix\n"); - _mesa_printf(" %8f %8f %8f %8f\n", + printf("LoadMatrix\n"); + printf(" %8f %8f %8f %8f\n", n[1].f, n[5].f, n[9].f, n[13].f); - _mesa_printf(" %8f %8f %8f %8f\n", + printf(" %8f %8f %8f %8f\n", n[2].f, n[6].f, n[10].f, n[14].f); - _mesa_printf(" %8f %8f %8f %8f\n", + printf(" %8f %8f %8f %8f\n", n[3].f, n[7].f, n[11].f, n[15].f); - _mesa_printf(" %8f %8f %8f %8f\n", + printf(" %8f %8f %8f %8f\n", n[4].f, n[8].f, n[12].f, n[16].f); break; case OPCODE_MULT_MATRIX: - _mesa_printf("MultMatrix (or Rotate)\n"); - _mesa_printf(" %8f %8f %8f %8f\n", + printf("MultMatrix (or Rotate)\n"); + printf(" %8f %8f %8f %8f\n", n[1].f, n[5].f, n[9].f, n[13].f); - _mesa_printf(" %8f %8f %8f %8f\n", + printf(" %8f %8f %8f %8f\n", n[2].f, n[6].f, n[10].f, n[14].f); - _mesa_printf(" %8f %8f %8f %8f\n", + printf(" %8f %8f %8f %8f\n", n[3].f, n[7].f, n[11].f, n[15].f); - _mesa_printf(" %8f %8f %8f %8f\n", + printf(" %8f %8f %8f %8f\n", n[4].f, n[8].f, n[12].f, n[16].f); break; case OPCODE_ORTHO: - _mesa_printf("Ortho %g %g %g %g %g %g\n", + printf("Ortho %g %g %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f); break; case OPCODE_POP_ATTRIB: - _mesa_printf("PopAttrib\n"); + printf("PopAttrib\n"); break; case OPCODE_POP_MATRIX: - _mesa_printf("PopMatrix\n"); + printf("PopMatrix\n"); break; case OPCODE_POP_NAME: - _mesa_printf("PopName\n"); + printf("PopName\n"); break; case OPCODE_PUSH_ATTRIB: - _mesa_printf("PushAttrib %x\n", n[1].bf); + printf("PushAttrib %x\n", n[1].bf); break; case OPCODE_PUSH_MATRIX: - _mesa_printf("PushMatrix\n"); + printf("PushMatrix\n"); break; case OPCODE_PUSH_NAME: - _mesa_printf("PushName %d\n", (int) n[1].ui); + printf("PushName %d\n", (int) n[1].ui); break; case OPCODE_RASTER_POS: - _mesa_printf("RasterPos %g %g %g %g\n", + printf("RasterPos %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f); break; case OPCODE_ROTATE: - _mesa_printf("Rotate %g %g %g %g\n", + printf("Rotate %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f); break; case OPCODE_SCALE: - _mesa_printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f); + printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f); break; case OPCODE_TRANSLATE: - _mesa_printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f); + printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f); break; case OPCODE_BIND_TEXTURE: - _mesa_printf("BindTexture %s %d\n", + printf("BindTexture %s %d\n", _mesa_lookup_enum_by_nr(n[1].ui), n[2].ui); break; case OPCODE_SHADE_MODEL: - _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui)); + printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui)); break; case OPCODE_MAP1: - _mesa_printf("Map1 %s %.3f %.3f %d %d\n", + printf("Map1 %s %.3f %.3f %d %d\n", _mesa_lookup_enum_by_nr(n[1].ui), n[2].f, n[3].f, n[4].i, n[5].i); break; case OPCODE_MAP2: - _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n", + printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n", _mesa_lookup_enum_by_nr(n[1].ui), n[2].f, n[3].f, n[4].f, n[5].f, n[6].i, n[7].i, n[8].i, n[9].i); break; case OPCODE_MAPGRID1: - _mesa_printf("MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f); + printf("MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f); break; case OPCODE_MAPGRID2: - _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n", + printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f); break; case OPCODE_EVALMESH1: - _mesa_printf("EvalMesh1 %d %d\n", n[1].i, n[2].i); + printf("EvalMesh1 %d %d\n", n[1].i, n[2].i); break; case OPCODE_EVALMESH2: - _mesa_printf("EvalMesh2 %d %d %d %d\n", + printf("EvalMesh2 %d %d %d %d\n", n[1].i, n[2].i, n[3].i, n[4].i); break; case OPCODE_ATTR_1F_NV: - _mesa_printf("ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f); + printf("ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f); break; case OPCODE_ATTR_2F_NV: - _mesa_printf("ATTR_2F_NV attr %d: %f %f\n", + printf("ATTR_2F_NV attr %d: %f %f\n", n[1].i, n[2].f, n[3].f); break; case OPCODE_ATTR_3F_NV: - _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n", + printf("ATTR_3F_NV attr %d: %f %f %f\n", n[1].i, n[2].f, n[3].f, n[4].f); break; case OPCODE_ATTR_4F_NV: - _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n", + printf("ATTR_4F_NV attr %d: %f %f %f %f\n", n[1].i, n[2].f, n[3].f, n[4].f, n[5].f); break; case OPCODE_ATTR_1F_ARB: - _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f); + printf("ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f); break; case OPCODE_ATTR_2F_ARB: - _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n", + printf("ATTR_2F_ARB attr %d: %f %f\n", n[1].i, n[2].f, n[3].f); break; case OPCODE_ATTR_3F_ARB: - _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n", + printf("ATTR_3F_ARB attr %d: %f %f %f\n", n[1].i, n[2].f, n[3].f, n[4].f); break; case OPCODE_ATTR_4F_ARB: - _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n", + printf("ATTR_4F_ARB attr %d: %f %f %f %f\n", n[1].i, n[2].f, n[3].f, n[4].f, n[5].f); break; case OPCODE_MATERIAL: - _mesa_printf("MATERIAL %x %x: %f %f %f %f\n", + printf("MATERIAL %x %x: %f %f %f %f\n", n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f); break; case OPCODE_BEGIN: - _mesa_printf("BEGIN %x\n", n[1].i); + printf("BEGIN %x\n", n[1].i); break; case OPCODE_END: - _mesa_printf("END\n"); + printf("END\n"); break; case OPCODE_RECTF: - _mesa_printf("RECTF %f %f %f %f\n", n[1].f, n[2].f, n[3].f, + printf("RECTF %f %f %f %f\n", n[1].f, n[2].f, n[3].f, n[4].f); break; case OPCODE_EVAL_C1: - _mesa_printf("EVAL_C1 %f\n", n[1].f); + printf("EVAL_C1 %f\n", n[1].f); break; case OPCODE_EVAL_C2: - _mesa_printf("EVAL_C2 %f %f\n", n[1].f, n[2].f); + printf("EVAL_C2 %f %f\n", n[1].f, n[2].f); break; case OPCODE_EVAL_P1: - _mesa_printf("EVAL_P1 %d\n", n[1].i); + printf("EVAL_P1 %d\n", n[1].i); break; case OPCODE_EVAL_P2: - _mesa_printf("EVAL_P2 %d %d\n", n[1].i, n[2].i); + printf("EVAL_P2 %d %d\n", n[1].i, n[2].i); break; case OPCODE_PROVOKING_VERTEX: - _mesa_printf("ProvokingVertex %s\n", + printf("ProvokingVertex %s\n", _mesa_lookup_enum_by_nr(n[1].ui)); break; @@ -9539,26 +9539,26 @@ print_list(GLcontext *ctx, GLuint list) * meta opcodes/commands */ case OPCODE_ERROR: - _mesa_printf("Error: %s %s\n", + printf("Error: %s %s\n", enum_string(n[1].e), (const char *) n[2].data); break; case OPCODE_CONTINUE: - _mesa_printf("DISPLAY-LIST-CONTINUE\n"); + printf("DISPLAY-LIST-CONTINUE\n"); n = (Node *) n[1].next; break; case OPCODE_END_OF_LIST: - _mesa_printf("END-LIST %u\n", list); + printf("END-LIST %u\n", list); done = GL_TRUE; break; default: if (opcode < 0 || opcode > OPCODE_END_OF_LIST) { - _mesa_printf + printf ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n", opcode, (void *) n); return; } else { - _mesa_printf("command %d, %u operands\n", opcode, + printf("command %d, %u operands\n", opcode, InstSize[opcode]); } } diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index fc7f8beb50e..140902f6778 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -5216,7 +5216,7 @@ const char *_mesa_lookup_enum_by_nr( int nr ) } else { /* this is not re-entrant safe, no big deal here */ - _mesa_sprintf(token_tmp, "0x%x", nr); + sprintf(token_tmp, "0x%x", nr); return token_tmp; } } diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c index 07a7f9fed80..ccd6ab43fc1 100644 --- a/src/mesa/main/execmem.c +++ b/src/mesa/main/execmem.c @@ -106,7 +106,7 @@ _mesa_exec_malloc(GLuint size) if (block) addr = exec_mem + block->ofs; else - _mesa_printf("_mesa_exec_malloc failed\n"); + printf("_mesa_exec_malloc failed\n"); bail: _glthread_UNLOCK_MUTEX(exec_mutex); diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 0e6f69f573a..04ea3b4ed7c 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -374,8 +374,8 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, } if (texImage->Width < 1 || texImage->Height < 1) { att_incomplete("teximage width/height=0"); - _mesa_printf("texobj = %u\n", texObj->Name); - _mesa_printf("level = %d\n", att->TextureLevel); + printf("texobj = %u\n", texObj->Name); + printf("level = %d\n", att->TextureLevel); att->Complete = GL_FALSE; return; } @@ -2139,39 +2139,39 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, /* Debug code */ if (DEBUG_BLIT) { - _mesa_printf("glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d," - " 0x%x, 0x%x)\n", - srcX0, srcY0, srcX1, srcY1, - dstX0, dstY0, dstX1, dstY1, - mask, filter); + printf("glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d," + " 0x%x, 0x%x)\n", + srcX0, srcY0, srcX1, srcY1, + dstX0, dstY0, dstX1, dstY1, + mask, filter); if (colorReadRb) { const struct gl_renderbuffer_attachment *att; att = find_attachment(readFb, colorReadRb); - _mesa_printf(" Src FBO %u RB %u (%dx%d) ", - readFb->Name, colorReadRb->Name, - colorReadRb->Width, colorReadRb->Height); + printf(" Src FBO %u RB %u (%dx%d) ", + readFb->Name, colorReadRb->Name, + colorReadRb->Width, colorReadRb->Height); if (att && att->Texture) { - _mesa_printf("Tex %u tgt 0x%x level %u face %u", - att->Texture->Name, - att->Texture->Target, - att->TextureLevel, - att->CubeMapFace); + printf("Tex %u tgt 0x%x level %u face %u", + att->Texture->Name, + att->Texture->Target, + att->TextureLevel, + att->CubeMapFace); } - _mesa_printf("\n"); + printf("\n"); att = find_attachment(drawFb, colorDrawRb); - _mesa_printf(" Dst FBO %u RB %u (%dx%d) ", - drawFb->Name, colorDrawRb->Name, - colorDrawRb->Width, colorDrawRb->Height); + printf(" Dst FBO %u RB %u (%dx%d) ", + drawFb->Name, colorDrawRb->Name, + colorDrawRb->Width, colorDrawRb->Height); if (att && att->Texture) { - _mesa_printf("Tex %u tgt 0x%x level %u face %u", - att->Texture->Name, - att->Texture->Target, - att->TextureLevel, - att->CubeMapFace); + printf("Tex %u tgt 0x%x level %u face %u", + att->Texture->Name, + att->Texture->Target, + att->TextureLevel, + att->CubeMapFace); } - _mesa_printf("\n"); + printf("\n"); } } diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 48edec657bd..ba94a38770b 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -536,10 +536,10 @@ static void debug_insn( struct prog_instruction *inst, const char *fn, if (fn != last_fn) { last_fn = fn; - _mesa_printf("%s:\n", fn); + printf("%s:\n", fn); } - _mesa_printf("%d:\t", line); + printf("%d:\t", line); _mesa_print_instruction(inst); } } @@ -1577,7 +1577,7 @@ static void build_tnl_program( struct tnl_program *p ) /* Disassemble: */ if (DISASSEM) { - _mesa_printf ("\n"); + printf ("\n"); } } @@ -1647,7 +1647,7 @@ _mesa_get_fixed_func_vertex_program(GLcontext *ctx) if (!prog) { /* OK, we'll have to build a new one */ if (0) - _mesa_printf("Build new TNL program\n"); + printf("Build new TNL program\n"); prog = (struct gl_vertex_program *) ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0); diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 10224f78882..112490915f7 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -827,67 +827,6 @@ _mesa_str_checksum(const char *str) /*@}*/ -/**********************************************************************/ -/** \name I/O */ -/*@{*/ - -/** Wrapper around vsprintf() */ -int -_mesa_sprintf( char *str, const char *fmt, ... ) -{ - int r; - va_list args; - va_start( args, fmt ); - r = vsprintf( str, fmt, args ); - va_end( args ); - return r; -} - -/** Wrapper around vsnprintf() */ -int -_mesa_snprintf( char *str, size_t size, const char *fmt, ... ) -{ - int r; - va_list args; - va_start( args, fmt ); - r = vsnprintf( str, size, fmt, args ); - va_end( args ); - return r; -} - -/** Wrapper around printf(), using vsprintf() for the formatting. */ -void -_mesa_printf( const char *fmtString, ... ) -{ - va_list args; - va_start( args, fmtString ); - vfprintf(stderr, fmtString, args); - va_end( args ); -} - -/** Wrapper around fprintf(), using vsprintf() for the formatting. */ -void -_mesa_fprintf( FILE *f, const char *fmtString, ... ) -{ - char s[MAXSTRING]; - va_list args; - va_start( args, fmtString ); - vsnprintf(s, MAXSTRING, fmtString, args); - va_end( args ); - fprintf(f, "%s", s); -} - - -/** Wrapper around vsprintf() */ -int -_mesa_vsprintf( char *str, const char *fmt, va_list args ) -{ - return vsprintf( str, fmt, args ); -} - -/*@}*/ - - /**********************************************************************/ /** \name Diagnostics */ /*@{*/ @@ -927,7 +866,7 @@ output_if_debug(const char *prefixString, const char *outputString, * visible, so communicate with the debugger instead */ { char buf[4096]; - _mesa_snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : ""); + snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : ""); OutputDebugStringA(buf); } #endif @@ -976,7 +915,7 @@ flush_delayed_errors( GLcontext *ctx ) char s[MAXSTRING]; if (ctx->ErrorDebugCount) { - _mesa_snprintf(s, MAXSTRING, "%d similar %s errors", + snprintf(s, MAXSTRING, "%d similar %s errors", ctx->ErrorDebugCount, error_string(ctx->ErrorValue)); @@ -1083,7 +1022,7 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); - _mesa_snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s); + snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s); output_if_debug("Mesa: User error", s2, GL_TRUE); ctx->ErrorDebugFmtString = fmtString; diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 4eabdfdb0d2..a65c6a615fe 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -594,22 +594,6 @@ _mesa_strtod( const char *s, char **end ); extern unsigned int _mesa_str_checksum(const char *str); -extern int -_mesa_sprintf( char *str, const char *fmt, ... ); - -extern int -_mesa_snprintf( char *str, size_t size, const char *fmt, ... ); - -extern void -_mesa_printf( const char *fmtString, ... ); - -extern void -_mesa_fprintf( FILE *f, const char *fmtString, ... ); - -extern int -_mesa_vsprintf( char *str, const char *fmt, va_list args ); - - extern void _mesa_warning( __GLcontext *gc, const char *fmtString, ... ); diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 415abcdfa1e..355af56b411 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1115,7 +1115,7 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, */ /* - _mesa_printf("mip3d %d x %d x %d -> %d x %d x %d\n", + printf("mip3d %d x %d x %d -> %d x %d x %d\n", srcWidth, srcHeight, srcDepth, dstWidth, dstHeight, dstDepth); */ diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index e6f6add7688..f382680b443 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -489,7 +489,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, newSource = _mesa_read_shader(filename); if (newSource) { - _mesa_fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n", + fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n", shaderObj, checksum, filename); free(source); source = newSource; diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 5e07d1d2f15..589029db58b 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -682,7 +682,7 @@ _mesa_set_varying_vp_inputs( GLcontext *ctx, if (ctx->varying_vp_inputs != varying_inputs) { ctx->varying_vp_inputs = varying_inputs; ctx->NewState |= _NEW_ARRAY; - /*_mesa_printf("%s %x\n", __FUNCTION__, varying_inputs);*/ + /*printf("%s %x\n", __FUNCTION__, varying_inputs);*/ } } diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index f790fd6562e..7b8a8b85f22 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -1560,7 +1560,7 @@ create_new_program(GLcontext *ctx, struct state_key *key, if (DISASSEM) { _mesa_print_program(&p.program->Base); - _mesa_printf("\n"); + printf("\n"); } } diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 11e37dc34e5..00329c755d5 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1307,7 +1307,7 @@ texture_error_check( GLcontext *ctx, GLenum target, if (type != GL_UNSIGNED_SHORT_8_8_MESA && type != GL_UNSIGNED_SHORT_8_8_REV_MESA) { char message[100]; - _mesa_sprintf(message, + sprintf(message, "glTexImage%d(format/type YCBCR mismatch", dimensions); _mesa_error(ctx, GL_INVALID_ENUM, message); return GL_TRUE; /* error */ @@ -1323,7 +1323,7 @@ texture_error_check( GLcontext *ctx, GLenum target, if (border != 0) { if (!isProxy) { char message[100]; - _mesa_sprintf(message, + sprintf(message, "glTexImage%d(format=GL_YCBCR_MESA and border=%d)", dimensions, border); _mesa_error(ctx, GL_INVALID_VALUE, message); diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index feba6e95b6b..2753b55c36a 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -383,7 +383,7 @@ _mesa_reference_texobj(struct gl_texture_object **ptr, static void incomplete(const struct gl_texture_object *t, const char *why) { - _mesa_printf("Texture Obj %d incomplete because: %s\n", t->Name, why); + printf("Texture Obj %d incomplete because: %s\n", t->Name, why); } #else #define incomplete(t, why) @@ -416,7 +416,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, */ if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) { char s[100]; - _mesa_sprintf(s, "base level = %d is invalid", baseLevel); + sprintf(s, "base level = %d is invalid", baseLevel); incomplete(t, s); t->_Complete = GL_FALSE; return; @@ -425,7 +425,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, /* Always need the base level image */ if (!t->Image[0][baseLevel]) { char s[100]; - _mesa_sprintf(s, "Image[baseLevel=%d] == NULL", baseLevel); + sprintf(s, "Image[baseLevel=%d] == NULL", baseLevel); incomplete(t, s); t->_Complete = GL_FALSE; return; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 8c4399a430a..fce17c2b660 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -122,25 +122,25 @@ void _mesa_print_texunit_state( GLcontext *ctx, GLuint unit ) { const struct gl_texture_unit *texUnit = ctx->Texture.Unit + unit; - _mesa_printf("Texture Unit %d\n", unit); - _mesa_printf(" GL_TEXTURE_ENV_MODE = %s\n", _mesa_lookup_enum_by_nr(texUnit->EnvMode)); - _mesa_printf(" GL_COMBINE_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB)); - _mesa_printf(" GL_COMBINE_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA)); - _mesa_printf(" GL_SOURCE0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[0])); - _mesa_printf(" GL_SOURCE1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[1])); - _mesa_printf(" GL_SOURCE2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[2])); - _mesa_printf(" GL_SOURCE0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[0])); - _mesa_printf(" GL_SOURCE1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[1])); - _mesa_printf(" GL_SOURCE2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[2])); - _mesa_printf(" GL_OPERAND0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[0])); - _mesa_printf(" GL_OPERAND1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[1])); - _mesa_printf(" GL_OPERAND2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[2])); - _mesa_printf(" GL_OPERAND0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[0])); - _mesa_printf(" GL_OPERAND1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[1])); - _mesa_printf(" GL_OPERAND2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[2])); - _mesa_printf(" GL_RGB_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftRGB); - _mesa_printf(" GL_ALPHA_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftA); - _mesa_printf(" GL_TEXTURE_ENV_COLOR = (%f, %f, %f, %f)\n", texUnit->EnvColor[0], texUnit->EnvColor[1], texUnit->EnvColor[2], texUnit->EnvColor[3]); + printf("Texture Unit %d\n", unit); + printf(" GL_TEXTURE_ENV_MODE = %s\n", _mesa_lookup_enum_by_nr(texUnit->EnvMode)); + printf(" GL_COMBINE_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB)); + printf(" GL_COMBINE_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA)); + printf(" GL_SOURCE0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[0])); + printf(" GL_SOURCE1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[1])); + printf(" GL_SOURCE2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[2])); + printf(" GL_SOURCE0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[0])); + printf(" GL_SOURCE1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[1])); + printf(" GL_SOURCE2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[2])); + printf(" GL_OPERAND0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[0])); + printf(" GL_OPERAND1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[1])); + printf(" GL_OPERAND2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[2])); + printf(" GL_OPERAND0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[0])); + printf(" GL_OPERAND1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[1])); + printf(" GL_OPERAND2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[2])); + printf(" GL_RGB_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftRGB); + printf(" GL_ALPHA_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftA); + printf(" GL_TEXTURE_ENV_COLOR = (%f, %f, %f, %f)\n", texUnit->EnvColor[0], texUnit->EnvColor[1], texUnit->EnvColor[2], texUnit->EnvColor[3]); } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index bd63c77a392..65e3fcaa953 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -264,15 +264,15 @@ compute_component_mapping(GLenum inFormat, GLenum outFormat, map[ONE] = ONE; #if 0 - _mesa_printf("from %x/%s to %x/%s map %d %d %d %d %d %d\n", - inFormat, _mesa_lookup_enum_by_nr(inFormat), - outFormat, _mesa_lookup_enum_by_nr(outFormat), - map[0], - map[1], - map[2], - map[3], - map[4], - map[5]); + printf("from %x/%s to %x/%s map %d %d %d %d %d %d\n", + inFormat, _mesa_lookup_enum_by_nr(inFormat), + outFormat, _mesa_lookup_enum_by_nr(outFormat), + map[0], + map[1], + map[2], + map[3], + map[4], + map[5]); #endif } @@ -884,7 +884,7 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx, for (i = 0; i < 4; i++) map[i] = srctype2ubyte[swap[src2base[base2rgba[rgba2dst[i]]]]]; -/* _mesa_printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */ +/* printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */ if (srcComponents == dstComponents && srcRowStride == dstRowStride && diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 818ed792e3b..86878d6a8ac 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1083,14 +1083,14 @@ static void print_array(const char *name, GLint index, const struct gl_client_array *array) { if (index >= 0) - _mesa_printf(" %s[%d]: ", name, index); + printf(" %s[%d]: ", name, index); else - _mesa_printf(" %s: ", name); - _mesa_printf("Ptr=%p, Type=0x%x, Size=%d, ElemSize=%u, Stride=%d, Buffer=%u(Size %u), MaxElem=%u\n", - array->Ptr, array->Type, array->Size, - array->_ElementSize, array->StrideB, - array->BufferObj->Name, array->BufferObj->Size, - array->_MaxElement); + printf(" %s: ", name); + printf("Ptr=%p, Type=0x%x, Size=%d, ElemSize=%u, Stride=%d, Buffer=%u(Size %u), MaxElem=%u\n", + array->Ptr, array->Type, array->Size, + array->_ElementSize, array->StrideB, + array->BufferObj->Name, array->BufferObj->Size, + array->_MaxElement); } @@ -1105,7 +1105,7 @@ _mesa_print_arrays(GLcontext *ctx) _mesa_update_array_object_max_element(ctx, arrayObj); - _mesa_printf("Array Object %u\n", arrayObj->Name); + printf("Array Object %u\n", arrayObj->Name); if (arrayObj->Vertex.Enabled) print_array("Vertex", -1, &arrayObj->Vertex); if (arrayObj->Normal.Enabled) @@ -1118,7 +1118,7 @@ _mesa_print_arrays(GLcontext *ctx) for (i = 0; i < Elements(arrayObj->VertexAttrib); i++) if (arrayObj->VertexAttrib[i].Enabled) print_array("Attrib", i, &arrayObj->VertexAttrib[i]); - _mesa_printf(" _MaxElement = %u\n", arrayObj->_MaxElement); + printf(" _MaxElement = %u\n", arrayObj->_MaxElement); } diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index e474fe7fa51..0d01f160593 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -124,7 +124,7 @@ _mesa_compute_version(GLcontext *ctx) ctx->VersionString = (char *) malloc(max); if (ctx->VersionString) { - _mesa_snprintf(ctx->VersionString, max, "%u.%u Mesa " MESA_VERSION_STRING, - ctx->VersionMajor, ctx->VersionMinor); + snprintf(ctx->VersionString, max, "%u.%u Mesa " MESA_VERSION_STRING, + ctx->VersionMajor, ctx->VersionMinor); } } diff --git a/src/mesa/math/m_debug_clip.c b/src/mesa/math/m_debug_clip.c index 95ae5a347da..7ea5428aa26 100644 --- a/src/mesa/math/m_debug_clip.c +++ b/src/mesa/math/m_debug_clip.c @@ -270,20 +270,20 @@ static int test_cliptest_function( clip_func func, int np, } if ( dco != rco ) { - _mesa_printf( "\n-----------------------------\n" ); - _mesa_printf( "dco = 0x%02x rco = 0x%02x\n", dco, rco ); + printf( "\n-----------------------------\n" ); + printf( "dco = 0x%02x rco = 0x%02x\n", dco, rco ); return 0; } if ( dca != rca ) { - _mesa_printf( "\n-----------------------------\n" ); - _mesa_printf( "dca = 0x%02x rca = 0x%02x\n", dca, rca ); + printf( "\n-----------------------------\n" ); + printf( "dca = 0x%02x rca = 0x%02x\n", dca, rca ); return 0; } for ( i = 0 ; i < TEST_COUNT ; i++ ) { if ( dm[i] != rm[i] ) { - _mesa_printf( "\n-----------------------------\n" ); - _mesa_printf( "(i = %i)\n", i ); - _mesa_printf( "dm = 0x%02x rm = 0x%02x\n", dm[i], rm[i] ); + printf( "\n-----------------------------\n" ); + printf( "(i = %i)\n", i ); + printf( "dm = 0x%02x rm = 0x%02x\n", dm[i], rm[i] ); return 0; } } @@ -297,19 +297,19 @@ static int test_cliptest_function( clip_func func, int np, for ( i = 0 ; i < TEST_COUNT ; i++ ) { for ( j = 0 ; j < 4 ; j++ ) { if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) { - _mesa_printf( "\n-----------------------------\n" ); - _mesa_printf( "(i = %i, j = %i) dm = 0x%02x rm = 0x%02x\n", + printf( "\n-----------------------------\n" ); + printf( "(i = %i, j = %i) dm = 0x%02x rm = 0x%02x\n", i, j, dm[i], rm[i] ); - _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n", + printf( "%f \t %f \t [diff = %e - %i bit missed]\n", d[i][0], r[i][0], r[i][0]-d[i][0], MAX_PRECISION - significand_match( d[i][0], r[i][0] ) ); - _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n", + printf( "%f \t %f \t [diff = %e - %i bit missed]\n", d[i][1], r[i][1], r[i][1]-d[i][1], MAX_PRECISION - significand_match( d[i][1], r[i][1] ) ); - _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n", + printf( "%f \t %f \t [diff = %e - %i bit missed]\n", d[i][2], r[i][2], r[i][2]-d[i][2], MAX_PRECISION - significand_match( d[i][2], r[i][2] ) ); - _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n", + printf( "%f \t %f \t [diff = %e - %i bit missed]\n", d[i][3], r[i][3], r[i][3]-d[i][3], MAX_PRECISION - significand_match( d[i][3], r[i][3] ) ); return 0; @@ -335,19 +335,19 @@ void _math_test_all_cliptest_functions( char *description ) if ( mesa_profile ) { if ( !counter_overhead ) { INIT_COUNTER(); - _mesa_printf( "counter overhead: %ld cycles\n\n", counter_overhead ); + printf( "counter overhead: %ld cycles\n\n", counter_overhead ); } - _mesa_printf( "cliptest results after hooking in %s functions:\n", description ); + printf( "cliptest results after hooking in %s functions:\n", description ); } #endif #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) { - _mesa_printf( "\n\t" ); + printf( "\n\t" ); for ( psize = 2 ; psize <= 4 ; psize++ ) { - _mesa_printf( " p%d\t", psize ); + printf( " p%d\t", psize ); } - _mesa_printf( "\n--------------------------------------------------------\n\t" ); + printf( "\n--------------------------------------------------------\n\t" ); } #endif @@ -358,23 +358,23 @@ void _math_test_all_cliptest_functions( char *description ) if ( test_cliptest_function( func, np, psize, cycles ) == 0 ) { char buf[100]; - _mesa_sprintf( buf, "%s[%d] failed test (%s)", + sprintf( buf, "%s[%d] failed test (%s)", cnames[np], psize, description ); _mesa_problem( NULL, buf ); } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) - _mesa_printf( " %li\t", benchmark_tab[np][psize-1] ); + printf( " %li\t", benchmark_tab[np][psize-1] ); #endif } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) - _mesa_printf( " | [%s]\n\t", cstrings[np] ); + printf( " | [%s]\n\t", cstrings[np] ); #endif } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) - _mesa_printf( "\n" ); + printf( "\n" ); #endif } diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c index f9b26d80471..546e8641da4 100644 --- a/src/mesa/math/m_debug_norm.c +++ b/src/mesa/math/m_debug_norm.c @@ -294,15 +294,15 @@ static int test_norm_function( normal_func func, int mtype, long *cycles ) for ( i = 0 ; i < TEST_COUNT ; i++ ) { for ( j = 0 ; j < 3 ; j++ ) { if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) { - _mesa_printf( "-----------------------------\n" ); - _mesa_printf( "(i = %i, j = %i)\n", i, j ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", + printf( "-----------------------------\n" ); + printf( "(i = %i, j = %i)\n", i, j ); + printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", d[i][0], r[i][0], r[i][0]/d[i][0], MAX_PRECISION - significand_match( d[i][0], r[i][0] ) ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", + printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", d[i][1], r[i][1], r[i][1]/d[i][1], MAX_PRECISION - significand_match( d[i][1], r[i][1] ) ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", + printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", d[i][2], r[i][2], r[i][2]/d[i][2], MAX_PRECISION - significand_match( d[i][2], r[i][2] ) ); return 0; @@ -310,15 +310,15 @@ static int test_norm_function( normal_func func, int mtype, long *cycles ) if ( norm_normalize_types[mtype] != 0 ) { if ( significand_match( d2[i][j], r2[i][j] ) < REQUIRED_PRECISION ) { - _mesa_printf( "------------------- precalculated length case ------\n" ); - _mesa_printf( "(i = %i, j = %i)\n", i, j ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", + printf( "------------------- precalculated length case ------\n" ); + printf( "(i = %i, j = %i)\n", i, j ); + printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", d2[i][0], r2[i][0], r2[i][0]/d2[i][0], MAX_PRECISION - significand_match( d2[i][0], r2[i][0] ) ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", + printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", d2[i][1], r2[i][1], r2[i][1]/d2[i][1], MAX_PRECISION - significand_match( d2[i][1], r2[i][1] ) ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", + printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", d2[i][2], r2[i][2], r2[i][2]/d2[i][2], MAX_PRECISION - significand_match( d2[i][2], r2[i][2] ) ); return 0; @@ -346,11 +346,11 @@ void _math_test_all_normal_transform_functions( char *description ) if ( mesa_profile ) { if ( !counter_overhead ) { INIT_COUNTER(); - _mesa_printf( "counter overhead: %ld cycles\n\n", counter_overhead ); + printf( "counter overhead: %ld cycles\n\n", counter_overhead ); } - _mesa_printf( "normal transform results after hooking in %s functions:\n", + printf( "normal transform results after hooking in %s functions:\n", description ); - _mesa_printf( "\n-------------------------------------------------------\n" ); + printf( "\n-------------------------------------------------------\n" ); } #endif @@ -360,21 +360,21 @@ void _math_test_all_normal_transform_functions( char *description ) if ( test_norm_function( func, mtype, cycles ) == 0 ) { char buf[100]; - _mesa_sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)", + sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)", norm_strings[mtype], description ); _mesa_problem( NULL, buf ); } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) { - _mesa_printf( " %li\t", benchmark_tab[mtype] ); - _mesa_printf( " | [%s]\n", norm_strings[mtype] ); + printf( " %li\t", benchmark_tab[mtype] ); + printf( " | [%s]\n", norm_strings[mtype] ); } #endif } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) { - _mesa_printf( "\n" ); + printf( "\n" ); } #endif } diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c index df8cc066b6e..df1bc8aadfa 100644 --- a/src/mesa/math/m_debug_xform.c +++ b/src/mesa/math/m_debug_xform.c @@ -254,18 +254,18 @@ static int test_transform_function( transform_func func, int psize, for ( i = 0 ; i < TEST_COUNT ; i++ ) { for ( j = 0 ; j < 4 ; j++ ) { if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) { - _mesa_printf("-----------------------------\n" ); - _mesa_printf("(i = %i, j = %i)\n", i, j ); - _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n", + printf("-----------------------------\n" ); + printf("(i = %i, j = %i)\n", i, j ); + printf("%f \t %f \t [diff = %e - %i bit missed]\n", d[i][0], r[i][0], r[i][0]-d[i][0], MAX_PRECISION - significand_match( d[i][0], r[i][0] ) ); - _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n", + printf("%f \t %f \t [diff = %e - %i bit missed]\n", d[i][1], r[i][1], r[i][1]-d[i][1], MAX_PRECISION - significand_match( d[i][1], r[i][1] ) ); - _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n", + printf("%f \t %f \t [diff = %e - %i bit missed]\n", d[i][2], r[i][2], r[i][2]-d[i][2], MAX_PRECISION - significand_match( d[i][2], r[i][2] ) ); - _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n", + printf("%f \t %f \t [diff = %e - %i bit missed]\n", d[i][3], r[i][3], r[i][3]-d[i][3], MAX_PRECISION - significand_match( d[i][3], r[i][3] ) ); return 0; @@ -292,19 +292,19 @@ void _math_test_all_transform_functions( char *description ) if ( mesa_profile ) { if ( !counter_overhead ) { INIT_COUNTER(); - _mesa_printf("counter overhead: %lu cycles\n\n", counter_overhead ); + printf("counter overhead: %lu cycles\n\n", counter_overhead ); } - _mesa_printf("transform results after hooking in %s functions:\n", description ); + printf("transform results after hooking in %s functions:\n", description ); } #endif #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) { - _mesa_printf("\n" ); + printf("\n" ); for ( psize = 1 ; psize <= 4 ; psize++ ) { - _mesa_printf(" p%d\t", psize ); + printf(" p%d\t", psize ); } - _mesa_printf("\n--------------------------------------------------------\n" ); + printf("\n--------------------------------------------------------\n" ); } #endif @@ -315,23 +315,23 @@ void _math_test_all_transform_functions( char *description ) if ( test_transform_function( func, psize, mtype, cycles ) == 0 ) { char buf[100]; - _mesa_sprintf(buf, "_mesa_transform_tab[0][%d][%s] failed test (%s)", - psize, mstrings[mtype], description ); + sprintf(buf, "_mesa_transform_tab[0][%d][%s] failed test (%s)", + psize, mstrings[mtype], description ); _mesa_problem( NULL, buf ); } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) - _mesa_printf(" %li\t", benchmark_tab[psize-1][mtype] ); + printf(" %li\t", benchmark_tab[psize-1][mtype] ); #endif } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) - _mesa_printf(" | [%s]\n", mstrings[mtype] ); + printf(" | [%s]\n", mstrings[mtype] ); #endif } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) - _mesa_printf( "\n" ); + printf( "\n" ); #endif } diff --git a/src/mesa/math/m_vector.c b/src/mesa/math/m_vector.c index 4cbab11a358..65c381f383e 100644 --- a/src/mesa/math/m_vector.c +++ b/src/mesa/math/m_vector.c @@ -148,27 +148,27 @@ _mesa_vector4f_print( const GLvector4f *v, const GLubyte *cullmask, GLfloat *d = (GLfloat *)v->data; GLuint j, i = 0, count; - _mesa_printf("data-start\n"); + printf("data-start\n"); for (; d != v->start; STRIDE_F(d, v->stride), i++) - _mesa_printf(t, i, d[0], d[1], d[2], d[3]); + printf(t, i, d[0], d[1], d[2], d[3]); - _mesa_printf("start-count(%u)\n", v->count); + printf("start-count(%u)\n", v->count); count = i + v->count; if (culling) { for (; i < count; STRIDE_F(d, v->stride), i++) if (cullmask[i]) - _mesa_printf(t, i, d[0], d[1], d[2], d[3]); + printf(t, i, d[0], d[1], d[2], d[3]); } else { for (; i < count; STRIDE_F(d, v->stride), i++) - _mesa_printf(t, i, d[0], d[1], d[2], d[3]); + printf(t, i, d[0], d[1], d[2], d[3]); } for (j = v->size; j < 4; j++) { if ((v->flags & (1<data; i < count && d[j] == c[j]; @@ -177,9 +177,9 @@ _mesa_vector4f_print( const GLvector4f *v, const GLubyte *cullmask, } if (i == count) - _mesa_printf(" --> ok\n"); + printf(" --> ok\n"); else - _mesa_printf(" --> Failed at %u ******\n", i); + printf(" --> Failed at %u ******\n", i); } } } diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 03ff30a2394..6373529e4e8 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -148,7 +148,7 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, } #if DEBUG_FP - _mesa_printf("____________Fragment program %u ________\n", program->Base.Id); + printf("____________Fragment program %u ________\n", program->Base.Id); _mesa_print_program(&program->Base); #endif } @@ -211,7 +211,7 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, program->Base.Parameters = prog.Parameters; #if DEBUG_VP - _mesa_printf("____________Vertex program %u __________\n", program->Base.Id); + printf("____________Vertex program %u __________\n", program->Base.Id); _mesa_print_program(&program->Base); #endif } diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 4f02703619c..d03cb4e493b 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -200,7 +200,7 @@ do { \ #define RETURN_ERROR2(msg1, msg2) \ do { \ char err[1000]; \ - _mesa_sprintf(err, "%s %s", msg1, msg2); \ + sprintf(err, "%s %s", msg1, msg2); \ record_error(parseState, err, __LINE__); \ return GL_FALSE; \ } while(0) @@ -1566,9 +1566,9 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, #endif #ifdef DEBUG_foo - _mesa_printf("--- glLoadProgramNV(%d) result ---\n", program->Base.Id); + printf("--- glLoadProgramNV(%d) result ---\n", program->Base.Id); _mesa_fprint_program_opt(stdout, &program->Base, PROG_PRINT_NV, 0); - _mesa_printf("----------------------------------\n"); + printf("----------------------------------\n"); #endif } else { diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index fb36303bb97..631b315af3a 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -111,7 +111,7 @@ do { \ #define RETURN_ERROR2(msg1, msg2) \ do { \ char err[1000]; \ - _mesa_sprintf(err, "%s %s", msg1, msg2); \ + sprintf(err, "%s %s", msg1, msg2); \ record_error(parseState, err, __LINE__); \ return GL_FALSE; \ } while(0) @@ -1397,9 +1397,9 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, program->IsNVProgram = GL_TRUE; #ifdef DEBUG_foo - _mesa_printf("--- glLoadProgramNV result ---\n"); + printf("--- glLoadProgramNV result ---\n"); _mesa_fprint_program_opt(stdout, &program->Base, PROG_PRINT_NV, 0); - _mesa_printf("------------------------------\n"); + printf("------------------------------\n"); #endif if (program->Base.Parameters) diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index ee422e7ec8f..3b51f986e84 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -1782,8 +1782,8 @@ _mesa_execute_program(GLcontext * ctx, { GLfloat a[4]; fetch_vector4(&inst->SrcReg[0], machine, a); - _mesa_printf("%s%g, %g, %g, %g\n", (const char *) inst->Data, - a[0], a[1], a[2], a[3]); + printf("%s%g, %g, %g, %g\n", (const char *) inst->Data, + a[0], a[1], a[2], a[3]); } break; case OPCODE_END: diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index 81099cb99c5..e5534b20e34 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -345,7 +345,7 @@ _mesa_opcode_string(gl_inst_opcode opcode) return InstInfo[opcode].Name; else { static char s[20]; - _mesa_snprintf(s, sizeof(s), "OP%u", opcode); + snprintf(s, sizeof(s), "OP%u", opcode); return s; } } diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index 09816d5044d..2941a17da3f 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -159,7 +159,7 @@ _mesa_consolidate_registers(struct gl_program *prog) GLuint tempMax = 0, i; if (dbg) { - _mesa_printf("Optimize: Begin register consolidation\n"); + printf("Optimize: Begin register consolidation\n"); } memset(tempUsed, 0, sizeof(tempUsed)); @@ -196,7 +196,7 @@ _mesa_consolidate_registers(struct gl_program *prog) for (i = 0; i <= tempMax; i++) { if (tempUsed[i]) { tempMap[i] = freeTemp++; - /*_mesa_printf("replace %u with %u\n", i, tempMap[i]);*/ + /*printf("replace %u with %u\n", i, tempMap[i]);*/ } } if (freeTemp == tempMax + 1) { @@ -204,14 +204,14 @@ _mesa_consolidate_registers(struct gl_program *prog) return; } if (dbg) { - _mesa_printf("Replace regs 0..%u with 0..%u\n", tempMax, freeTemp-1); + printf("Replace regs 0..%u with 0..%u\n", tempMax, freeTemp-1); } } replace_regs(prog, PROGRAM_TEMPORARY, tempMap); if (dbg) { - _mesa_printf("Optimize: End register consolidation\n"); + printf("Optimize: End register consolidation\n"); } } @@ -232,7 +232,7 @@ _mesa_remove_dead_code(struct gl_program *prog) memset(tempRead, 0, sizeof(tempRead)); if (dbg) { - _mesa_printf("Optimize: Begin dead code removal\n"); + printf("Optimize: Begin dead code removal\n"); /*_mesa_print_program(prog);*/ } @@ -255,7 +255,7 @@ _mesa_remove_dead_code(struct gl_program *prog) if (inst->SrcReg[j].RelAddr) { if (dbg) - _mesa_printf("abort remove dead code (indirect temp)\n"); + printf("abort remove dead code (indirect temp)\n"); goto done; } @@ -290,7 +290,7 @@ _mesa_remove_dead_code(struct gl_program *prog) if (inst->DstReg.RelAddr) { if (dbg) - _mesa_printf("abort remove dead code (indirect temp)\n"); + printf("abort remove dead code (indirect temp)\n"); goto done; } @@ -319,7 +319,7 @@ _mesa_remove_dead_code(struct gl_program *prog) if (!tempRead[index][chan] && inst->DstReg.WriteMask & (1 << chan)) { if (dbg) { - _mesa_printf("Remove writemask on %u.%c\n", i, + printf("Remove writemask on %u.%c\n", i, chan == 3 ? 'w' : 'x' + chan); } inst->DstReg.WriteMask &= ~(1 << chan); @@ -330,7 +330,7 @@ _mesa_remove_dead_code(struct gl_program *prog) if (inst->DstReg.WriteMask == 0) { /* If we cleared all writes, the instruction can be removed. */ if (dbg) - _mesa_printf("Remove instruction %u: \n", i); + printf("Remove instruction %u: \n", i); removeInst[i] = GL_TRUE; } } @@ -340,9 +340,9 @@ _mesa_remove_dead_code(struct gl_program *prog) rem = remove_instructions(prog, removeInst); if (dbg) { - _mesa_printf("Optimize: End dead code removal.\n"); - _mesa_printf(" %u channel writes removed\n", rem); - _mesa_printf(" %u instructions removed\n", rem); + printf("Optimize: End dead code removal.\n"); + printf(" %u channel writes removed\n", rem); + printf(" %u instructions removed\n", rem); /*_mesa_print_program(prog);*/ } @@ -427,7 +427,7 @@ _mesa_remove_extra_move_use(struct gl_program *prog) GLuint i, j; if (dbg) { - _mesa_printf("Optimize: Begin remove extra move use\n"); + printf("Optimize: Begin remove extra move use\n"); _mesa_print_program(prog); } @@ -518,7 +518,7 @@ _mesa_remove_extra_move_use(struct gl_program *prog) } if (dbg) { - _mesa_printf("Optimize: End remove extra move use.\n"); + printf("Optimize: End remove extra move use.\n"); /*_mesa_print_program(prog);*/ } } @@ -533,7 +533,7 @@ _mesa_remove_extra_moves(struct gl_program *prog) GLuint i, rem, loopNesting = 0, subroutineNesting = 0; if (dbg) { - _mesa_printf("Optimize: Begin remove extra moves\n"); + printf("Optimize: Begin remove extra moves\n"); _mesa_print_program(prog); } @@ -605,8 +605,8 @@ _mesa_remove_extra_moves(struct gl_program *prog) removeInst[i] = GL_TRUE; if (dbg) { - _mesa_printf("Remove MOV at %u\n", i); - _mesa_printf("new prev inst %u: ", prevI); + printf("Remove MOV at %u\n", i); + printf("new prev inst %u: ", prevI); _mesa_print_instruction(prevInst); } } @@ -624,7 +624,7 @@ _mesa_remove_extra_moves(struct gl_program *prog) free(removeInst); if (dbg) { - _mesa_printf("Optimize: End remove extra moves. %u instructions removed\n", rem); + printf("Optimize: End remove extra moves. %u instructions removed\n", rem); /*_mesa_print_program(prog);*/ } } @@ -837,7 +837,7 @@ find_live_intervals(struct gl_program *prog, */ if (dbg) { - _mesa_printf("Optimize: Begin find intervals\n"); + printf("Optimize: Begin find intervals\n"); } /* build intermediate arrays */ @@ -864,16 +864,16 @@ find_live_intervals(struct gl_program *prog, /* print interval info */ for (i = 0; i < liveIntervals->Num; i++) { const struct interval *inv = liveIntervals->Intervals + i; - _mesa_printf("Reg[%d] live [%d, %d]:", + printf("Reg[%d] live [%d, %d]:", inv->Reg, inv->Start, inv->End); if (1) { GLuint j; for (j = 0; j < inv->Start; j++) - _mesa_printf(" "); + printf(" "); for (j = inv->Start; j <= inv->End; j++) - _mesa_printf("x"); + printf("x"); } - _mesa_printf("\n"); + printf("\n"); } } @@ -914,7 +914,7 @@ _mesa_reallocate_registers(struct gl_program *prog) GLint maxTemp = -1; if (dbg) { - _mesa_printf("Optimize: Begin live-interval register reallocation\n"); + printf("Optimize: Begin live-interval register reallocation\n"); _mesa_print_program(prog); } @@ -925,7 +925,7 @@ _mesa_reallocate_registers(struct gl_program *prog) if (!find_live_intervals(prog, &liveIntervals)) { if (dbg) - _mesa_printf("Aborting register reallocation\n"); + printf("Aborting register reallocation\n"); return; } @@ -938,7 +938,7 @@ _mesa_reallocate_registers(struct gl_program *prog) const struct interval *live = liveIntervals.Intervals + i; if (dbg) - _mesa_printf("Consider register %u\n", live->Reg); + printf("Consider register %u\n", live->Reg); /* Expire old intervals. Intervals which have ended with respect * to the live interval can have their remapped registers freed. @@ -959,7 +959,7 @@ _mesa_reallocate_registers(struct gl_program *prog) ASSERT(regNew >= 0); if (dbg) - _mesa_printf(" expire interval for reg %u\n", inv->Reg); + printf(" expire interval for reg %u\n", inv->Reg); /* remove interval j from active list */ remove_interval(&activeIntervals, inv); @@ -967,7 +967,7 @@ _mesa_reallocate_registers(struct gl_program *prog) /* return register regNew to the free pool */ if (dbg) - _mesa_printf(" free reg %d\n", regNew); + printf(" free reg %d\n", regNew); ASSERT(usedRegs[regNew] == GL_TRUE); usedRegs[regNew] = GL_FALSE; } @@ -984,7 +984,7 @@ _mesa_reallocate_registers(struct gl_program *prog) registerMap[live->Reg] = k; maxTemp = MAX2(maxTemp, k); if (dbg) - _mesa_printf(" remap register %u -> %d\n", live->Reg, k); + printf(" remap register %u -> %d\n", live->Reg, k); } /* Insert this live interval into the active list which is sorted @@ -1005,8 +1005,8 @@ _mesa_reallocate_registers(struct gl_program *prog) } if (dbg) { - _mesa_printf("Optimize: End live-interval register reallocation\n"); - _mesa_printf("Num temp regs before: %u after: %u\n", + printf("Optimize: End live-interval register reallocation\n"); + printf("Num temp regs before: %u after: %u\n", liveIntervals.Num, maxTemp + 1); _mesa_print_program(prog); } diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index b238537673e..a933f21857e 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -77,7 +77,7 @@ file_string(gl_register_file f, gl_prog_print_mode mode) default: { static char s[20]; - _mesa_snprintf(s, sizeof(s), "FILE%u", f); + snprintf(s, sizeof(s), "FILE%u", f); return s; } } @@ -172,12 +172,12 @@ arb_input_attrib_string(GLint index, GLenum progType) void _mesa_print_vp_inputs(GLbitfield inputs) { - _mesa_printf("VP Inputs 0x%x: \n", inputs); + printf("VP Inputs 0x%x: \n", inputs); while (inputs) { GLint attr = _mesa_ffs(inputs) - 1; const char *name = arb_input_attrib_string(attr, GL_VERTEX_PROGRAM_ARB); - _mesa_printf(" %d: %s\n", attr, name); + printf(" %d: %s\n", attr, name); inputs &= ~(1 << attr); } } @@ -190,12 +190,12 @@ _mesa_print_vp_inputs(GLbitfield inputs) void _mesa_print_fp_inputs(GLbitfield inputs) { - _mesa_printf("FP Inputs 0x%x: \n", inputs); + printf("FP Inputs 0x%x: \n", inputs); while (inputs) { GLint attr = _mesa_ffs(inputs) - 1; const char *name = arb_input_attrib_string(attr, GL_FRAGMENT_PROGRAM_ARB); - _mesa_printf(" %d: %s\n", attr, name); + printf(" %d: %s\n", attr, name); inputs &= ~(1 << attr); } } @@ -274,46 +274,46 @@ reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode, switch (mode) { case PROG_PRINT_DEBUG: - _mesa_sprintf(str, "%s[%s%d]", file_string(f, mode), addr, index); + sprintf(str, "%s[%s%d]", file_string(f, mode), addr, index); break; case PROG_PRINT_ARB: switch (f) { case PROGRAM_INPUT: - _mesa_sprintf(str, "%s", arb_input_attrib_string(index, prog->Target)); + sprintf(str, "%s", arb_input_attrib_string(index, prog->Target)); break; case PROGRAM_OUTPUT: - _mesa_sprintf(str, "%s", arb_output_attrib_string(index, prog->Target)); + sprintf(str, "%s", arb_output_attrib_string(index, prog->Target)); break; case PROGRAM_TEMPORARY: - _mesa_sprintf(str, "temp%d", index); + sprintf(str, "temp%d", index); break; case PROGRAM_ENV_PARAM: - _mesa_sprintf(str, "program.env[%s%d]", addr, index); + sprintf(str, "program.env[%s%d]", addr, index); break; case PROGRAM_LOCAL_PARAM: - _mesa_sprintf(str, "program.local[%s%d]", addr, index); + sprintf(str, "program.local[%s%d]", addr, index); break; case PROGRAM_VARYING: /* extension */ - _mesa_sprintf(str, "varying[%s%d]", addr, index); + sprintf(str, "varying[%s%d]", addr, index); break; case PROGRAM_CONSTANT: /* extension */ - _mesa_sprintf(str, "constant[%s%d]", addr, index); + sprintf(str, "constant[%s%d]", addr, index); break; case PROGRAM_UNIFORM: /* extension */ - _mesa_sprintf(str, "uniform[%s%d]", addr, index); + sprintf(str, "uniform[%s%d]", addr, index); break; case PROGRAM_STATE_VAR: { struct gl_program_parameter *param = prog->Parameters->Parameters + index; char *state = _mesa_program_state_string(param->StateIndexes); - _mesa_sprintf(str, state); + sprintf(str, state); free(state); } break; case PROGRAM_ADDRESS: - _mesa_sprintf(str, "A%d", index); + sprintf(str, "A%d", index); break; default: _mesa_problem(NULL, "bad file in reg_string()"); @@ -324,30 +324,30 @@ reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode, switch (f) { case PROGRAM_INPUT: if (prog->Target == GL_VERTEX_PROGRAM_ARB) - _mesa_sprintf(str, "v[%d]", index); + sprintf(str, "v[%d]", index); else - _mesa_sprintf(str, "f[%d]", index); + sprintf(str, "f[%d]", index); break; case PROGRAM_OUTPUT: - _mesa_sprintf(str, "o[%d]", index); + sprintf(str, "o[%d]", index); break; case PROGRAM_TEMPORARY: - _mesa_sprintf(str, "R%d", index); + sprintf(str, "R%d", index); break; case PROGRAM_ENV_PARAM: - _mesa_sprintf(str, "c[%d]", index); + sprintf(str, "c[%d]", index); break; case PROGRAM_VARYING: /* extension */ - _mesa_sprintf(str, "varying[%s%d]", addr, index); + sprintf(str, "varying[%s%d]", addr, index); break; case PROGRAM_UNIFORM: /* extension */ - _mesa_sprintf(str, "uniform[%s%d]", addr, index); + sprintf(str, "uniform[%s%d]", addr, index); break; case PROGRAM_CONSTANT: /* extension */ - _mesa_sprintf(str, "constant[%s%d]", addr, index); + sprintf(str, "constant[%s%d]", addr, index); break; case PROGRAM_STATE_VAR: /* extension */ - _mesa_sprintf(str, "state[%s%d]", addr, index); + sprintf(str, "state[%s%d]", addr, index); break; default: _mesa_problem(NULL, "bad file in reg_string()"); @@ -419,11 +419,11 @@ void _mesa_print_swizzle(GLuint swizzle) { if (swizzle == SWIZZLE_XYZW) { - _mesa_printf(".xyzw\n"); + printf(".xyzw\n"); } else { const char *s = _mesa_swizzle_string(swizzle, 0, 0); - _mesa_printf("%s\n", s); + printf("%s\n", s); } } @@ -476,23 +476,23 @@ fprint_dst_reg(FILE * f, gl_prog_print_mode mode, const struct gl_program *prog) { - _mesa_fprintf(f, "%s%s", - reg_string((gl_register_file) dstReg->File, - dstReg->Index, mode, dstReg->RelAddr, prog), - _mesa_writemask_string(dstReg->WriteMask)); - + fprintf(f, "%s%s", + reg_string((gl_register_file) dstReg->File, + dstReg->Index, mode, dstReg->RelAddr, prog), + _mesa_writemask_string(dstReg->WriteMask)); + if (dstReg->CondMask != COND_TR) { - _mesa_fprintf(f, " (%s.%s)", - _mesa_condcode_string(dstReg->CondMask), - _mesa_swizzle_string(dstReg->CondSwizzle, - GL_FALSE, GL_FALSE)); + fprintf(f, " (%s.%s)", + _mesa_condcode_string(dstReg->CondMask), + _mesa_swizzle_string(dstReg->CondSwizzle, + GL_FALSE, GL_FALSE)); } #if 0 - _mesa_fprintf(f, "%s[%d]%s", - file_string((gl_register_file) dstReg->File, mode), - dstReg->Index, - _mesa_writemask_string(dstReg->WriteMask)); + fprintf(f, "%s[%d]%s", + file_string((gl_register_file) dstReg->File, mode), + dstReg->Index, + _mesa_writemask_string(dstReg->WriteMask)); #endif } @@ -505,19 +505,19 @@ fprint_src_reg(FILE *f, { const char *abs = srcReg->Abs ? "|" : ""; - _mesa_fprintf(f, "%s%s%s%s", - abs, - reg_string((gl_register_file) srcReg->File, - srcReg->Index, mode, srcReg->RelAddr, prog), - _mesa_swizzle_string(srcReg->Swizzle, - srcReg->Negate, GL_FALSE), - abs); + fprintf(f, "%s%s%s%s", + abs, + reg_string((gl_register_file) srcReg->File, + srcReg->Index, mode, srcReg->RelAddr, prog), + _mesa_swizzle_string(srcReg->Swizzle, + srcReg->Negate, GL_FALSE), + abs); #if 0 - _mesa_fprintf(f, "%s[%d]%s", - file_string((gl_register_file) srcReg->File, mode), - srcReg->Index, - _mesa_swizzle_string(srcReg->Swizzle, - srcReg->Negate, GL_FALSE)); + fprintf(f, "%s[%d]%s", + file_string((gl_register_file) srcReg->File, mode), + srcReg->Index, + _mesa_swizzle_string(srcReg->Swizzle, + srcReg->Negate, GL_FALSE)); #endif } @@ -526,9 +526,9 @@ static void fprint_comment(FILE *f, const struct prog_instruction *inst) { if (inst->Comment) - _mesa_fprintf(f, "; # %s\n", inst->Comment); + fprintf(f, "; # %s\n", inst->Comment); else - _mesa_fprintf(f, ";\n"); + fprintf(f, ";\n"); } @@ -541,29 +541,29 @@ fprint_alu_instruction(FILE *f, { GLuint j; - _mesa_fprintf(f, "%s", opcode_string); + fprintf(f, "%s", opcode_string); if (inst->CondUpdate) - _mesa_fprintf(f, ".C"); + fprintf(f, ".C"); /* frag prog only */ if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_fprintf(f, "_SAT"); + fprintf(f, "_SAT"); - _mesa_fprintf(f, " "); + fprintf(f, " "); if (inst->DstReg.File != PROGRAM_UNDEFINED) { fprint_dst_reg(f, &inst->DstReg, mode, prog); } else { - _mesa_fprintf(f, " ???"); + fprintf(f, " ???"); } if (numRegs > 0) - _mesa_fprintf(f, ", "); + fprintf(f, ", "); for (j = 0; j < numRegs; j++) { fprint_src_reg(f, inst->SrcReg + j, mode, prog); if (j + 1 < numRegs) - _mesa_fprintf(f, ", "); + fprintf(f, ", "); } fprint_comment(f, inst); @@ -598,177 +598,177 @@ _mesa_fprint_instruction_opt(FILE *f, indent -= 3; } for (i = 0; i < indent; i++) { - _mesa_fprintf(f, " "); + fprintf(f, " "); } switch (inst->Opcode) { case OPCODE_PRINT: - _mesa_fprintf(f, "PRINT '%s'", inst->Data); + fprintf(f, "PRINT '%s'", inst->Data); if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { - _mesa_fprintf(f, ", "); - _mesa_fprintf(f, "%s[%d]%s", - file_string((gl_register_file) inst->SrcReg[0].File, - mode), - inst->SrcReg[0].Index, - _mesa_swizzle_string(inst->SrcReg[0].Swizzle, - inst->SrcReg[0].Negate, GL_FALSE)); + fprintf(f, ", "); + fprintf(f, "%s[%d]%s", + file_string((gl_register_file) inst->SrcReg[0].File, + mode), + inst->SrcReg[0].Index, + _mesa_swizzle_string(inst->SrcReg[0].Swizzle, + inst->SrcReg[0].Negate, GL_FALSE)); } if (inst->Comment) - _mesa_fprintf(f, " # %s", inst->Comment); + fprintf(f, " # %s", inst->Comment); fprint_comment(f, inst); break; case OPCODE_SWZ: - _mesa_fprintf(f, "SWZ"); + fprintf(f, "SWZ"); if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_fprintf(f, "_SAT"); - _mesa_fprintf(f, " "); + fprintf(f, "_SAT"); + fprintf(f, " "); fprint_dst_reg(f, &inst->DstReg, mode, prog); - _mesa_fprintf(f, ", %s[%d], %s", - file_string((gl_register_file) inst->SrcReg[0].File, - mode), - inst->SrcReg[0].Index, - _mesa_swizzle_string(inst->SrcReg[0].Swizzle, - inst->SrcReg[0].Negate, GL_TRUE)); + fprintf(f, ", %s[%d], %s", + file_string((gl_register_file) inst->SrcReg[0].File, + mode), + inst->SrcReg[0].Index, + _mesa_swizzle_string(inst->SrcReg[0].Swizzle, + inst->SrcReg[0].Negate, GL_TRUE)); fprint_comment(f, inst); break; case OPCODE_TEX: case OPCODE_TXP: case OPCODE_TXL: case OPCODE_TXB: - _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); + fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_fprintf(f, "_SAT"); - _mesa_fprintf(f, " "); + fprintf(f, "_SAT"); + fprintf(f, " "); fprint_dst_reg(f, &inst->DstReg, mode, prog); - _mesa_fprintf(f, ", "); + fprintf(f, ", "); fprint_src_reg(f, &inst->SrcReg[0], mode, prog); - _mesa_fprintf(f, ", texture[%d], ", inst->TexSrcUnit); + fprintf(f, ", texture[%d], ", inst->TexSrcUnit); switch (inst->TexSrcTarget) { - case TEXTURE_1D_INDEX: _mesa_fprintf(f, "1D"); break; - case TEXTURE_2D_INDEX: _mesa_fprintf(f, "2D"); break; - case TEXTURE_3D_INDEX: _mesa_fprintf(f, "3D"); break; - case TEXTURE_CUBE_INDEX: _mesa_fprintf(f, "CUBE"); break; - case TEXTURE_RECT_INDEX: _mesa_fprintf(f, "RECT"); break; + case TEXTURE_1D_INDEX: fprintf(f, "1D"); break; + case TEXTURE_2D_INDEX: fprintf(f, "2D"); break; + case TEXTURE_3D_INDEX: fprintf(f, "3D"); break; + case TEXTURE_CUBE_INDEX: fprintf(f, "CUBE"); break; + case TEXTURE_RECT_INDEX: fprintf(f, "RECT"); break; default: ; } if (inst->TexShadow) - _mesa_fprintf(f, " SHADOW"); + fprintf(f, " SHADOW"); fprint_comment(f, inst); break; case OPCODE_KIL: - _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); - _mesa_fprintf(f, " "); + fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); + fprintf(f, " "); fprint_src_reg(f, &inst->SrcReg[0], mode, prog); fprint_comment(f, inst); break; case OPCODE_KIL_NV: - _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); - _mesa_fprintf(f, " "); - _mesa_fprintf(f, "%s.%s", - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, - GL_FALSE, GL_FALSE)); + fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); + fprintf(f, " "); + fprintf(f, "%s.%s", + _mesa_condcode_string(inst->DstReg.CondMask), + _mesa_swizzle_string(inst->DstReg.CondSwizzle, + GL_FALSE, GL_FALSE)); fprint_comment(f, inst); break; case OPCODE_ARL: - _mesa_fprintf(f, "ARL "); + fprintf(f, "ARL "); fprint_dst_reg(f, &inst->DstReg, mode, prog); - _mesa_fprintf(f, ", "); + fprintf(f, ", "); fprint_src_reg(f, &inst->SrcReg[0], mode, prog); fprint_comment(f, inst); break; case OPCODE_BRA: - _mesa_fprintf(f, "BRA %d (%s%s)", - inst->BranchTarget, - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); + fprintf(f, "BRA %d (%s%s)", + inst->BranchTarget, + _mesa_condcode_string(inst->DstReg.CondMask), + _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); fprint_comment(f, inst); break; case OPCODE_IF: if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { /* Use ordinary register */ - _mesa_fprintf(f, "IF "); + fprintf(f, "IF "); fprint_src_reg(f, &inst->SrcReg[0], mode, prog); - _mesa_fprintf(f, "; "); + fprintf(f, "; "); } else { /* Use cond codes */ - _mesa_fprintf(f, "IF (%s%s);", - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, - 0, GL_FALSE)); + fprintf(f, "IF (%s%s);", + _mesa_condcode_string(inst->DstReg.CondMask), + _mesa_swizzle_string(inst->DstReg.CondSwizzle, + 0, GL_FALSE)); } - _mesa_fprintf(f, " # (if false, goto %d)", inst->BranchTarget); + fprintf(f, " # (if false, goto %d)", inst->BranchTarget); fprint_comment(f, inst); return indent + 3; case OPCODE_ELSE: - _mesa_fprintf(f, "ELSE; # (goto %d)\n", inst->BranchTarget); + fprintf(f, "ELSE; # (goto %d)\n", inst->BranchTarget); return indent + 3; case OPCODE_ENDIF: - _mesa_fprintf(f, "ENDIF;\n"); + fprintf(f, "ENDIF;\n"); break; case OPCODE_BGNLOOP: - _mesa_fprintf(f, "BGNLOOP; # (end at %d)\n", inst->BranchTarget); + fprintf(f, "BGNLOOP; # (end at %d)\n", inst->BranchTarget); return indent + 3; case OPCODE_ENDLOOP: - _mesa_fprintf(f, "ENDLOOP; # (goto %d)\n", inst->BranchTarget); + fprintf(f, "ENDLOOP; # (goto %d)\n", inst->BranchTarget); break; case OPCODE_BRK: case OPCODE_CONT: - _mesa_fprintf(f, "%s (%s%s); # (goto %d)", - _mesa_opcode_string(inst->Opcode), - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE), - inst->BranchTarget); + fprintf(f, "%s (%s%s); # (goto %d)", + _mesa_opcode_string(inst->Opcode), + _mesa_condcode_string(inst->DstReg.CondMask), + _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE), + inst->BranchTarget); fprint_comment(f, inst); break; case OPCODE_BGNSUB: if (mode == PROG_PRINT_NV) { - _mesa_fprintf(f, "%s:\n", inst->Comment); /* comment is label */ + fprintf(f, "%s:\n", inst->Comment); /* comment is label */ return indent; } else { - _mesa_fprintf(f, "BGNSUB"); + fprintf(f, "BGNSUB"); fprint_comment(f, inst); return indent + 3; } case OPCODE_ENDSUB: if (mode == PROG_PRINT_DEBUG) { - _mesa_fprintf(f, "ENDSUB"); + fprintf(f, "ENDSUB"); fprint_comment(f, inst); } break; case OPCODE_CAL: if (mode == PROG_PRINT_NV) { - _mesa_fprintf(f, "CAL %s; # (goto %d)\n", inst->Comment, inst->BranchTarget); + fprintf(f, "CAL %s; # (goto %d)\n", inst->Comment, inst->BranchTarget); } else { - _mesa_fprintf(f, "CAL %u", inst->BranchTarget); + fprintf(f, "CAL %u", inst->BranchTarget); fprint_comment(f, inst); } break; case OPCODE_RET: - _mesa_fprintf(f, "RET (%s%s)", - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); + fprintf(f, "RET (%s%s)", + _mesa_condcode_string(inst->DstReg.CondMask), + _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); fprint_comment(f, inst); break; case OPCODE_END: - _mesa_fprintf(f, "END\n"); + fprintf(f, "END\n"); break; case OPCODE_NOP: if (mode == PROG_PRINT_DEBUG) { - _mesa_fprintf(f, "NOP"); + fprintf(f, "NOP"); fprint_comment(f, inst); } else if (inst->Comment) { /* ARB/NV extensions don't have NOP instruction */ - _mesa_fprintf(f, "# %s\n", inst->Comment); + fprintf(f, "# %s\n", inst->Comment); } break; /* XXX may need other special-case instructions */ @@ -825,26 +825,26 @@ _mesa_fprint_program_opt(FILE *f, switch (prog->Target) { case GL_VERTEX_PROGRAM_ARB: if (mode == PROG_PRINT_ARB) - _mesa_fprintf(f, "!!ARBvp1.0\n"); + fprintf(f, "!!ARBvp1.0\n"); else if (mode == PROG_PRINT_NV) - _mesa_fprintf(f, "!!VP1.0\n"); + fprintf(f, "!!VP1.0\n"); else - _mesa_fprintf(f, "# Vertex Program/Shader %u\n", prog->Id); + fprintf(f, "# Vertex Program/Shader %u\n", prog->Id); break; case GL_FRAGMENT_PROGRAM_ARB: case GL_FRAGMENT_PROGRAM_NV: if (mode == PROG_PRINT_ARB) - _mesa_fprintf(f, "!!ARBfp1.0\n"); + fprintf(f, "!!ARBfp1.0\n"); else if (mode == PROG_PRINT_NV) - _mesa_fprintf(f, "!!FP1.0\n"); + fprintf(f, "!!FP1.0\n"); else - _mesa_fprintf(f, "# Fragment Program/Shader %u\n", prog->Id); + fprintf(f, "# Fragment Program/Shader %u\n", prog->Id); break; } for (i = 0; i < prog->NumInstructions; i++) { if (lineNumbers) - _mesa_fprintf(f, "%3d: ", i); + fprintf(f, "%3d: ", i); indent = _mesa_fprint_instruction_opt(f, prog->Instructions + i, indent, mode, prog); } @@ -896,30 +896,30 @@ _mesa_fprint_program_parameters(FILE *f, { GLuint i; - _mesa_fprintf(f, "InputsRead: 0x%x (0b%s)\n", + fprintf(f, "InputsRead: 0x%x (0b%s)\n", prog->InputsRead, binary(prog->InputsRead)); - _mesa_fprintf(f, "OutputsWritten: 0x%llx (0b%s)\n", + fprintf(f, "OutputsWritten: 0x%llx (0b%s)\n", prog->OutputsWritten, binary(prog->OutputsWritten)); - _mesa_fprintf(f, "NumInstructions=%d\n", prog->NumInstructions); - _mesa_fprintf(f, "NumTemporaries=%d\n", prog->NumTemporaries); - _mesa_fprintf(f, "NumParameters=%d\n", prog->NumParameters); - _mesa_fprintf(f, "NumAttributes=%d\n", prog->NumAttributes); - _mesa_fprintf(f, "NumAddressRegs=%d\n", prog->NumAddressRegs); - _mesa_fprintf(f, "SamplersUsed: 0x%x (0b%s)\n", + fprintf(f, "NumInstructions=%d\n", prog->NumInstructions); + fprintf(f, "NumTemporaries=%d\n", prog->NumTemporaries); + fprintf(f, "NumParameters=%d\n", prog->NumParameters); + fprintf(f, "NumAttributes=%d\n", prog->NumAttributes); + fprintf(f, "NumAddressRegs=%d\n", prog->NumAddressRegs); + fprintf(f, "SamplersUsed: 0x%x (0b%s)\n", prog->SamplersUsed, binary(prog->SamplersUsed)); - _mesa_fprintf(f, "Samplers=[ "); + fprintf(f, "Samplers=[ "); for (i = 0; i < MAX_SAMPLERS; i++) { - _mesa_fprintf(f, "%d ", prog->SamplerUnits[i]); + fprintf(f, "%d ", prog->SamplerUnits[i]); } - _mesa_fprintf(f, "]\n"); + fprintf(f, "]\n"); _mesa_load_state_parameters(ctx, prog->Parameters); #if 0 - _mesa_fprintf(f, "Local Params:\n"); + fprintf(f, "Local Params:\n"); for (i = 0; i < MAX_PROGRAM_LOCAL_PARAMS; i++){ const GLfloat *p = prog->LocalParams[i]; - _mesa_fprintf(f, "%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]); + fprintf(f, "%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]); } #endif _mesa_print_parameter_list(prog->Parameters); @@ -950,24 +950,24 @@ _mesa_fprint_parameter_list(FILE *f, return; if (0) - _mesa_fprintf(f, "param list %p\n", (void *) list); - _mesa_fprintf(f, "dirty state flags: 0x%x\n", list->StateFlags); + fprintf(f, "param list %p\n", (void *) list); + fprintf(f, "dirty state flags: 0x%x\n", list->StateFlags); for (i = 0; i < list->NumParameters; i++){ struct gl_program_parameter *param = list->Parameters + i; const GLfloat *v = list->ParameterValues[i]; - _mesa_fprintf(f, "param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}", - i, param->Size, - file_string(list->Parameters[i].Type, mode), - param->Name, v[0], v[1], v[2], v[3]); + fprintf(f, "param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}", + i, param->Size, + file_string(list->Parameters[i].Type, mode), + param->Name, v[0], v[1], v[2], v[3]); if (param->Flags & PROG_PARAM_BIT_CENTROID) - _mesa_fprintf(f, " Centroid"); + fprintf(f, " Centroid"); if (param->Flags & PROG_PARAM_BIT_INVARIANT) - _mesa_fprintf(f, " Invariant"); + fprintf(f, " Invariant"); if (param->Flags & PROG_PARAM_BIT_FLAT) - _mesa_fprintf(f, " Flat"); + fprintf(f, " Flat"); if (param->Flags & PROG_PARAM_BIT_LINEAR) - _mesa_fprintf(f, " Linear"); - _mesa_fprintf(f, "\n"); + fprintf(f, " Linear"); + fprintf(f, "\n"); } } @@ -997,7 +997,7 @@ _mesa_write_shader_to_file(const struct gl_shader *shader) else type = "vert"; - _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); + snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); f = fopen(filename, "w"); if (!f) { fprintf(stderr, "Unable to open %s for writing\n", filename); @@ -1047,7 +1047,7 @@ _mesa_append_uniforms_to_file(const struct gl_shader *shader, else type = "vert"; - _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); + snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); f = fopen(filename, "a"); /* append */ if (!f) { fprintf(stderr, "Unable to open %s for appending\n", filename); diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index 2c844490dd7..ead3ece95d4 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -950,7 +950,7 @@ static void append_index(char *dst, GLint index) { char s[20]; - _mesa_sprintf(s, "[%d]", index); + sprintf(s, "[%d]", index); append(dst, s); } @@ -1029,9 +1029,9 @@ _mesa_program_state_string(const gl_state_index state[STATE_LENGTH]) if (modifier) append_token(str, modifier); if (firstRow == lastRow) - _mesa_sprintf(tmp, ".row[%d]", firstRow); + sprintf(tmp, ".row[%d]", firstRow); else - _mesa_sprintf(tmp, ".row[%d..%d]", firstRow, lastRow); + sprintf(tmp, ".row[%d..%d]", firstRow, lastRow); append(str, tmp); } break; diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index e5ef25ec38a..3f26f9f84a7 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -2984,7 +2984,7 @@ yyreduce: { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { char s[100]; - _mesa_snprintf(s, sizeof(s), + snprintf(s, sizeof(s), "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; @@ -3001,7 +3001,7 @@ yyreduce: { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { char s[100]; - _mesa_snprintf(s, sizeof(s), + snprintf(s, sizeof(s), "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; @@ -4915,7 +4915,7 @@ yyreduce: if (exist != NULL) { char m[1000]; - _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", (yyvsp[(2) - (4)].string)); + snprintf(m, sizeof(m), "redeclared identifier: %s", (yyvsp[(2) - (4)].string)); free((yyvsp[(2) - (4)].string)); yyerror(& (yylsp[(2) - (4)]), state, m); YYERROR; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 299e2477e48..1c856d859d6 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -936,7 +936,7 @@ addrRegPosOffset: INTEGER { if (($1 < 0) || ($1 > 63)) { char s[100]; - _mesa_snprintf(s, sizeof(s), + snprintf(s, sizeof(s), "relative address offset too large (%d)", $1); yyerror(& @1, state, s); YYERROR; @@ -950,7 +950,7 @@ addrRegNegOffset: INTEGER { if (($1 < 0) || ($1 > 64)) { char s[100]; - _mesa_snprintf(s, sizeof(s), + snprintf(s, sizeof(s), "relative address offset too large (%d)", $1); yyerror(& @1, state, s); YYERROR; @@ -2173,7 +2173,7 @@ ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER if (exist != NULL) { char m[1000]; - _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", $2); + snprintf(m, sizeof(m), "redeclared identifier: %s", $2); free($2); yyerror(& @2, state, m); YYERROR; diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index ad3ff26c58f..8bd780b0b0f 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1483,12 +1483,12 @@ _mesa_link_program(GLcontext *ctx, GLuint program) if (0) { GLuint i; - _mesa_printf("Link %u shaders in program %u: %s\n", + printf("Link %u shaders in program %u: %s\n", shProg->NumShaders, shProg->Name, shProg->LinkStatus ? "Success" : "Failed"); for (i = 0; i < shProg->NumShaders; i++) { - _mesa_printf(" shader %u, type 0x%x\n", + printf(" shader %u, type 0x%x\n", shProg->Shaders[i]->Name, shProg->Shaders[i]->Type); } @@ -1504,7 +1504,7 @@ print_shader_info(const struct gl_shader_program *shProg) { GLuint i; - _mesa_printf("Mesa: glUseProgram(%u)\n", shProg->Name); + printf("Mesa: glUseProgram(%u)\n", shProg->Name); for (i = 0; i < shProg->NumShaders; i++) { const char *s; switch (shProg->Shaders[i]->Type) { @@ -1520,14 +1520,14 @@ print_shader_info(const struct gl_shader_program *shProg) default: s = ""; } - _mesa_printf(" %s shader %u, checksum %u\n", s, - shProg->Shaders[i]->Name, - shProg->Shaders[i]->SourceChecksum); + printf(" %s shader %u, checksum %u\n", s, + shProg->Shaders[i]->Name, + shProg->Shaders[i]->SourceChecksum); } if (shProg->VertexProgram) - _mesa_printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); + printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); if (shProg->FragmentProgram) - _mesa_printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); + printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); } @@ -1697,8 +1697,8 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, /* This maps a sampler to a texture unit: */ if (sampler < MAX_SAMPLERS) { #if 0 - _mesa_printf("Set program %p sampler %d '%s' to unit %u\n", - program, sampler, param->Name, texUnit); + printf("Set program %p sampler %d '%s' to unit %u\n", + program, sampler, param->Name, texUnit); #endif if (program->SamplerUnits[sampler] != texUnit) { program->SamplerUnits[sampler] = texUnit; @@ -1861,21 +1861,21 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, if (ctx->Shader.Flags & GLSL_UNIFORMS) { GLint i; - _mesa_printf("Mesa: set program %u uniform %s (loc %d) to: ", - shProg->Name, uniform->Name, location); + printf("Mesa: set program %u uniform %s (loc %d) to: ", + shProg->Name, uniform->Name, location); if (basicType == GL_INT) { const GLint *v = (const GLint *) values; for (i = 0; i < count * elems; i++) { - _mesa_printf("%d ", v[i]); + printf("%d ", v[i]); } } else { const GLfloat *v = (const GLfloat *) values; for (i = 0; i < count * elems; i++) { - _mesa_printf("%g ", v[i]); + printf("%g ", v[i]); } } - _mesa_printf("\n"); + printf("\n"); } /* A uniform var may be used by both a vertex shader and a fragment @@ -2076,9 +2076,9 @@ validate_samplers(GLcontext *ctx, const struct gl_program *prog, char *errMsg) unit = prog->SamplerUnits[sampler]; target = prog->SamplerTargets[sampler]; if (targetUsed[unit] != -1 && targetUsed[unit] != target) { - _mesa_snprintf(errMsg, 100, - "Texture unit %d is accessed both as %s and %s", - unit, targetName[targetUsed[unit]], targetName[target]); + snprintf(errMsg, 100, + "Texture unit %d is accessed both as %s and %s", + unit, targetName[targetUsed[unit]], targetName[target]); return GL_FALSE; } targetUsed[unit] = target; diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 6901b93d5de..b17256bb1e1 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1643,7 +1643,7 @@ _slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun, if (A->pragmas->Debug) { char s[1000]; - _mesa_snprintf(s, sizeof(s), "Call/inline %s()", (char *) fun->header.a_name); + snprintf(s, sizeof(s), "Call/inline %s()", (char *) fun->header.a_name); n->Comment = _slang_strdup(s); } @@ -2190,7 +2190,7 @@ _slang_make_array_constructor(slang_assemble_ctx *A, slang_operation *oper) */ slang_variable *p = slang_variable_scope_grow(fun->parameters); char name[10]; - _mesa_snprintf(name, sizeof(name), "p%d", i); + snprintf(name, sizeof(name), "p%d", i); p->a_name = slang_atom_pool_atom(A->atoms, name); p->type.qualifier = SLANG_QUAL_CONST; p->type.specifier.type = baseType; diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 8bd699ff9dc..52fe7868906 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -2303,8 +2303,8 @@ emit_var_ref(slang_emit_info *emitInfo, slang_ir_node *n) /* error */ char s[100]; /* XXX isn't this really an out of memory/resources error? */ - _mesa_snprintf(s, sizeof(s), "Undefined variable '%s'", - (char *) n->Var->a_name); + snprintf(s, sizeof(s), "Undefined variable '%s'", + (char *) n->Var->a_name); slang_info_log_error(emitInfo->log, s); return NULL; } diff --git a/src/mesa/shader/slang/slang_label.c b/src/mesa/shader/slang/slang_label.c index 7e00b5787fb..225612a9369 100644 --- a/src/mesa/shader/slang/slang_label.c +++ b/src/mesa/shader/slang/slang_label.c @@ -37,7 +37,7 @@ _slang_label_new_unique(const char *name) free(l); return NULL; } - _mesa_sprintf(l->Name, "%s_%d", name, id); + sprintf(l->Name, "%s_%d", name, id); id++; l->Location = -1; } diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 89658c1a398..b59fc0a43a9 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -139,16 +139,16 @@ link_varying_vars(GLcontext *ctx, } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_CENTROID)) { char msg[100]; - _mesa_snprintf(msg, sizeof(msg), - "centroid modifier mismatch for '%s'", var->Name); + snprintf(msg, sizeof(msg), + "centroid modifier mismatch for '%s'", var->Name); link_error(shProg, msg); free(map); return GL_FALSE; } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_INVARIANT)) { char msg[100]; - _mesa_snprintf(msg, sizeof(msg), - "invariant modifier mismatch for '%s'", var->Name); + snprintf(msg, sizeof(msg), + "invariant modifier mismatch for '%s'", var->Name); link_error(shProg, msg); free(map); return GL_FALSE; @@ -269,8 +269,8 @@ link_uniform_vars(GLcontext *ctx, GLuint newSampNum = *numSamplers; if (newSampNum >= ctx->Const.MaxTextureImageUnits) { char s[100]; - _mesa_sprintf(s, "Too many texture samplers (%u, max is %u)", - newSampNum, ctx->Const.MaxTextureImageUnits); + sprintf(s, "Too many texture samplers (%u, max is %u)", + newSampNum, ctx->Const.MaxTextureImageUnits); link_error(shProg, s); return GL_FALSE; } @@ -631,7 +631,7 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) } source[len] = '\0'; /* - _mesa_printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source); + printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source); */ free(shaderLengths); @@ -875,11 +875,11 @@ _slang_link(GLcontext *ctx, vertNotify = ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB, &shProg->FragmentProgram->Base); if (ctx->Shader.Flags & GLSL_DUMP) { - _mesa_printf("Mesa pre-link fragment program:\n"); + printf("Mesa pre-link fragment program:\n"); _mesa_print_program(&fragProg->Base); _mesa_print_program_parameters(ctx, &fragProg->Base); - _mesa_printf("Mesa post-link fragment program:\n"); + printf("Mesa post-link fragment program:\n"); _mesa_print_program(&shProg->FragmentProgram->Base); _mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base); } @@ -893,11 +893,11 @@ _slang_link(GLcontext *ctx, fragNotify = ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB, &shProg->VertexProgram->Base); if (ctx->Shader.Flags & GLSL_DUMP) { - _mesa_printf("Mesa pre-link vertex program:\n"); + printf("Mesa pre-link vertex program:\n"); _mesa_print_program(&vertProg->Base); _mesa_print_program_parameters(ctx, &vertProg->Base); - _mesa_printf("Mesa post-link vertex program:\n"); + printf("Mesa post-link vertex program:\n"); _mesa_print_program(&shProg->VertexProgram->Base); _mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base); } @@ -912,10 +912,10 @@ _slang_link(GLcontext *ctx, } if (ctx->Shader.Flags & GLSL_DUMP) { - _mesa_printf("Varying vars:\n"); + printf("Varying vars:\n"); _mesa_print_parameter_list(shProg->Varying); if (shProg->InfoLog) { - _mesa_printf("Info Log: %s\n", shProg->InfoLog); + printf("Info Log: %s\n", shProg->InfoLog); } } diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c index 23917fbd2cf..9ff21417bc5 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -86,7 +86,7 @@ slang_info_log_print(slang_info_log * log, const char *msg, ...) char buf[1024]; va_start(va, msg); - _mesa_vsprintf(buf, msg, va); + vsprintf(buf, msg, va); va_end(va); return slang_info_log_message(log, NULL, buf); } @@ -98,7 +98,7 @@ slang_info_log_error(slang_info_log * log, const char *msg, ...) char buf[1024]; va_start(va, msg); - _mesa_vsprintf(buf, msg, va); + vsprintf(buf, msg, va); va_end(va); log->error_flag = GL_TRUE; if (slang_info_log_message(log, "Error", buf)) @@ -114,7 +114,7 @@ slang_info_log_warning(slang_info_log * log, const char *msg, ...) char buf[1024]; va_start(va, msg); - _mesa_vsprintf(buf, msg, va); + vsprintf(buf, msg, va); va_end(va); if (slang_info_log_message(log, "Warning", buf)) return 1; diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index dc1e196bde5..e77404f6928 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -120,7 +120,7 @@ slang_string_pushi (slang_string *self, GLint i) { char buffer[12]; - _mesa_sprintf (buffer, "%d", i); + sprintf (buffer, "%d", i); slang_string_pushs (self, buffer, strlen (buffer)); } diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index 6a7ebff6cad..7806df4a531 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -143,7 +143,7 @@ void st_validate_state( struct st_context *st ) if (state->st == 0) return; - /*_mesa_printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st);*/ + /*printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st);*/ if (1) { /* Debug version which enforces various sanity checks on the @@ -158,17 +158,17 @@ void st_validate_state( struct st_context *st ) const struct st_tracked_state *atom = atoms[i]; struct st_state_flags generated; - /*_mesa_printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st);*/ + /*printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st);*/ if (!(atom->dirty.mesa || atom->dirty.st) || !atom->update) { - _mesa_printf("malformed atom %s\n", atom->name); + printf("malformed atom %s\n", atom->name); assert(0); } if (check_state(state, &atom->dirty)) { atoms[i]->update( st ); - /*_mesa_printf("after: %x\n", atom->dirty.mesa);*/ + /*printf("after: %x\n", atom->dirty.mesa);*/ } accumulate_state(&examined, &atom->dirty); @@ -181,7 +181,7 @@ void st_validate_state( struct st_context *st ) assert(!check_state(&examined, &generated)); prev = *state; } - /*_mesa_printf("\n");*/ + /*printf("\n");*/ } else { diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index 5411229d700..cff36042cbb 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -233,7 +233,7 @@ static const char *lineFuncName = NULL; #define USE(lineFunc) \ do { \ lineFuncName = #lineFunc; \ - /*_mesa_printf("%s\n", lineFuncName);*/ \ + /*printf("%s\n", lineFuncName);*/ \ swrast->Line = lineFunc; \ } while (0) diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 8a2787a139c..fdde294257e 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -413,12 +413,12 @@ void _tnl_draw_prims( GLcontext *ctx, if (0) { - _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); + printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); for (i = 0; i < nr_prims; i++) - _mesa_printf("prim %d: %s start %d count %d\n", i, - _mesa_lookup_enum_by_nr(prim[i].mode), - prim[i].start, - prim[i].count); + printf("prim %d: %s start %d count %d\n", i, + _mesa_lookup_enum_by_nr(prim[i].mode), + prim[i].start, + prim[i].count); } if (min_index) { diff --git a/src/mesa/tnl/t_vb_cliptmp.h b/src/mesa/tnl/t_vb_cliptmp.h index 618b8b31304..8cc36e666de 100644 --- a/src/mesa/tnl/t_vb_cliptmp.h +++ b/src/mesa/tnl/t_vb_cliptmp.h @@ -202,12 +202,12 @@ TAG(clip_tri)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLubyte mask ) if (0) { /* print pre-clip vertex coords */ GLuint i, j; - _mesa_printf("pre clip:\n"); + printf("pre clip:\n"); for (i = 0; i < n; i++) { j = inlist[i]; - _mesa_printf(" %u: %u: %f, %f, %f, %f\n", - i, j, - coord[j][0], coord[j][1], coord[j][2], coord[j][3]); + printf(" %u: %u: %f, %f, %f, %f\n", + i, j, + coord[j][0], coord[j][1], coord[j][2], coord[j][3]); assert(!IS_INF_OR_NAN(coord[j][0])); assert(!IS_INF_OR_NAN(coord[j][1])); assert(!IS_INF_OR_NAN(coord[j][2])); @@ -247,12 +247,12 @@ TAG(clip_tri)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLubyte mask ) if (0) { /* print post-clip vertex coords */ GLuint i, j; - _mesa_printf("post clip:\n"); + printf("post clip:\n"); for (i = 0; i < n; i++) { j = inlist[i]; - _mesa_printf(" %u: %u: %f, %f, %f, %f\n", - i, j, - coord[j][0], coord[j][1], coord[j][2], coord[j][3]); + printf(" %u: %u: %f, %f, %f, %f\n", + i, j, + coord[j][0], coord[j][1], coord[j][2], coord[j][3]); } } diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index ed66c35be79..b35d6a284e5 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -307,8 +307,8 @@ GLuint _tnl_install_attrs( GLcontext *ctx, const struct tnl_attr_map *map, const GLuint format = map[i].format; if (format == EMIT_PAD) { if (DBG) - _mesa_printf("%d: pad %d, offset %d\n", i, - map[i].offset, offset); + printf("%d: pad %d, offset %d\n", i, + map[i].offset, offset); offset += map[i].offset; @@ -338,9 +338,9 @@ GLuint _tnl_install_attrs( GLcontext *ctx, const struct tnl_attr_map *map, if (DBG) - _mesa_printf("%d: %s, vp %p, offset %d\n", i, - _tnl_format_info[format].name, (void *)vp, - vtx->attr[j].vertoffset); + printf("%d: %s, vp %p, offset %d\n", i, + _tnl_format_info[format].name, (void *)vp, + vtx->attr[j].vertoffset); offset += _tnl_format_info[format].attrsize; j++; diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c index 6436cbfc6ea..98058f3bdac 100644 --- a/src/mesa/tnl/t_vertex_sse.c +++ b/src/mesa/tnl/t_vertex_sse.c @@ -496,7 +496,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) update_src_ptr(p, srcECX, vtxESI, a); } else { - _mesa_printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize ); + printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize ); return GL_FALSE; } break; @@ -542,7 +542,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) j++; /* NOTE: two attrs consumed */ } else { - _mesa_printf("Can't emit 3ub\n"); + printf("Can't emit 3ub\n"); return GL_FALSE; /* add this later */ } break; @@ -590,12 +590,12 @@ static GLboolean build_vertex_emit( struct x86_program *p ) break; case GL_UNSIGNED_SHORT: default: - _mesa_printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE)); + printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE)); return GL_FALSE; } break; default: - _mesa_printf("unknown a[%d].format %d\n", j, a->format); + printf("unknown a[%d].format %d\n", j, a->format); return GL_FALSE; /* catch any new opcodes */ } diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index b10ee2105a3..aa7f1c40b1d 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -857,7 +857,7 @@ void vbo_exec_vtx_destroy( struct vbo_exec_context *exec ) void vbo_exec_BeginVertices( GLcontext *ctx ) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - if (0) _mesa_printf("%s\n", __FUNCTION__); + if (0) printf("%s\n", __FUNCTION__); vbo_exec_vtx_map( exec ); assert((exec->ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) == 0); @@ -892,10 +892,10 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) assert(exec->flush_call_depth == 1); #endif - if (0) _mesa_printf("%s\n", __FUNCTION__); + if (0) printf("%s\n", __FUNCTION__); if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { - if (0) _mesa_printf("%s - inside begin/end\n", __FUNCTION__); + if (0) printf("%s - inside begin/end\n", __FUNCTION__); #ifdef DEBUG exec->flush_call_depth--; assert(exec->flush_call_depth == 0); diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index f2f1674b6a7..90474da7c02 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -136,13 +136,13 @@ check_array_data(GLcontext *ctx, struct gl_client_array *array, for (k = 0; k < array->Size; k++) { if (IS_INF_OR_NAN(f[k]) || f[k] >= 1.0e20 || f[k] <= -1.0e10) { - _mesa_printf("Bad array data:\n"); - _mesa_printf(" Element[%u].%u = %f\n", j, k, f[k]); - _mesa_printf(" Array %u at %p\n", attrib, (void* ) array); - _mesa_printf(" Type 0x%x, Size %d, Stride %d\n", - array->Type, array->Size, array->Stride); - _mesa_printf(" Address/offset %p in Buffer Object %u\n", - array->Ptr, array->BufferObj->Name); + printf("Bad array data:\n"); + printf(" Element[%u].%u = %f\n", j, k, f[k]); + printf(" Array %u at %p\n", attrib, (void* ) array); + printf(" Type 0x%x, Size %d, Stride %d\n", + array->Type, array->Size, array->Stride); + printf(" Address/offset %p in Buffer Object %u\n", + array->Ptr, array->BufferObj->Name); f[k] = 1.0; /* XXX replace the bad value! */ } /*assert(!IS_INF_OR_NAN(f[k]));*/ @@ -257,21 +257,21 @@ print_draw_arrays(GLcontext *ctx, struct vbo_exec_context *exec, { int i; - _mesa_printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n", - mode, start, count); + printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n", + mode, start, count); for (i = 0; i < 32; i++) { GLuint bufName = exec->array.inputs[i]->BufferObj->Name; GLint stride = exec->array.inputs[i]->Stride; - _mesa_printf("attr %2d: size %d stride %d enabled %d " - "ptr %p Bufobj %u\n", - i, - exec->array.inputs[i]->Size, - stride, - /*exec->array.inputs[i]->Enabled,*/ - exec->array.legacy_array[i]->Enabled, - exec->array.inputs[i]->Ptr, - bufName); + printf("attr %2d: size %d stride %d enabled %d " + "ptr %p Bufobj %u\n", + i, + exec->array.inputs[i]->Size, + stride, + /*exec->array.inputs[i]->Enabled,*/ + exec->array.legacy_array[i]->Enabled, + exec->array.inputs[i]->Ptr, + bufName); if (bufName) { struct gl_buffer_object *buf = _mesa_lookup_bufferobj(ctx, bufName); @@ -284,9 +284,9 @@ print_draw_arrays(GLcontext *ctx, struct vbo_exec_context *exec, int n = (count * stride) / 4; if (n > 32) n = 32; - _mesa_printf(" Data at offset %d:\n", offset); + printf(" Data at offset %d:\n", offset); for (i = 0; i < n; i++) { - _mesa_printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]); + printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]); } ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, buf); } @@ -548,11 +548,11 @@ dump_element_buffer(GLcontext *ctx, GLenum type) const GLubyte *us = (const GLubyte *) map; GLint i; for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size; i++) { - _mesa_printf("%02x ", us[i]); + printf("%02x ", us[i]); if (i % 32 == 31) - _mesa_printf("\n"); + printf("\n"); } - _mesa_printf("\n"); + printf("\n"); } break; case GL_UNSIGNED_SHORT: @@ -560,11 +560,11 @@ dump_element_buffer(GLcontext *ctx, GLenum type) const GLushort *us = (const GLushort *) map; GLint i; for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 2; i++) { - _mesa_printf("%04x ", us[i]); + printf("%04x ", us[i]); if (i % 16 == 15) - _mesa_printf("\n"); + printf("\n"); } - _mesa_printf("\n"); + printf("\n"); } break; case GL_UNSIGNED_INT: @@ -572,11 +572,11 @@ dump_element_buffer(GLcontext *ctx, GLenum type) const GLuint *us = (const GLuint *) map; GLint i; for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 4; i++) { - _mesa_printf("%08x ", us[i]); + printf("%08x ", us[i]); if (i % 8 == 7) - _mesa_printf("\n"); + printf("\n"); } - _mesa_printf("\n"); + printf("\n"); } break; default: @@ -754,12 +754,12 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, end = ctx->Array.ArrayObj->_MaxElement - 1; } else if (0) { - _mesa_printf("glDraw[Range]Elements{,BaseVertex}" - "(start %u, end %u, type 0x%x, count %d) ElemBuf %u, " - "base %d\n", - start, end, type, count, - ctx->Array.ElementArrayBufferObj->Name, - basevertex); + printf("glDraw[Range]Elements{,BaseVertex}" + "(start %u, end %u, type 0x%x, count %d) ElemBuf %u, " + "base %d\n", + start, end, type, count, + ctx->Array.ElementArrayBufferObj->Name, + basevertex); } #if 0 diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 526bf7ae79c..045af46da8d 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -43,22 +43,22 @@ vbo_exec_debug_verts( struct vbo_exec_context *exec ) GLuint count = exec->vtx.vert_count; GLuint i; - _mesa_printf("%s: %u vertices %d primitives, %d vertsize\n", - __FUNCTION__, - count, - exec->vtx.prim_count, - exec->vtx.vertex_size); + printf("%s: %u vertices %d primitives, %d vertsize\n", + __FUNCTION__, + count, + exec->vtx.prim_count, + exec->vtx.vertex_size); for (i = 0 ; i < exec->vtx.prim_count ; i++) { struct _mesa_prim *prim = &exec->vtx.prim[i]; - _mesa_printf(" prim %d: %s%s %d..%d %s %s\n", - i, - _mesa_lookup_prim_by_nr(prim->mode), - prim->weak ? " (weak)" : "", - prim->start, - prim->start + prim->count, - prim->begin ? "BEGIN" : "(wrap)", - prim->end ? "END" : "(wrap)"); + printf(" prim %d: %s%s %d..%d %s %s\n", + i, + _mesa_lookup_prim_by_nr(prim->mode), + prim->weak ? " (weak)" : "", + prim->start, + prim->start + prim->count, + prim->begin ? "BEGIN" : "(wrap)", + prim->end ? "END" : "(wrap)"); } } @@ -343,7 +343,7 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec ) } if (0) - _mesa_printf("map %d..\n", exec->vtx.buffer_used); + printf("map %d..\n", exec->vtx.buffer_used); } @@ -378,8 +378,8 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ) } if (0) - _mesa_printf("%s %d %d\n", __FUNCTION__, exec->vtx.prim_count, - exec->vtx.vert_count); + printf("%s %d %d\n", __FUNCTION__, exec->vtx.prim_count, + exec->vtx.vert_count); vbo_context(ctx)->draw_prims( ctx, exec->vtx.inputs, diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/vbo/vbo_rebase.c index 1db36de3de2..ff7c7a6b0d5 100644 --- a/src/mesa/vbo/vbo_rebase.c +++ b/src/mesa/vbo/vbo_rebase.c @@ -124,7 +124,7 @@ void vbo_rebase_prims( GLcontext *ctx, assert(min_index != 0); if (0) - _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); + printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); /* XXX this path is disabled for now. diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index e1caa6f8c5f..3a64c0cf019 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -1185,10 +1185,10 @@ static void vbo_print_vertex_list( GLcontext *ctx, void *data ) GLuint i; (void) ctx; - _mesa_printf("VBO-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n", - node->count, - node->prim_count, - node->vertex_size); + printf("VBO-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n", + node->count, + node->prim_count, + node->vertex_size); for (i = 0 ; i < node->prim_count ; i++) { struct _mesa_prim *prim = &node->prim[i]; diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index d834fa1f2e7..a7cf29acd4f 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -243,7 +243,7 @@ void vbo_save_playback_vertex_list( GLcontext *ctx, void *data ) * includes operations such as glBegin or glDrawArrays. */ if (0) - _mesa_printf("displaylist recursive begin"); + printf("displaylist recursive begin"); vbo_save_loopback_vertex_list( ctx, node ); return; diff --git a/src/mesa/vbo/vbo_save_loopback.c b/src/mesa/vbo/vbo_save_loopback.c index f13a16e3b51..8d9ae307d67 100644 --- a/src/mesa/vbo/vbo_save_loopback.c +++ b/src/mesa/vbo/vbo_save_loopback.c @@ -95,12 +95,12 @@ static void loopback_prim( GLcontext *ctx, GLuint k; if (0) - _mesa_printf("loopback prim %s(%s,%s) verts %d..%d\n", - _mesa_lookup_prim_by_nr(prim->mode), - prim->begin ? "begin" : "..", - prim->end ? "end" : "..", - start, - end); + printf("loopback prim %s(%s,%s) verts %d..%d\n", + _mesa_lookup_prim_by_nr(prim->mode), + prim->begin ? "begin" : "..", + prim->end ? "end" : "..", + start, + end); if (prim->begin) { CALL_Begin(GET_DISPATCH(), ( prim->mode )); diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index 2fae267ff54..bce401744da 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -147,21 +147,21 @@ dump_draw_info(GLcontext *ctx, { GLuint i, j; - _mesa_printf("VBO Draw:\n"); + printf("VBO Draw:\n"); for (i = 0; i < nr_prims; i++) { - _mesa_printf("Prim %u of %u\n", i, nr_prims); - _mesa_printf(" Prim mode 0x%x\n", prims[i].mode); - _mesa_printf(" IB: %p\n", (void*) ib); + printf("Prim %u of %u\n", i, nr_prims); + printf(" Prim mode 0x%x\n", prims[i].mode); + printf(" IB: %p\n", (void*) ib); for (j = 0; j < VERT_ATTRIB_MAX; j++) { - _mesa_printf(" array %d at %p:\n", j, (void*) arrays[j]); - _mesa_printf(" enabled %d, ptr %p, size %d, type 0x%x, stride %d\n", - arrays[j]->Enabled, arrays[j]->Ptr, - arrays[j]->Size, arrays[j]->Type, arrays[j]->StrideB); + printf(" array %d at %p:\n", j, (void*) arrays[j]); + printf(" enabled %d, ptr %p, size %d, type 0x%x, stride %d\n", + arrays[j]->Enabled, arrays[j]->Ptr, + arrays[j]->Size, arrays[j]->Type, arrays[j]->StrideB); if (0) { GLint k = prims[i].start + prims[i].count - 1; GLfloat *last = (GLfloat *) (arrays[j]->Ptr + arrays[j]->Stride * k); - _mesa_printf(" last: %f %f %f\n", - last[0], last[1], last[2]); + printf(" last: %f %f %f\n", + last[0], last[1], last[2]); } } } @@ -235,7 +235,7 @@ elt(struct copy_context *copy, GLuint elt_idx) GLuint elt = copy->srcelt[elt_idx]; GLuint slot = elt & (ELT_TABLE_SIZE-1); -/* _mesa_printf("elt %d\n", elt); */ +/* printf("elt %d\n", elt); */ /* Look up the incoming element in the vertex cache. Re-emit if * necessary. @@ -244,7 +244,7 @@ elt(struct copy_context *copy, GLuint elt_idx) GLubyte *csr = copy->dstptr; GLuint i; -/* _mesa_printf(" --> emit to dstelt %d\n", copy->dstbuf_nr); */ +/* printf(" --> emit to dstelt %d\n", copy->dstbuf_nr); */ for (i = 0; i < copy->nr_varying; i++) { const struct gl_client_array *srcarray = copy->varying[i].array; @@ -268,10 +268,10 @@ elt(struct copy_context *copy, GLuint elt_idx) { const GLuint *f = (const GLuint *)srcptr; GLuint j; - _mesa_printf(" varying %d: ", i); + printf(" varying %d: ", i); for(j = 0; j < copy->varying[i].size / 4; j++) - _mesa_printf("%x ", f[j]); - _mesa_printf("\n"); + printf("%x ", f[j]); + printf("\n"); } } @@ -284,9 +284,9 @@ elt(struct copy_context *copy, GLuint elt_idx) copy->dstbuf_nr * copy->vertex_size)); } /* else */ -/* _mesa_printf(" --> reuse vertex\n"); */ +/* printf(" --> reuse vertex\n"); */ -/* _mesa_printf(" --> emit %d\n", copy->vert_cache[slot].out); */ +/* printf(" --> emit %d\n", copy->vert_cache[slot].out); */ copy->dstelt[copy->dstelt_nr++] = copy->vert_cache[slot].out; return check_flush(copy); } @@ -300,7 +300,7 @@ end( struct copy_context *copy, GLboolean end_flag ) { struct _mesa_prim *prim = ©->dstprim[copy->dstprim_nr]; -/* _mesa_printf("end (%d)\n", end_flag); */ +/* printf("end (%d)\n", end_flag); */ prim->end = end_flag; prim->count = copy->dstelt_nr - prim->start; diff --git a/src/mesa/vf/vf.c b/src/mesa/vf/vf.c index dab436e2abe..defb7cbe2c6 100644 --- a/src/mesa/vf/vf.c +++ b/src/mesa/vf/vf.c @@ -162,8 +162,8 @@ GLuint vf_set_vertex_attributes( struct vertex_fetch *vf, const GLuint format = map[i].format; if (format == EMIT_PAD) { if (DBG) - _mesa_printf("%d: pad %d, offset %d\n", i, - map[i].offset, offset); + printf("%d: pad %d, offset %d\n", i, + map[i].offset, offset); offset += map[i].offset; @@ -180,9 +180,9 @@ GLuint vf_set_vertex_attributes( struct vertex_fetch *vf, vf->attr[j].vertoffset = offset; if (DBG) - _mesa_printf("%d: %s, offset %d\n", i, - vf_format_info[format].name, - vf->attr[j].vertoffset); + printf("%d: %s, offset %d\n", i, + vf_format_info[format].name, + vf->attr[j].vertoffset); offset += vf_format_info[format].attrsize; j++; diff --git a/src/mesa/vf/vf_sse.c b/src/mesa/vf/vf_sse.c index 04275903c93..7b947b74a65 100644 --- a/src/mesa/vf/vf_sse.c +++ b/src/mesa/vf/vf_sse.c @@ -482,7 +482,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) update_src_ptr(p, srcECX, vfESI, a); } else { - _mesa_printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize ); + printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize ); return GL_FALSE; } break; @@ -527,7 +527,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) j++; /* NOTE: two attrs consumed */ } else { - _mesa_printf("Can't emit 3ub\n"); + printf("Can't emit 3ub\n"); } return GL_FALSE; /* add this later */ break; @@ -575,12 +575,12 @@ static GLboolean build_vertex_emit( struct x86_program *p ) break; case GL_UNSIGNED_SHORT: default: - _mesa_printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE)); + printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE)); return GL_FALSE; } break; default: - _mesa_printf("unknown a[%d].format %d\n", j, a->format); + printf("unknown a[%d].format %d\n", j, a->format); return GL_FALSE; /* catch any new opcodes */ } diff --git a/src/mesa/x86/rtasm/x86sse.c b/src/mesa/x86/rtasm/x86sse.c index 647be995c12..c93faba7928 100644 --- a/src/mesa/x86/rtasm/x86sse.c +++ b/src/mesa/x86/rtasm/x86sse.c @@ -1184,7 +1184,7 @@ void x86_release_func( struct x86_function *p ) void (*x86_get_func( struct x86_function *p ))(void) { if (DISASSEM && p->store) - _mesa_printf("disassemble %p %p\n", p->store, p->csr); + printf("disassemble %p %p\n", p->store, p->csr); return (void (*)(void)) (unsigned long) p->store; } -- cgit v1.2.3