[Mesa-dev] [PATCH 08/14] i965: Replace fprintfs with assertions in GLenum comparison translators.

Kenneth Graunke kenneth at whitecape.org
Tue Jul 2 01:54:50 PDT 2013


These functions translate GLenum comparison operations into the hardware
enumerations.  They should never be passed something other than a GL
comparison operator, or something is very broken.

Assertions seem more appropriate than fprintf.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/intel_state.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_state.c b/src/mesa/drivers/dri/i965/intel_state.c
index e4a63e5..3bb0fc1 100644
--- a/src/mesa/drivers/dri/i965/intel_state.c
+++ b/src/mesa/drivers/dri/i965/intel_state.c
@@ -59,7 +59,7 @@ intel_translate_shadow_compare_func(GLenum func)
        return BRW_COMPAREFUNCTION_NEVER;
    }
 
-   fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
+   assert(!"Invalid shadow comparison function.");
    return BRW_COMPAREFUNCTION_NEVER;
 }
 
@@ -85,7 +85,7 @@ intel_translate_compare_func(GLenum func)
       return BRW_COMPAREFUNCTION_ALWAYS;
    }
 
-   fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
+   assert(!"Invalid comparison function.");
    return BRW_COMPAREFUNCTION_ALWAYS;
 }
 
-- 
1.8.3.1



More information about the mesa-dev mailing list