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
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to