[Mesa-dev] [PATCH] gallium: fix type of flags in pipe_context::flush()

Chia-I Wu olvaffe at gmail.com
Fri May 3 08:27:22 PDT 2013


On Fri, May 3, 2013 at 4:00 PM, Jose Fonseca <jfonseca at vmware.com> wrote:
> ----- Original Message -----
>> It should be unsigned, not enum pipe_flush_flags.
>>
>> Fixed a build error:
>>
>>   src/gallium/state_trackers/egl/android/native_android.cpp:426:29: error:
>>   invalid conversion from 'int' to 'pipe_flush_flags' [-fpermissive]
>>
>
> While I agree that using enum for bitmasks is not a great idea, I think it is a bit too late to go back on this now, as enum pipe_flush_flags is now used all over the place.  Please just add (enum pipe_flush_flags) cast to silence.  That is what is done in other cpp files.
I decided to give the patch another shot by replacing all occurrences
of "enum pipe_flush_flags" with unsigned.  It is not uncommon for
gallium to have interface changes, and it is a bit hard for me to let
it go when noticing an enum is used for bitmasks.

I compile-tested the patch with most drivers (r600 and radeonsi
excluded for requiring LLVM 3.3) and all state trackers that use "enum
pipe_flush_flags" this time.

>
> Jose



--
olv at LunarG.com


More information about the mesa-dev mailing list