>From 1de19a3fdbe64bb41d3ded3a2b5ac03a0a687484 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Fri, 22 Jun 2012 19:26:02 -0400 Subject: [PATCH] world: removed the exception from renderer.cc After analyzing the code, all possible cases are handled in the switch statement, but the compiler is not always smart enough to figure that out (and it took me a while too). :-) So, for the "should never happen" case, add a default: case under case 0, which displays debug output, which is a suitable response. This removes the exception I added before to fix compile issues, and adonthell should now compile again when exception are turned off. --- src/world/renderer.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/world/renderer.cc b/src/world/renderer.cc index 36f09d7..50a1cc3 100644 --- a/src/world/renderer.cc +++ b/src/world/renderer.cc @@ -337,6 +337,7 @@ bool default_renderer::is_object_below (const render_info & obj, const render_in switch (res) { case 0: + default: { // fprintf (stderr, "*** default_renderer::is_object_below: total intersection of objects!\n"); // E // fprintf (stderr, " [%i, %i, %i] - [%i, %i, %i]\n", min_x, min_y, min_z, max_x, max_y, max_z); @@ -379,8 +380,6 @@ bool default_renderer::is_object_below (const render_info & obj, const render_in } } } - - throw "This should never happen."; } // debug rendering -- 1.7.10.4