Mesa (master): glsl: Fix 'control reaches end of non-void function' warning .

Vinson Lee vlee at kemper.freedesktop.org
Sat Jan 21 07:54:42 UTC 2012


Module: Mesa
Branch: master
Commit: e9bcf4d56b8ae128204fb95693c6f81a6b724052
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e9bcf4d56b8ae128204fb95693c6f81a6b724052

Author: Vinson Lee <vlee at freedesktop.org>
Date:   Mon Jan 16 18:01:22 2012 -0800

glsl: Fix 'control reaches end of non-void function' warning.

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 at freedesktop.org>
Reviewed-by: Chad Versace <chad.versace at linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/glsl/glsl_types.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index d4385a6..1489aae 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -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;
    }
 }
 




More information about the mesa-commit mailing list