Jason Ekstrand <ja...@jlekstrand.net> writes:

> On Mon, Jan 26, 2015 at 11:21 AM, Eric Anholt <e...@anholt.net> wrote:
>
>> Jason Ekstrand <ja...@jlekstrand.net> writes:
>> > +      case nir_instr_type_phi: {
>> > +         nir_phi_instr *src_phi = nir_instr_as_phi(src_instr);
>> > +
>> > +         /* Insert an entry and mark it as scalarizable for now. That
>> way
>> > +          * we don't recurse forever and a cycle in the depencence graph
>> > +          * won't automatically make us fail to scalarize.
>> > +          */
>> > +         entry = _mesa_hash_table_insert(state->phi_table, src_phi,
>> (void *)1);
>>
>> I expect "(void *)1" will give compiler warnings generally.  "(void
>> *)(uintptr_t)1" is the usual workaround.
>>
>> Useful comment, though!
>>
>> > +         bool scalarizable = should_lower_phi(src_phi, state);
>> > +         entry->data = (void *)scalarizable;
>>
>> No need to cast to void *, since not C++.
>>
>
> I'm confused.  You want more casting above but less here?  Could you pleas
> be a little more specific.

Yes, you have to add the cast above to avoid a compiler warning about
casting from a small int to a pointer, while casting to void * to assign
to a void * is only a c++ism

Attachment: signature.asc
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to