[Mesa-dev] [PATCH 3/3] Don't cast the return value of malloc/realloc

Ian Romanick idr at freedesktop.org
Mon Dec 8 13:39:17 PST 2014


On 12/08/2014 11:56 AM, Matt Turner wrote:

> diff --git a/src/mesa/program/prog_instruction.c b/src/mesa/program/prog_instruction.c
> index 976024e..c1b9527 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));
>  }

I don't see any callers of this function.  Delete it instead?



More information about the mesa-dev mailing list