[Mesa-dev] [PATCH] glsl: fix variable ordering in the output_read_remover
Tolga Dalman
tolga.dalman at googlemail.com
Tue Apr 3 06:38:16 PDT 2012
Hi Vadim,
On 03.04.2012 15:29, Vadim Girlin wrote:
> On Mon, 2012-04-02 at 13:19 +0200, Tolga Dalman wrote:
>>> +static unsigned
>>> +hash_table_var_hash(const void *key)
>>> +{
>>> + ir_variable *var = (ir_variable*) key;
>>
>> Why not use const ir_variable instead ? In that case the cast
>> wouldn't be necessary I suppose.
>
> Sorry, I don't understand what exactly you're suggesting to change.
>
> "const ir_variable *var = key;" ?
>
> Build fails with:
> "error: invalid conversion from ‘const void*’ to ‘const ir_variable*’ [-fpermissive]"
Indeed, that only works in plain C, not C++. Nevertheless, I meant something like:
const ir_variable *var = (const ir_variable*) key;
or even better:
const ir_variable *var = static_cast<const ir_variable*>(key);
Best regards
Tolga Dalman
More information about the mesa-dev
mailing list