From b6f1910599d8158db3e1c50346d3551c6bb1df50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 7 Dec 2012 23:30:08 +0100 Subject: [PATCH] Making some asserts internal. They shouldn't be triggered by the user, so no explanational message is needed (but exact position in source is). --- src/Color.h | 3 +-- src/Implementation/BufferState.cpp | 3 +-- src/Shader.cpp | 28 +++++++++++++++------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Color.h b/src/Color.h index 54eac2a1c..5b8bb83aa 100644 --- a/src/Color.h +++ b/src/Color.h @@ -54,8 +54,7 @@ template inline typename std::enable_if::valu case 3: return {p, q, value}; case 4: return {t, p, value}; case 5: return {value, p, q}; - default: - CORRADE_ASSERT(false, "It shouldn't get here.", {}); + default: CORRADE_INTERNAL_ASSERT(false); } } template inline typename std::enable_if::value, Color3>::type fromHSV(typename Color3::HSV hsv) { diff --git a/src/Implementation/BufferState.cpp b/src/Implementation/BufferState.cpp index 323f5a015..949c3bdb1 100644 --- a/src/Implementation/BufferState.cpp +++ b/src/Implementation/BufferState.cpp @@ -62,8 +62,7 @@ std::size_t BufferState::indexForTarget(Buffer::Target target) { #endif } - CORRADE_ASSERT(false, "Unknown Buffer target", 0); - return 0; + CORRADE_INTERNAL_ASSERT(false); } }} diff --git a/src/Shader.cpp b/src/Shader.cpp index d6a756720..b66a72742 100644 --- a/src/Shader.cpp +++ b/src/Shader.cpp @@ -32,23 +32,25 @@ Shader::Shader(Version version, Type type): _type(type), _state(State::Initializ switch(version) { #ifndef MAGNUM_TARGET_GLES - case Version::GL210: addSource("#version 120\n"); break; - case Version::GL300: addSource("#version 130\n"); break; - case Version::GL310: addSource("#version 140\n"); break; - case Version::GL320: addSource("#version 150\n"); break; - case Version::GL330: addSource("#version 330\n"); break; - case Version::GL400: addSource("#version 400\n"); break; - case Version::GL410: addSource("#version 410\n"); break; - case Version::GL420: addSource("#version 420\n"); break; - case Version::GL430: addSource("#version 430\n"); break; + case Version::GL210: addSource("#version 120\n"); return; + case Version::GL300: addSource("#version 130\n"); return; + case Version::GL310: addSource("#version 140\n"); return; + case Version::GL320: addSource("#version 150\n"); return; + case Version::GL330: addSource("#version 330\n"); return; + case Version::GL400: addSource("#version 400\n"); return; + case Version::GL410: addSource("#version 410\n"); return; + case Version::GL420: addSource("#version 420\n"); return; + case Version::GL430: addSource("#version 430\n"); return; #else - case Version::GLES200: addSource("#version 100\n"); break; - case Version::GLES300: addSource("#version 300\n"); break; + case Version::GLES200: addSource("#version 100\n"); return; + case Version::GLES300: addSource("#version 300\n"); return; #endif - default: - CORRADE_ASSERT(false, "Shader::Shader(): unsupported version" << GLint(version), ); + case Version::None: + CORRADE_ASSERT(false, "Shader::Shader(): unsupported version" << version, ); } + + CORRADE_INTERNAL_ASSERT(false); } Shader::Shader(Shader&& other): _type(other._type), _state(other._state), sources(other.sources), shader(other.shader) {