[Mesa-dev] [PATCH 04/24] i965: Make 'dw1' and 'bits' unnamed structures in brw_reg.

Matt Turner mattst88 at gmail.com
Tue Nov 3 10:52:30 PST 2015


On Tue, Nov 3, 2015 at 2:33 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 3 November 2015 at 00:29, Matt Turner <mattst88 at gmail.com> wrote:
>> Generated by
>>
>>    sed -i -e 's/\.bits\././g' *.c *.h *.cpp
>>    sed -i -e 's/dw1\.//g' *.c *.h *.cpp
>>
>> and then reverting changes to comments in gen7_blorp.cpp and
>> brw_fs_generator.cpp.
>>
>> There wasn't any utility offered by forcing the programmer to list these
>> to access their fields. Removing them will reduce churn in future
>> commits.
>>
>> This is C11 (and gcc has apparently supported it for sometime
>> "compatibility with other compilers")
>>
>> See https://gcc.gnu.org/onlinedocs/gcc/Unnamed-Fields.html
> FYI on old versions of GCC where this extension is not enabled by
> default, we flip in on. We're using -std=gnu99, although perhaps we
> should use -fms-extensions - not a big deal either way.

I tested gcc-4.4.7 (the version RHEL 5 uses, IIRC) and it produced a
Mesa capable of running glxgears :)


More information about the mesa-dev mailing list