[Mesa-dev] [PATCH] util/sha1: harmonize _mesa_sha1_* wrappers

Nicolai Hähnle nhaehnle at gmail.com
Wed Mar 22 12:11:55 UTC 2017


On 22.03.2017 12:40, Emil Velikov wrote:
> On 22 March 2017 at 10:57, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
>> On 22.03.2017 00:43, Grazvydas Ignotas wrote:
>>>
>>> Rather than using 3 different ways to wrap _mesa_sha1_*() to SHA1*()
>>> functions (a macro, prototype with implementation in .c and an inline
>>> function), make all 3 inline functions.
>>>
>>> Signed-off-by: Grazvydas Ignotas <notasas at gmail.com>
>>
>>
>> Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
>>
>> I noticed that a define is used for mesa_sha1. I wouldn't mind a change to
>>
>> typedef struct _SHA1_CTX *mesa_sha1;
>>
> Dull question - what does this bring us ?

Less #define namespace pollution. It's not a huge deal in this case, but 
I still have scars from working with a gigantic code base in which some 
genius thought it would be a clever idea to #define Vector -- and 
naturally did so in a way that lead to completely unintelligible error 
messages. Since then, I generally try to get rid of macros wherever 
possible, especially if they're not all upper case.

Cheers,
Nicolai

>
>> even though that would imply more changes throughout the code base. Might be
>> best to delay until some of the disk cache uses have settled, and it's
>> obviously not high priority.
>>
> Agreed.
>
> Thanks for having a look Nicolai and Grazvydas for sorting this out
> R-b and pushed to master.
>
> -Emil
>



More information about the mesa-dev mailing list