diff options
author | Ian Romanick <[email protected]> | 2012-12-11 12:56:03 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-01-25 09:07:32 -0500 |
commit | ecfb404e8d4fcd35524d1c4b3421e24980fe3976 (patch) | |
tree | bd11671d87c067bcee346c923cef574e7177ec21 /src/mesa/state_tracker/st_glsl_to_tgsi.cpp | |
parent | 416326e33780fda0580292f9c2ace0b7c2c520e3 (diff) |
glsl: Replace most default cases in switches on GLSL type
This makes it easier to find switch-statements that need to be updated
after a new GLSL_TYPE_* is added because the compiler will generate a
warning.
Switch-statements that only had a small number of cases (e.g.,
everything in ir_constant_expression.cpp) were not modified. I may
regret that decision when we eventually add support for doubles.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Carl Worth <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_glsl_to_tgsi.cpp')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 575636e6e57..643a9bbb09d 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -984,10 +984,12 @@ type_size(const struct glsl_type *type) * at link time. */ return 1; - default: - assert(0); - return 0; + case GLSL_TYPE_VOID: + case GLSL_TYPE_ERROR: + assert(!"Invalid type in type_size"); + break; } + return 0; } /** |