Browse Source

Using CORRADE_ASSERT_UNREACHABLE() instead of CORRADE_ASSERT(false).

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
1aac14d059
  1. 2
      src/AbstractFramebuffer.cpp
  2. 4
      src/AbstractImage.cpp
  3. 8
      src/AbstractShaderProgram.cpp
  4. 2
      src/Color.h
  5. 2
      src/Implementation/BufferState.cpp
  6. 2
      src/Mesh.cpp
  7. 2
      src/Shader.cpp

2
src/AbstractFramebuffer.cpp

@ -62,7 +62,7 @@ void AbstractFramebuffer::bindInternal(Target target) {
} else if(target == Target::ReadDraw) { } else if(target == Target::ReadDraw) {
if(state->readBinding == _id && state->drawBinding == _id) return; if(state->readBinding == _id && state->drawBinding == _id) return;
state->readBinding = state->drawBinding = _id; state->readBinding = state->drawBinding = _id;
} else CORRADE_INTERNAL_ASSERT(false); } else CORRADE_ASSERT_UNREACHABLE();
glBindFramebuffer(static_cast<GLenum>(target), _id); glBindFramebuffer(static_cast<GLenum>(target), _id);
} }

4
src/AbstractImage.cpp

@ -129,10 +129,10 @@ std::size_t AbstractImage::pixelSize(Format format, Type type) {
case Format::StencilIndex: case Format::StencilIndex:
#endif #endif
case Format::DepthStencil: case Format::DepthStencil:
CORRADE_INTERNAL_ASSERT(false); CORRADE_ASSERT_UNREACHABLE();
} }
CORRADE_INTERNAL_ASSERT(false); CORRADE_ASSERT_UNREACHABLE();
return 0; return 0;
} }

8
src/AbstractShaderProgram.cpp

@ -600,7 +600,7 @@ std::size_t FloatAttribute::size(GLint components, DataType dataType) {
#endif #endif
} }
CORRADE_INTERNAL_ASSERT(false); CORRADE_ASSERT_UNREACHABLE();
return 0; return 0;
} }
@ -618,7 +618,7 @@ std::size_t IntAttribute::size(GLint components, DataType dataType) {
return 4*components; return 4*components;
} }
CORRADE_INTERNAL_ASSERT(false); CORRADE_ASSERT_UNREACHABLE();
return 0; return 0;
} }
#endif #endif
@ -630,7 +630,7 @@ std::size_t DoubleAttribute::size(GLint components, DataType dataType) {
return 8*components; return 8*components;
} }
CORRADE_INTERNAL_ASSERT(false); CORRADE_ASSERT_UNREACHABLE();
return 0; return 0;
} }
#endif #endif
@ -665,7 +665,7 @@ std::size_t Attribute<Math::Vector<4, Float>>::size(GLint components, DataType d
#endif #endif
} }
CORRADE_INTERNAL_ASSERT(false); CORRADE_ASSERT_UNREACHABLE();
return 0; return 0;
} }

2
src/Color.h

@ -63,7 +63,7 @@ template<class T> inline typename std::enable_if<std::is_floating_point<T>::valu
case 3: return {p, q, value}; case 3: return {p, q, value};
case 4: return {t, p, value}; case 4: return {t, p, value};
case 5: return {value, p, q}; case 5: return {value, p, q};
default: CORRADE_INTERNAL_ASSERT(false); default: CORRADE_ASSERT_UNREACHABLE();
} }
} }
template<class T> inline typename std::enable_if<std::is_integral<T>::value, Color3<T>>::type fromHSV(typename Color3<T>::HSV hsv) { template<class T> inline typename std::enable_if<std::is_integral<T>::value, Color3<T>>::type fromHSV(typename Color3<T>::HSV hsv) {

2
src/Implementation/BufferState.cpp

@ -71,7 +71,7 @@ std::size_t BufferState::indexForTarget(Buffer::Target target) {
#endif #endif
} }
CORRADE_INTERNAL_ASSERT(false); CORRADE_ASSERT_UNREACHABLE();
} }
}} }}

2
src/Mesh.cpp

@ -55,7 +55,7 @@ std::size_t Mesh::indexSize(IndexType type) {
case IndexType::UnsignedInt: return 4; case IndexType::UnsignedInt: return 4;
} }
CORRADE_INTERNAL_ASSERT(false); CORRADE_ASSERT_UNREACHABLE();
} }
Mesh::Mesh(Primitive primitive): _primitive(primitive), _vertexCount(0), _indexCount(0) Mesh::Mesh(Primitive primitive): _primitive(primitive), _vertexCount(0), _indexCount(0)

2
src/Shader.cpp

@ -59,7 +59,7 @@ Shader::Shader(Version version, Type type): _type(type), _state(State::Initializ
CORRADE_ASSERT(false, "Shader::Shader(): unsupported version" << version, ); CORRADE_ASSERT(false, "Shader::Shader(): unsupported version" << version, );
} }
CORRADE_INTERNAL_ASSERT(false); CORRADE_ASSERT_UNREACHABLE();
} }
Shader::Shader(Shader&& other): _type(other._type), _state(other._state), sources(other.sources), shader(other.shader) { Shader::Shader(Shader&& other): _type(other._type), _state(other._state), sources(other.sources), shader(other.shader) {

Loading…
Cancel
Save