[Mesa-dev] [PATCH] glx: Suppress unused variable warning for cmdlen

Paul Berry stereotype441 at gmail.com
Mon Jan 9 15:54:17 PST 2012


On 9 January 2012 14:28, Ian Romanick <idr at freedesktop.org> wrote:

> On 01/09/2012 01:27 PM, Paul Berry wrote:
>
>> No functional change.  In the function
>> __indirect_**glAreTexturesResident(), the variable cmdlen is only used
>> if USE_XCB is not defined.  This patch avoids a compile warning in the
>> event that USE_XCB is defined.
>> ---
>>  src/glx/single2.c |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/glx/single2.c b/src/glx/single2.c
>> index 66281fa..a4355fc 100644
>> --- a/src/glx/single2.c
>> +++ b/src/glx/single2.c
>> @@ -890,6 +890,7 @@ __indirect_**glAreTexturesResident(GLsizei n, const
>> GLuint * textures,
>>     const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
>>     if (__builtin_expect((n>= 0)&&  (dpy != NULL), 1)) {
>>
>>  #ifdef USE_XCB
>> +      (void) cmdlen;
>>
>
> Maybe just move cmdlen declaration inside the #else part?


Ok, that seems reasonable.  I'll follow up with a revised patch.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120109/6dff6c5e/attachment-0001.html>


More information about the mesa-dev mailing list