[Mesa-dev] Mesa (master): i915: Silence unused variable warning in non-debug builds.

Ian Romanick idr at freedesktop.org
Tue Oct 12 10:43:27 PDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kenneth Graunke wrote:
> On Monday 11 October 2010 16:17:51 Ian Romanick wrote:
> [snip]
>>> diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c
>>> b/src/mesa/drivers/dri/i915/i915_vtbl.c index d7828a2..8fa24e4 100644
>>> --- a/src/mesa/drivers/dri/i915/i915_vtbl.c
>>> +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c
>>> @@ -669,6 +669,7 @@ i915_assert_not_dirty( struct intel_context *intel )
>>>
>>>     struct i915_context *i915 = i915_context(&intel->ctx);
>>>     GLuint dirty = get_dirty(&i915->state);
>>>     assert(!dirty);
>>>
>>> +   (void) dirty;
>> This should probably be changed to 'assert(!get_dirty(&i915->state))'
>> instead.
> 
> I don't think this is equivalent---get_dirty has side-effects.  Moving the call 
> inside the assert would mean these side effects would not occur in release 
> builds.

Blarg.  Maybe a comment to that effect would be good, then.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAky0nj4ACgkQX1gOwKyEAw8vrACfeHYCwv7x6ePrZReBbZ+qKVE8
UjkAnAv3stqa9Bu6gG5R6Tud4hz/GoYM
=sgcw
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list