OSDN Git Service

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 45ca38e..a86384b 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 16ce8f6..83690ef 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 18427b5..df9e459 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 7f20319..0ecb469 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