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

Matt Turner mattst88 at gmail.com
Mon Dec 8 13:43:34 PST 2014


On Mon, Dec 8, 2014 at 1:39 PM, Ian Romanick <idr at freedesktop.org> wrote:
> 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?

Indeed! Dead since 2010 in fact (commit 284ce209).

I'll send another patch.


More information about the mesa-dev mailing list