[Mesa-dev] Janitorial work: no more intel_context.[ch]; tidying

Ian Romanick idr at freedesktop.org
Mon Sep 30 17:51:26 PDT 2013


On 09/27/2013 06:24 PM, Emil Velikov wrote:
> On 28/09/13 00:45, Kenneth Graunke wrote:
>> This series combines brw_context.[ch] and intel_context.[ch],
>> and cleans up our context creation code quite a bit.  A bunch of
>> functionality was awkwardly split between the two sets of files;
>> now it's all in one place.
>>
>> While this series is large, it should be fairly easy reading.
>> Patch 28 does have one functional change on 32-bit systems - it removes
>> a handcoded assembly version of memcpy.  This has not been tested.
>>
> Hi Kenneth
> 
> Hope you can bare with me and a couple of silly questions :)
> 
> * With the recent split of the intel driver codebase, the new i965
> headers has been getting a bunch of #pragma once over the standard
> #ifndef _HEADER_H_... Are those intentional ?

I started using that some in the GLSL compiler code.  The pragma is not
a standard part of C++ or C99, but it is supported by GCC, clang, and
the MS compilers[1].  According to the web (which is never wrong), the
pragma is faster on MS compilers and roughly the same on GCC.  I chose
it for a couple reasons:

 - It was less to type, and it was less error prone.

 - When changing names of .h files, which I did a lot in the early
compiler days, I didn't have to change anything in the file.

FWIW... the Google style guide[2] recommends against pragma once, but
the Chromium style guide[3] recommends using both pragma once and the
ifdef/define/endif guards.

We should probably make some decision about this as a group and add the
recommendation to Mesa's style guide.

[1] http://en.wikipedia.org/wiki/Pragma_once

[2]
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Windows_Code#Windows_Code

[3] http://dev.chromium.org/developers/coding-style

> * In patch 29 the drm* headers are included quoted, over angle brackets.
> I realise that's a very pedantic point, just curious is it just a
> copy'n'paste thing or was it planned.
> 
> * The inline function is_power_of_two() in patch 29 is used by both
> intel drivers. Possibly move it to macros.h ? Gallium has it's
> equivalent in auxiliary/util/u_math.h - util_is_power_of_two()
> 
> Thanks
> Emil
>> Available as 'tidying6' in my tree.  Based on Eric's megadriver-prep series.
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list