diff options
author | Matt Turner <[email protected]> | 2014-09-21 21:24:01 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2014-12-08 17:02:19 -0800 |
commit | 8af4aaf351313f9d4692697bf28d3c3f84e01ca4 (patch) | |
tree | 3d7fdabf8fc729efef9d011ac583acd0b7ae8e3d /src/mesa/program | |
parent | f0a8bcd84e50468a703a0ac366a4e067610df30c (diff) |
Don't cast the return value of malloc/realloc
See commit 2b7a972e for the Coccinelle script.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/program')
-rw-r--r-- | src/mesa/program/prog_instruction.c | 8 | ||||
-rw-r--r-- | src/mesa/program/prog_parameter.c | 2 |
2 files changed, 2 insertions, 8 deletions
diff --git a/src/mesa/program/prog_instruction.c b/src/mesa/program/prog_instruction.c index 976024e3c7b..c1b952754f1 100644 --- a/src/mesa/program/prog_instruction.c +++ b/src/mesa/program/prog_instruction.c @@ -87,13 +87,7 @@ struct prog_instruction * _mesa_realloc_instructions(struct prog_instruction *oldInst, GLuint numOldInst, GLuint numNewInst) { - struct prog_instruction *newInst; - - newInst = (struct prog_instruction *) - realloc(oldInst, - numNewInst * sizeof(struct prog_instruction)); - - return newInst; + return realloc(oldInst, numNewInst * sizeof(struct prog_instruction)); } diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c index 896c6052b84..0ef46415d9f 100644 --- a/src/mesa/program/prog_parameter.c +++ b/src/mesa/program/prog_parameter.c @@ -120,7 +120,7 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList, paramList->Size = paramList->Size + 4 * sz4; /* realloc arrays */ - paramList->Parameters = (struct gl_program_parameter *) + paramList->Parameters = realloc(paramList->Parameters, paramList->Size * sizeof(struct gl_program_parameter)); |