glsl: Fix 'control reaches end of non-void function' warning.
authorVinson Lee <vlee@freedesktop.org>
Tue, 17 Jan 2012 02:01:22 +0000 (18:01 -0800)
committerVinson Lee <vlee@freedesktop.org>
Sat, 21 Jan 2012 07:53:59 +0000 (23:53 -0800)
Fix this GCC warning on non-debug builds.
glsl_types.cpp: In member function 'gl_texture_index
glsl_type::sampler_index() const':
glsl_types.cpp:157: warning: control reaches end of non-void function

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/glsl_types.cpp

index d4385a644ca1f875c99033e0dd010fdbc9b8ead8..1489aae6d898d24fdf4fe4fe1946e51c07b17f98 100644 (file)
@@ -147,12 +147,12 @@ glsl_type::sampler_index() const
       return TEXTURE_RECT_INDEX;
    case GLSL_SAMPLER_DIM_BUF:
       assert(!"FINISHME: Implement ARB_texture_buffer_object");
-      break;
+      return TEXTURE_BUFFER_INDEX;
    case GLSL_SAMPLER_DIM_EXTERNAL:
       return TEXTURE_EXTERNAL_INDEX;
    default:
       assert(!"Should not get here.");
-      break;
+      return TEXTURE_BUFFER_INDEX;
    }
 }