draw: corrections to allow for different cliptest cases
[mesa.git] / src / mesa / main / texobj.c
index 7f0a246025ab1d7319b93f5eb423aa460c13375d..1fedc87028504148ccf78f9d5af00a69244395d5 100644 (file)
 #include "imports.h"
 #include "macros.h"
 #include "teximage.h"
-#include "texstate.h"
 #include "texobj.h"
 #include "mtypes.h"
-#include "shader/prog_instruction.h"
+#include "program/prog_instruction.h"
 
 
 
@@ -107,7 +106,7 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
           target == GL_TEXTURE_1D_ARRAY_EXT ||
           target == GL_TEXTURE_2D_ARRAY_EXT);
 
-   _mesa_bzero(obj, sizeof(*obj));
+   memset(obj, 0, sizeof(*obj));
    /* init the non-zero fields */
    _glthread_INIT_MUTEX(obj->Mutex);
    obj->RefCount = 1;
@@ -208,7 +207,7 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj )
    _glthread_DESTROY_MUTEX(texObj->Mutex);
 
    /* free this object */
-   _mesa_free(texObj);
+   free(texObj);
 }
 
 
@@ -332,6 +331,7 @@ _mesa_reference_texobj(struct gl_texture_object **ptr,
       struct gl_texture_object *oldTex = *ptr;
 
       ASSERT(valid_texture_object(oldTex));
+      (void) valid_texture_object; /* silence warning in release builds */
 
       _glthread_LOCK_MUTEX(oldTex->Mutex);
       ASSERT(oldTex->RefCount > 0);
@@ -384,7 +384,7 @@ _mesa_reference_texobj(struct gl_texture_object **ptr,
 static void
 incomplete(const struct gl_texture_object *t, const char *why)
 {
-   _mesa_printf("Texture Obj %d incomplete because: %s\n", t->Name, why);
+   printf("Texture Obj %d incomplete because: %s\n", t->Name, why);
 }
 #else
 #define incomplete(t, why)
@@ -417,7 +417,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
     */
    if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) {
       char s[100];
-      _mesa_sprintf(s, "base level = %d is invalid", baseLevel);
+      _mesa_snprintf(s, sizeof(s), "base level = %d is invalid", baseLevel);
       incomplete(t, s);
       t->_Complete = GL_FALSE;
       return;
@@ -426,7 +426,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
    /* Always need the base level image */
    if (!t->Image[0][baseLevel]) {
       char s[100];
-      _mesa_sprintf(s, "Image[baseLevel=%d] == NULL", baseLevel);
+      _mesa_snprintf(s, sizeof(s), "Image[baseLevel=%d] == NULL", baseLevel);
       incomplete(t, s);
       t->_Complete = GL_FALSE;
       return;