mesa: don't call valid_texture_object() in non-debug builds
authorBrian Paul <brianp@vmware.com>
Mon, 20 Sep 2010 14:19:08 +0000 (08:19 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 20 Sep 2010 14:21:00 +0000 (08:21 -0600)
This reverts commit c32bac57ed445e48856d74113364287ed6e5cdd4
and silences the warning differently.

The _mesa_reference_texobj() function is called quite a bit and
we don't want to call valid_texture_object() all the time in non-
debug builds.

src/mesa/main/texobj.c

index c96226df5976e499fedd30f7a7702683432093d5..1fedc87028504148ccf78f9d5af00a69244395d5 100644 (file)
@@ -330,11 +330,8 @@ _mesa_reference_texobj(struct gl_texture_object **ptr,
       GLboolean deleteFlag = GL_FALSE;
       struct gl_texture_object *oldTex = *ptr;
 
-      {
-         GLboolean valid = valid_texture_object(oldTex);
-         ASSERT(valid);
-         (void) valid;
-      }
+      ASSERT(valid_texture_object(oldTex));
+      (void) valid_texture_object; /* silence warning in release builds */
 
       _glthread_LOCK_MUTEX(oldTex->Mutex);
       ASSERT(oldTex->RefCount > 0);