From 22d233b46c1343e0e586fb5023d4c5f8be8c913a Mon Sep 17 00:00:00 2001 From: mbjornstk Date: Sun, 6 Dec 2009 21:03:59 +0000 Subject: [PATCH] Wrap some lines with {} so g++ 4.3 does not abort. For reference, and in case there is a better fix, the error reported was: graphics/camera.cpp:124: error: jump to case label graphics/camera.cpp:117: error: crosses initialization of "const int y2" graphics/camera.cpp:116: error: crosses initialization of "const int x2" graphics/camera.cpp:115: error: crosses initialization of "const int y1" graphics/camera.cpp:114: error: crosses initialization of "const int x1" git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4269 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/graphics/camera.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/graphics/camera.cpp b/src/graphics/camera.cpp index 190614dee..b9b6f3550 100644 --- a/src/graphics/camera.cpp +++ b/src/graphics/camera.cpp @@ -86,7 +86,7 @@ void Camera::setupCamera() m_aspect *= 2.0f; m_fov = DEGREE_TO_RAD*65.0f; break; - case 3: + case 3: /* if(m_index<2) { @@ -110,6 +110,7 @@ void Camera::setupCamera() } break;*/ case 4: + { // g++ 4.3 whines about the variables in switch/case if not {}-wrapped (???) const int x1 = (m_index%2==0 ? 0 : UserConfigParams::m_width>>1); const int y1 = (m_index<2 ? 0 : UserConfigParams::m_height>>1); const int x2 = (m_index%2==0 ? UserConfigParams::m_width>>1 : UserConfigParams::m_width); @@ -119,6 +120,7 @@ void Camera::setupCamera() << m_viewport.getWidth() << "x" << m_viewport.getHeight() << "\n"; m_scaling = core::vector2df(0.5f, 0.5f); m_fov = DEGREE_TO_RAD*50.0f; + } break; default:fprintf(stderr, "Incorrect number of players: '%d' - assuming 1.\n", race_manager->getNumLocalPlayers());