[Mesa-dev] [PATCH 01/12] mesa: Refactor element type checking into its own function

Brian Paul brianp at vmware.com
Thu Aug 23 07:26:24 PDT 2012


On 08/23/2012 12:36 AM, Kenneth Graunke wrote:
> On 08/22/2012 07:26 PM, Ian Romanick wrote:
>> From: Ian Romanick<ian.d.romanick at intel.com>
>>
>> This consolidates the tests and makes the emitted error message
>> consistent.
>>
>> Signed-off-by: Ian Romanick<ian.d.romanick at intel.com>
>> ---
>>   src/mesa/main/api_validate.c |   46 +++++++++++++++++++++---------------------
>>   1 files changed, 23 insertions(+), 23 deletions(-)
>>
>> diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
>> index eaf614b..e8c8333 100644
>> --- a/src/mesa/main/api_validate.c
>> +++ b/src/mesa/main/api_validate.c
>> @@ -262,6 +262,25 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name)
>>      return GL_TRUE;
>>   }
>>
>> +/**
>> + * Verify that the element type is valid.
>> + *
>> + * Generates \c GL_INVALID_ENUM and returns \c false if it is not.
>> + */
>> +static bool
>> +_mesa_valid_element_type(struct gl_context *ctx, GLenum type, const char *name)
>> +{
>
> Could we call this _mesa_valid_draw_elements_type()?  When I first saw
> this, I was thinking more broadly..."elements of what?", "only unsigned
> elements are allowed?", and so on.

And FWIW, I usually don't put the _mesa_ prefix on static functions. 
A function w/out _mesa_ tells me the function is defined earlier in 
this file and not somewhere else.

-Brian


More information about the mesa-dev mailing list