diff options
author | Brian Paul <[email protected]> | 2015-03-07 13:15:22 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2015-03-11 09:34:24 -0600 |
commit | d7193ce42cedc4cc7839fc4522edf5724e954c80 (patch) | |
tree | b24eb2b2fd2d0df24423fac7858fdbd76db191ac /src/mesa/program | |
parent | 5376bc74ccfac0d1a4df6c5652e075d99e3f4fe4 (diff) |
mesa: use strdup() instead of _mesa_strdup()
We were already using strdup() in various places in Mesa. Get rid
of the _mesa_strdup() wrapper. All the callers pass a non-NULL
argument so the NULL check isn't needed either.
Reviewed-by: Jose Fonseca <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/program')
-rw-r--r-- | src/mesa/program/prog_instruction.c | 2 | ||||
-rw-r--r-- | src/mesa/program/prog_parameter.c | 2 | ||||
-rw-r--r-- | src/mesa/program/prog_statevars.c | 2 | ||||
-rw-r--r-- | src/mesa/program/program.c | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/program/prog_instruction.c b/src/mesa/program/prog_instruction.c index 6a9bcb7b579..f9ebe4e8fd2 100644 --- a/src/mesa/program/prog_instruction.c +++ b/src/mesa/program/prog_instruction.c @@ -89,7 +89,7 @@ _mesa_copy_instructions(struct prog_instruction *dest, 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); + dest[i].Comment = strdup(src[i].Comment); } return dest; } diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c index 5939f6f72ec..cdfe25145fb 100644 --- a/src/mesa/program/prog_parameter.c +++ b/src/mesa/program/prog_parameter.c @@ -148,7 +148,7 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList, for (i = 0; i < sz4; i++) { struct gl_program_parameter *p = paramList->Parameters + oldNum + i; - p->Name = name ? _mesa_strdup(name) : NULL; + p->Name = name ? strdup(name) : NULL; p->Type = type; p->Size = size; p->DataType = datatype; diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c index 57b25a7e3b1..0c0c87faa28 100644 --- a/src/mesa/program/prog_statevars.c +++ b/src/mesa/program/prog_statevars.c @@ -1045,7 +1045,7 @@ _mesa_program_state_string(const gl_state_index state[STATE_LENGTH]) break; } - return _mesa_strdup(str); + return strdup(str); } diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c index 61a9e97c9f8..3c214d5e361 100644 --- a/src/mesa/program/program.c +++ b/src/mesa/program/program.c @@ -79,7 +79,7 @@ _mesa_init_program(struct gl_context *ctx) STATIC_ASSERT(NUM_TEXTURE_TARGETS <= (1 << 4)); ctx->Program.ErrorPos = -1; - ctx->Program.ErrorString = _mesa_strdup(""); + ctx->Program.ErrorString = strdup(""); ctx->VertexProgram.Enabled = GL_FALSE; ctx->VertexProgram.PointSizeEnabled = @@ -176,7 +176,7 @@ _mesa_set_program_error(struct gl_context *ctx, GLint pos, const char *string) free((void *) ctx->Program.ErrorString); if (!string) string = ""; - ctx->Program.ErrorString = _mesa_strdup(string); + ctx->Program.ErrorString = strdup(string); } @@ -483,7 +483,7 @@ _mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog) assert(clone->Target == prog->Target); assert(clone->RefCount == 1); - clone->String = (GLubyte *) _mesa_strdup((char *) prog->String); + clone->String = (GLubyte *) strdup((char *) prog->String); clone->Format = prog->Format; clone->Instructions = _mesa_alloc_instructions(prog->NumInstructions); if (!clone->Instructions) { |