intel: Remove pointless boolean return value from *_miptree_layout.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 24 Sep 2011 05:42:18 +0000 (22:42 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 24 Sep 2011 05:42:18 +0000 (22:42 -0700)
i915_miptree_layout, i945_miptree_layout, and brw_miptree_layout always
just return GL_TRUE, so there's really no point to it.  Change them to
void functions and remove the (dead) error checking code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i915/i915_tex_layout.c
src/mesa/drivers/dri/i965/brw_tex_layout.c
src/mesa/drivers/dri/intel/intel_mipmap_tree.c
src/mesa/drivers/dri/intel/intel_mipmap_tree.h

index 45ca38e75d5d54f30d31e00687b41ca65493b491..a86384bbcfdc90b244c58403dbaa64718926f54e 100644 (file)
@@ -224,7 +224,7 @@ i915_miptree_layout_2d(struct intel_mipmap_tree * mt)
    }
 }
 
-GLboolean
+void
 i915_miptree_layout(struct intel_mipmap_tree * mt)
 {
    switch (mt->target) {
@@ -246,8 +246,6 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
 
    DBG("%s: %dx%dx%d\n", __FUNCTION__,
        mt->total_width, mt->total_height, mt->cpp);
-
-   return GL_TRUE;
 }
 
 
@@ -455,7 +453,7 @@ i945_miptree_layout_3d(struct intel_mipmap_tree * mt)
    }
 }
 
-GLboolean
+void
 i945_miptree_layout(struct intel_mipmap_tree * mt)
 {
    switch (mt->target) {
@@ -480,6 +478,4 @@ i945_miptree_layout(struct intel_mipmap_tree * mt)
 
    DBG("%s: %dx%dx%d\n", __FUNCTION__,
        mt->total_width, mt->total_height, mt->cpp);
-
-   return GL_TRUE;
 }
index 16ce8f68b81ce5e61451b4e8507c357cd555cc1c..83690ef9b7b9133f4a783ca66e6c82fbbcc9d1be 100644 (file)
@@ -39,8 +39,8 @@
 
 #define FILE_DEBUG_FLAG DEBUG_MIPTREE
 
-GLboolean brw_miptree_layout(struct intel_context *intel,
-                            struct intel_mipmap_tree *mt)
+void
+brw_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree *mt)
 {
    /* XXX: these vary depending on image format: */
    /* GLint align_w = 4; */
@@ -166,7 +166,5 @@ GLboolean brw_miptree_layout(struct intel_context *intel,
    }
    DBG("%s: %dx%dx%d\n", __FUNCTION__,
        mt->total_width, mt->total_height, mt->cpp);
-
-   return GL_TRUE;
 }
 
index 18427b5c8eadfe77e443c527a4a1070f6ba10353..df9e45981a928965d8ab8772d2b820d354ad66af 100644 (file)
@@ -63,7 +63,6 @@ intel_miptree_create_internal(struct intel_context *intel,
                              GLuint height0,
                              GLuint depth0)
 {
-   GLboolean ok;
    struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
    int compress_byte = 0;
 
@@ -89,19 +88,13 @@ intel_miptree_create_internal(struct intel_context *intel,
 #ifdef I915
    (void) intel;
    if (intel->is_945)
-      ok = i945_miptree_layout(mt);
+      i945_miptree_layout(mt);
    else
-      ok = i915_miptree_layout(mt);
+      i915_miptree_layout(mt);
 #else
-   ok = brw_miptree_layout(intel, mt);
+   brw_miptree_layout(intel, mt);
 #endif
 
-   if (!ok) {
-      free(mt);
-      DBG("%s not okay - returning NULL\n", __FUNCTION__);
-      return NULL;
-   }
-
    return mt;
 }
 
index 7f20319581f62f3a780076ace1470ef81b993853..0ecb469c060d5b07c28ffa3ebbe19a863cbdac99 100644 (file)
@@ -211,9 +211,9 @@ void intel_miptree_image_copy(struct intel_context *intel,
 
 /* i915_mipmap_tree.c:
  */
-GLboolean i915_miptree_layout(struct intel_mipmap_tree *mt);
-GLboolean i945_miptree_layout(struct intel_mipmap_tree *mt);
-GLboolean brw_miptree_layout(struct intel_context *intel,
-                            struct intel_mipmap_tree *mt);
+void i915_miptree_layout(struct intel_mipmap_tree *mt);
+void i945_miptree_layout(struct intel_mipmap_tree *mt);
+void brw_miptree_layout(struct intel_context *intel,
+                       struct intel_mipmap_tree *mt);
 
 #endif