From d3f22357598840319524e5e66fd3836c8d1bdef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 21 Apr 2020 11:35:53 +0200 Subject: [PATCH] Adapted to Corrade changes. --- src/Magnum/Animation/Interpolation.cpp | 8 ++-- src/Magnum/Animation/Interpolation.h | 4 +- src/Magnum/Animation/Player.hpp | 2 +- src/Magnum/DebugTools/CompareImage.cpp | 4 +- src/Magnum/GL/AbstractFramebuffer.cpp | 4 +- src/Magnum/GL/AbstractObject.cpp | 2 +- src/Magnum/GL/AbstractTexture.cpp | 8 ++-- src/Magnum/GL/Attribute.cpp | 16 +++---- src/Magnum/GL/Context.cpp | 2 +- src/Magnum/GL/Implementation/BufferState.cpp | 2 +- src/Magnum/GL/Mesh.cpp | 2 +- src/Magnum/GL/PixelFormat.cpp | 2 +- src/Magnum/GL/Shader.cpp | 4 +- src/Magnum/GL/Test/MeshGLTest.cpp | 48 +++++++++---------- src/Magnum/Math/Color.h | 2 +- src/Magnum/Mesh.cpp | 2 +- src/Magnum/MeshTools/GenerateNormals.cpp | 2 +- src/Magnum/Platform/Sdl2Application.cpp | 2 +- src/Magnum/Trade/AbstractImporter.cpp | 2 +- src/Magnum/Trade/AnimationData.cpp | 2 +- src/Magnum/Trade/MeshData.cpp | 18 +++---- src/Magnum/VertexFormat.cpp | 2 +- .../Test/MagnumFontConverterTest.cpp | 2 +- src/MagnumPlugins/ObjImporter/ObjImporter.cpp | 2 +- 24 files changed, 72 insertions(+), 72 deletions(-) diff --git a/src/Magnum/Animation/Interpolation.cpp b/src/Magnum/Animation/Interpolation.cpp index 575b2ae85..6c4b8274e 100644 --- a/src/Magnum/Animation/Interpolation.cpp +++ b/src/Magnum/Animation/Interpolation.cpp @@ -76,7 +76,7 @@ template auto TypeTraits, Math::Complex>::interpola case Interpolation::Custom: ; /* nope */ } - CORRADE_ASSERT(false, "Animation::interpolatorFor(): can't deduce interpolator function for" << interpolation, {}); + CORRADE_ASSERT_UNREACHABLE("Animation::interpolatorFor(): can't deduce interpolator function for" << interpolation, {}); } template auto TypeTraits, Math::Quaternion>::interpolator(Interpolation interpolation) -> Interpolator { @@ -88,7 +88,7 @@ template auto TypeTraits, Math::Quaternion>::int case Interpolation::Custom: ; /* nope */ } - CORRADE_ASSERT(false, "Animation::interpolatorFor(): can't deduce interpolator function for" << interpolation, {}); + CORRADE_ASSERT_UNREACHABLE("Animation::interpolatorFor(): can't deduce interpolator function for" << interpolation, {}); } template auto TypeTraits, Math::DualQuaternion>::interpolator(Interpolation interpolation) -> Interpolator { @@ -100,7 +100,7 @@ template auto TypeTraits, Math::DualQuaternion< case Interpolation::Custom: ; /* nope */ } - CORRADE_ASSERT(false, "Animation::interpolatorFor(): can't deduce interpolator function for" << interpolation, {}); + CORRADE_ASSERT_UNREACHABLE("Animation::interpolatorFor(): can't deduce interpolator function for" << interpolation, {}); } template auto TypeTraits, T>::interpolator(Interpolation interpolation) -> Interpolator { @@ -112,7 +112,7 @@ template auto TypeTraits, T>::interpolator(Interp case Interpolation::Custom: ; /* nope */ } - CORRADE_ASSERT(false, "Animation::interpolatorFor(): can't deduce interpolator function for" << interpolation, {}); + CORRADE_ASSERT_UNREACHABLE("Animation::interpolatorFor(): can't deduce interpolator function for" << interpolation, {}); } template struct MAGNUM_EXPORT TypeTraits, Math::Complex>; diff --git a/src/Magnum/Animation/Interpolation.h b/src/Magnum/Animation/Interpolation.h index 6b39ec079..f978cdccd 100644 --- a/src/Magnum/Animation/Interpolation.h +++ b/src/Magnum/Animation/Interpolation.h @@ -315,7 +315,7 @@ template auto TypeTraits::interpolator(Interpolation interpolatio case Interpolation::Custom: ; /* nope */ } - CORRADE_ASSERT(false, "Animation::interpolatorFor(): can't deduce interpolator function for" << interpolation, {}); + CORRADE_ASSERT_UNREACHABLE("Animation::interpolatorFor(): can't deduce interpolator function for" << interpolation, {}); } /* Specialization for booleans (no linear interpolation) */ @@ -333,7 +333,7 @@ template auto TypeTraitsBool::interpolator(Interpolation interpolati case Interpolation::Custom: ; /* nope */ } - CORRADE_ASSERT(false, "Animation::interpolatorFor(): can't deduce interpolator function for" << interpolation, {}); + CORRADE_ASSERT_UNREACHABLE("Animation::interpolatorFor(): can't deduce interpolator function for" << interpolation, {}); } template<> struct TypeTraits: TypeTraitsBool {}; template struct TypeTraits, Math::BoolVector>: TypeTraitsBool> {}; diff --git a/src/Magnum/Animation/Player.hpp b/src/Magnum/Animation/Player.hpp index de6dd492e..8618341af 100644 --- a/src/Magnum/Animation/Player.hpp +++ b/src/Magnum/Animation/Player.hpp @@ -191,7 +191,7 @@ template Player& Player::setState(State state, T t case State::Stopped: return stop(); } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } namespace Implementation { diff --git a/src/Magnum/DebugTools/CompareImage.cpp b/src/Magnum/DebugTools/CompareImage.cpp index c72697384..0584210df 100644 --- a/src/Magnum/DebugTools/CompareImage.cpp +++ b/src/Magnum/DebugTools/CompareImage.cpp @@ -312,7 +312,7 @@ void printPixelAt(Debug& out, const Containers::StridedArrayView3D& case PixelFormat::RGB16F: case PixelFormat::RGBA16F: /* Already handled by a printing assert before */ - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } #ifdef __GNUC__ #pragma GCC diagnostic pop @@ -671,7 +671,7 @@ void ImageComparatorBase::printMessage(const TestSuite::ComparisonStatusFlags fl << Debug::nospace << _state->mean << "below threshold" << _state->maxThreshold << Debug::nospace << "/" << Debug::nospace << _state->meanThreshold << Debug::nospace << "."; - } else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ out << "Delta image:" << Debug::newline; DebugTools::Implementation::printDeltaImage(out, _state->delta, _state->expectedImage->size(), _state->max, _state->maxThreshold, _state->meanThreshold); diff --git a/src/Magnum/GL/AbstractFramebuffer.cpp b/src/Magnum/GL/AbstractFramebuffer.cpp index 9e50b0877..a28e91418 100644 --- a/src/Magnum/GL/AbstractFramebuffer.cpp +++ b/src/Magnum/GL/AbstractFramebuffer.cpp @@ -154,7 +154,7 @@ void AbstractFramebuffer::bindImplementationDefault(FramebufferTarget target) { } else if(target == FramebufferTarget::Draw) { if(state.drawBinding == _id) return; state.drawBinding = _id; - } else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ /* Binding the framebuffer finally creates it */ _flags |= ObjectFlag::Created; @@ -492,7 +492,7 @@ void AbstractFramebuffer::invalidateImplementationDefault(const GLsizei count, c #else static_cast(count); static_cast(attachments); - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ #endif } diff --git a/src/Magnum/GL/AbstractObject.cpp b/src/Magnum/GL/AbstractObject.cpp index 0c742d182..73f4263b4 100644 --- a/src/Magnum/GL/AbstractObject.cpp +++ b/src/Magnum/GL/AbstractObject.cpp @@ -102,7 +102,7 @@ namespace { return khrIdentifier; } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } } diff --git a/src/Magnum/GL/AbstractTexture.cpp b/src/Magnum/GL/AbstractTexture.cpp index 675ded8f2..0b75ca76b 100644 --- a/src/Magnum/GL/AbstractTexture.cpp +++ b/src/Magnum/GL/AbstractTexture.cpp @@ -876,7 +876,7 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) { #pragma GCC diagnostic pop #endif - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } PixelType pixelTypeForInternalFormat(const TextureFormat internalFormat) { @@ -1175,7 +1175,7 @@ PixelType pixelTypeForInternalFormat(const TextureFormat internalFormat) { #pragma GCC diagnostic pop #endif - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } } @@ -1363,7 +1363,7 @@ void AbstractTexture::storageImplementationFallback(const GLsizei levels, const #endif /* No other targets are available */ - } else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } #endif @@ -1424,7 +1424,7 @@ void AbstractTexture::storageImplementationFallback(GLsizei levels, TextureForma #endif /* No other targets are available */ - else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } #endif diff --git a/src/Magnum/GL/Attribute.cpp b/src/Magnum/GL/Attribute.cpp index 68fe7b33e..6f7b0d17c 100644 --- a/src/Magnum/GL/Attribute.cpp +++ b/src/Magnum/GL/Attribute.cpp @@ -127,7 +127,7 @@ UnsignedInt FloatAttribute::size(GLint components, DataType dataType) { #endif } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } #ifndef MAGNUM_TARGET_GLES2 @@ -144,7 +144,7 @@ UnsignedInt IntAttribute::size(GLint components, DataType dataType) { return 4*components; } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } #endif @@ -155,7 +155,7 @@ UnsignedInt DoubleAttribute::size(GLint components, DataType dataType) { return 8*components; } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } #endif @@ -183,7 +183,7 @@ UnsignedInt Attribute>::size(GLint components, DataType d #endif } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } UnsignedInt Attribute>::size(GLint components, DataType dataType) { @@ -218,7 +218,7 @@ UnsignedInt Attribute>::size(GLint components, DataType d #endif } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } Debug& operator<<(Debug& debug, const SizedAttribute<1, 1>::Components value) { @@ -503,7 +503,7 @@ bool hasVertexFormat(const VertexFormat format) { /* Nothing else expected to be returned from vertexFormatComponentFormat() */ - default: CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + default: CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } } @@ -547,7 +547,7 @@ UnsignedInt attributeSize(DynamicAttribute::Components components, DynamicAttrib #endif } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } } @@ -582,7 +582,7 @@ DynamicAttribute::DynamicAttribute(const Kind kind, UnsignedInt location, const /* Nothing else expected to be returned from vertexFormatComponentFormat(), the unavailable formats were caught by the hasVertexFormat() above already */ - default: CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + default: CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } /* If the type is normalized, switch the type to GenericNormalized (if not diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index 430311edb..fa3b13eeb 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -490,7 +490,7 @@ Containers::ArrayView Extension::extensions(Version version) { #endif } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } #if !defined(MAGNUM_BUILD_STATIC) || defined(CORRADE_TARGET_WINDOWS) diff --git a/src/Magnum/GL/Implementation/BufferState.cpp b/src/Magnum/GL/Implementation/BufferState.cpp index 7318f2f04..c90ef57d3 100644 --- a/src/Magnum/GL/Implementation/BufferState.cpp +++ b/src/Magnum/GL/Implementation/BufferState.cpp @@ -74,7 +74,7 @@ std::size_t BufferState::indexForTarget(Buffer::TargetHint target) { #endif } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } BufferState::BufferState(Context& context, std::vector& extensions): bindings() diff --git a/src/Magnum/GL/Mesh.cpp b/src/Magnum/GL/Mesh.cpp index 74acf4d32..bd622b2e0 100644 --- a/src/Magnum/GL/Mesh.cpp +++ b/src/Magnum/GL/Mesh.cpp @@ -354,7 +354,7 @@ UnsignedInt Mesh::indexTypeSize() const { case MeshIndexType::UnsignedInt: return 4; } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } Mesh& Mesh::addVertexBufferInstanced(Buffer& buffer, const UnsignedInt divisor, const GLintptr offset, const GLsizei stride, const DynamicAttribute& attribute) { diff --git a/src/Magnum/GL/PixelFormat.cpp b/src/Magnum/GL/PixelFormat.cpp index 0d67c0793..e8772651d 100644 --- a/src/Magnum/GL/PixelFormat.cpp +++ b/src/Magnum/GL/PixelFormat.cpp @@ -258,7 +258,7 @@ UnsignedInt pixelSize(const PixelFormat format, const PixelType type) { #pragma GCC diagnostic pop #endif - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } #ifndef DOXYGEN_GENERATING_OUTPUT diff --git a/src/Magnum/GL/Shader.cpp b/src/Magnum/GL/Shader.cpp index 626f5cb5c..525907fe6 100644 --- a/src/Magnum/GL/Shader.cpp +++ b/src/Magnum/GL/Shader.cpp @@ -67,7 +67,7 @@ std::string shaderName(const Shader::Type type) { case Shader::Type::Fragment: return "fragment"; } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } UnsignedInt typeToIndex(const Shader::Type type) { @@ -82,7 +82,7 @@ UnsignedInt typeToIndex(const Shader::Type type) { #endif } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } #ifndef MAGNUM_TARGET_GLES diff --git a/src/Magnum/GL/Test/MeshGLTest.cpp b/src/Magnum/GL/Test/MeshGLTest.cpp index 2e36ac1e9..64e628046 100644 --- a/src/Magnum/GL/Test/MeshGLTest.cpp +++ b/src/Magnum/GL/Test/MeshGLTest.cpp @@ -694,7 +694,7 @@ void MeshGLTest::addVertexBufferUnsignedInt() { DynamicAttribute::Kind::Integral, 0, DynamicAttribute::Components::One, DynamicAttribute::DataType::UnsignedInt}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -727,7 +727,7 @@ void MeshGLTest::addVertexBufferInt() { DynamicAttribute::Kind::Integral, 0, DynamicAttribute::Components::One, DynamicAttribute::DataType::Int}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -765,7 +765,7 @@ void MeshGLTest::addVertexBufferFloat() { DynamicAttribute::Kind::Generic, 0, DynamicAttribute::Components::One, DynamicAttribute::DataType::Float}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -806,7 +806,7 @@ void MeshGLTest::addVertexBufferDouble() { DynamicAttribute::Kind::Long, 0, DynamicAttribute::Components::One, DynamicAttribute::DataType::Double}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -841,7 +841,7 @@ void MeshGLTest::addVertexBufferVectorNui() { DynamicAttribute::Kind::Integral, 0, DynamicAttribute::Components::Three, DynamicAttribute::DataType::UnsignedInt}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -874,7 +874,7 @@ void MeshGLTest::addVertexBufferVectorNi() { DynamicAttribute::Kind::Integral, 0, DynamicAttribute::Components::Two, DynamicAttribute::DataType::Int}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -912,7 +912,7 @@ void MeshGLTest::addVertexBufferVectorN() { DynamicAttribute::Kind::Generic, 0, DynamicAttribute::Components::Three, DynamicAttribute::DataType::Float}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -956,7 +956,7 @@ void MeshGLTest::addVertexBufferVectorNd() { DynamicAttribute::Kind::Long, 0, DynamicAttribute::Components::Four, DynamicAttribute::DataType::Double}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -998,7 +998,7 @@ void MeshGLTest::addVertexBufferMatrixNxN() { DynamicAttribute::Kind::Generic, 0, DynamicAttribute::Components::Three, 3, DynamicAttribute::DataType::Float}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -1044,7 +1044,7 @@ void MeshGLTest::addVertexBufferMatrixNxNd() { DynamicAttribute::Kind::Long, 0, DynamicAttribute::Components::Three, 3, DynamicAttribute::DataType::Double}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -1090,7 +1090,7 @@ void MeshGLTest::addVertexBufferMatrixMxN() { DynamicAttribute::Kind::Generic, 0, DynamicAttribute::Components::Four, 3, DynamicAttribute::DataType::Float}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -1128,7 +1128,7 @@ void MeshGLTest::addVertexBufferMatrixMxNd() { DynamicAttribute::Kind::Long, 0, DynamicAttribute::Components::Four, 3, DynamicAttribute::DataType::Double}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -1175,7 +1175,7 @@ void MeshGLTest::addVertexBufferUnsignedIntWithUnsignedShort() { DynamicAttribute::Kind::Integral, 0, DynamicAttribute::Components::One, DynamicAttribute::DataType::UnsignedShort}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -1213,7 +1213,7 @@ void MeshGLTest::addVertexBufferUnsignedIntWithShort() { DynamicAttribute::Kind::Integral, 0, DynamicAttribute::Components::One, DynamicAttribute::DataType::Short}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -1251,7 +1251,7 @@ void MeshGLTest::addVertexBufferIntWithUnsignedShort() { DynamicAttribute::Kind::Integral, 0, DynamicAttribute::Components::One, DynamicAttribute::DataType::UnsignedShort}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -1289,7 +1289,7 @@ void MeshGLTest::addVertexBufferIntWithShort() { DynamicAttribute::Kind::Integral, 0, DynamicAttribute::Components::One, DynamicAttribute::DataType::Short}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -1332,7 +1332,7 @@ void MeshGLTest::addVertexBufferFloatWithHalf() { DynamicAttribute::Kind::Generic, 0, DynamicAttribute::Components::One, DynamicAttribute::DataType::Half}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -1363,7 +1363,7 @@ void MeshGLTest::addVertexBufferFloatWithDouble() { DynamicAttribute::Kind::Generic, 0, DynamicAttribute::Components::One, DynamicAttribute::DataType::Double}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -1395,7 +1395,7 @@ void MeshGLTest::addVertexBufferVector3WithUnsignedInt10f11f11fRev() { DynamicAttribute::Kind::Generic, 0, DynamicAttribute::Components::Three, DynamicAttribute::DataType::UnsignedInt10f11f11fRev}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); /* Won't test the actual values */ @@ -1424,7 +1424,7 @@ void MeshGLTest::addVertexBufferVector4WithUnsignedInt2101010Rev() { DynamicAttribute::Kind::Generic, 0, DynamicAttribute::Components::Four, DynamicAttribute::DataType::UnsignedInt2101010Rev}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); /* Won't test the actual values */ @@ -1451,7 +1451,7 @@ void MeshGLTest::addVertexBufferVector4WithInt2101010Rev() { DynamicAttribute::Kind::Generic, 0, DynamicAttribute::Components::Four, DynamicAttribute::DataType::Int2101010Rev}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); /* Won't test the actual values */ @@ -1485,7 +1485,7 @@ void MeshGLTest::addVertexBufferLessVectorComponents() { DynamicAttribute::Kind::Generic, 0, DynamicAttribute::Components::Three, DynamicAttribute::DataType::Float}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -1532,7 +1532,7 @@ void MeshGLTest::addVertexBufferNormalized() { DynamicAttribute::Kind::GenericNormalized, 0, DynamicAttribute::Components::Three, DynamicAttribute::DataType::UnsignedByte}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); @@ -1574,7 +1574,7 @@ void MeshGLTest::addVertexBufferBGRA() { DynamicAttribute::Kind::GenericNormalized, 0, DynamicAttribute::Components::BGRA, DynamicAttribute::DataType::UnsignedByte}); - } else CORRADE_ASSERT_UNREACHABLE(); + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); MAGNUM_VERIFY_NO_GL_ERROR(); diff --git a/src/Magnum/Math/Color.h b/src/Magnum/Math/Color.h index 9b8d2c180..4f8724856 100644 --- a/src/Magnum/Math/Color.h +++ b/src/Magnum/Math/Color.h @@ -66,7 +66,7 @@ template typename std::enable_if::value, Color3>: case 3: return {p, q, hsv.value}; case 4: return {t, p, hsv.value}; case 5: return {hsv.value, p, q}; - default: CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + default: CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } } template inline typename std::enable_if::value, Color3>::type fromHsv(const ColorHsv::FloatingPointType>& hsv) { diff --git a/src/Magnum/Mesh.cpp b/src/Magnum/Mesh.cpp index 6ba49fed2..e7201ed16 100644 --- a/src/Magnum/Mesh.cpp +++ b/src/Magnum/Mesh.cpp @@ -39,7 +39,7 @@ UnsignedInt meshIndexTypeSize(MeshIndexType type) { case MeshIndexType::UnsignedInt: return 4; } - CORRADE_ASSERT(false, "meshIndexTypeSize(): invalid type" << type, {}); + CORRADE_ASSERT_UNREACHABLE("meshIndexTypeSize(): invalid type" << type, {}); } #ifndef DOXYGEN_GENERATING_OUTPUT diff --git a/src/Magnum/MeshTools/GenerateNormals.cpp b/src/Magnum/MeshTools/GenerateNormals.cpp index ce6e11151..bc55752c4 100644 --- a/src/Magnum/MeshTools/GenerateNormals.cpp +++ b/src/Magnum/MeshTools/GenerateNormals.cpp @@ -203,7 +203,7 @@ template inline void generateSmoothNormalsIntoImplementation(const Cont if(v == v0i) angle = crossAngle.second[0]; else if(v == v1i) angle = crossAngle.second[1]; else if(v == v2i) angle = crossAngle.second[2]; - else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ /* The normal is cross.normalized(), we need to multiply it it by surface area which is cross.length()/2. Since normalization is diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 7867c49f3..b4e75d4d7 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -868,7 +868,7 @@ bool Sdl2Application::mainLoopIteration() { /* If anybody sees this assert, then emscripten finally implemented resize events. Praise them for that. https://github.com/kripken/emscripten/issues/1731 */ - CORRADE_ASSERT_UNREACHABLE(); + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); #else /* {event.window.data1, event.window.data2} seems to be framebuffer size and not window size on macOS, which diff --git a/src/Magnum/Trade/AbstractImporter.cpp b/src/Magnum/Trade/AbstractImporter.cpp index 39227ace0..d9734a1c9 100644 --- a/src/Magnum/Trade/AbstractImporter.cpp +++ b/src/Magnum/Trade/AbstractImporter.cpp @@ -172,7 +172,7 @@ bool AbstractImporter::openFile(const std::string& filename) { _fileCallback(filename, InputFileCallbackPolicy::Close, _fileCallbackUserData); /* Shouldn't get here, the assert is fired already in setFileCallback() */ - } else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ return isOpened(); } diff --git a/src/Magnum/Trade/AnimationData.cpp b/src/Magnum/Trade/AnimationData.cpp index d315a0bef..b41da17f2 100644 --- a/src/Magnum/Trade/AnimationData.cpp +++ b/src/Magnum/Trade/AnimationData.cpp @@ -198,7 +198,7 @@ Debug& operator<<(Debug& debug, const AnimationTrackTargetType value) { /* LCOV_EXCL_STOP */ /* To silence compiler warning about unhandled values */ - case AnimationTrackTargetType::Custom: CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + case AnimationTrackTargetType::Custom: CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } return debug << "Trade::AnimationTrackTargetType(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; diff --git a/src/Magnum/Trade/MeshData.cpp b/src/Magnum/Trade/MeshData.cpp index d12d88917..7ab34dd42 100644 --- a/src/Magnum/Trade/MeshData.cpp +++ b/src/Magnum/Trade/MeshData.cpp @@ -305,7 +305,7 @@ UnsignedInt MeshData::attributeFor(const MeshAttribute name, UnsignedInt id) con } #ifdef CORRADE_NO_ASSERT - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ #else return ~UnsignedInt{}; #endif @@ -411,7 +411,7 @@ void MeshData::indicesInto(const Containers::StridedArrayView1D des return Math::castInto(Containers::arrayCast<2, const UnsignedShort>(Containers::arrayView(reinterpret_cast(_indices), _indexCount)), destination1ui); else if(_indexType == MeshIndexType::UnsignedByte) return Math::castInto(Containers::arrayCast<2, const UnsignedByte>(Containers::arrayView(reinterpret_cast(_indices), _indexCount)), destination1ui); - else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } Containers::Array MeshData::indicesAsArray() const { @@ -464,7 +464,7 @@ void MeshData::positions2DInto(const Containers::StridedArrayView1D des else if(attribute._format == VertexFormat::Vector2sNormalized || attribute._format == VertexFormat::Vector3sNormalized) Math::unpackInto(Containers::arrayCast<2, const Short>(attributeData, 2), destination2f); - else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } Containers::Array MeshData::positions2DAsArray(const UnsignedInt id) const { @@ -528,7 +528,7 @@ void MeshData::positions3DInto(const Containers::StridedArrayView1D des Math::unpackInto(Containers::arrayCast<2, const UnsignedShort>(attributeData, 3), destination3f); else if(attribute._format == VertexFormat::Vector3sNormalized) Math::unpackInto(Containers::arrayCast<2, const Short>(attributeData, 3), destination3f); - else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ /* For 2D positions finally fill the Z with a single value */ if(attribute._format == VertexFormat::Vector2 || @@ -567,7 +567,7 @@ void tangentsOrNormalsInto(const Containers::StridedArrayView1D attr Math::unpackInto(Containers::arrayCast<2, const Byte>(attributeData, 3), destination3f); else if(format == VertexFormat::Vector3sNormalized) Math::unpackInto(Containers::arrayCast<2, const Short>(attributeData, 3), destination3f); - else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } } @@ -690,7 +690,7 @@ void MeshData::textureCoordinates2DInto(const Containers::StridedArrayView1D(attributeData, 2), destination2f); else if(attribute._format == VertexFormat::Vector2sNormalized) Math::unpackInto(Containers::arrayCast<2, const Short>(attributeData, 2), destination2f); - else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } Containers::Array MeshData::textureCoordinates2DAsArray(const UnsignedInt id) const { @@ -732,7 +732,7 @@ void MeshData::colorsInto(const Containers::StridedArrayView1D destinati Math::unpackInto(Containers::arrayCast<2, const UnsignedByte>(attributeData, 4), destination4f); else if(attribute._format == VertexFormat::Vector4usNormalized) Math::unpackInto(Containers::arrayCast<2, const UnsignedShort>(attributeData, 4), destination4f); - else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ /* For three-component colors finally fill the alpha with a single value */ if(attribute._format == VertexFormat::Vector3 || @@ -768,7 +768,7 @@ void MeshData::objectIdsInto(const Containers::StridedArrayView1D d Math::castInto(Containers::arrayCast<2, const UnsignedShort>(attributeData, 1), destination1ui); else if(attribute._format == VertexFormat::UnsignedByte) Math::castInto(Containers::arrayCast<2, const UnsignedByte>(attributeData, 1), destination1ui); - else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } Containers::Array MeshData::objectIdsAsArray(const UnsignedInt id) const { @@ -815,7 +815,7 @@ Debug& operator<<(Debug& debug, const MeshAttribute value) { /* LCOV_EXCL_STOP */ /* To silence compiler warning about unhandled values */ - case MeshAttribute::Custom: CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + case MeshAttribute::Custom: CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << ")"; diff --git a/src/Magnum/VertexFormat.cpp b/src/Magnum/VertexFormat.cpp index 38b07a039..657606f42 100644 --- a/src/Magnum/VertexFormat.cpp +++ b/src/Magnum/VertexFormat.cpp @@ -850,7 +850,7 @@ VertexFormat vertexFormat(const VertexFormat format, const UnsignedInt component else CORRADE_ASSERT(false, "vertexFormat(): invalid component count" << componentCount, {}); - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } VertexFormat vertexFormat(const VertexFormat format, const UnsignedInt vectorCount, UnsignedInt componentCount, const bool aligned) { diff --git a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp index 7dab66d07..58dc9764e 100644 --- a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp @@ -110,7 +110,7 @@ void MagnumFontConverterTest::exportFont() { case 2: return {23, 0}; } - CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ } bool _opened; diff --git a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp index af0b8f39a..ae88b55a1 100644 --- a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp +++ b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp @@ -351,7 +351,7 @@ Containers::Optional ObjImporter::doMesh(UnsignedInt id, UnsignedInt) primitive = MeshPrimitive::Triangles; - } else CORRADE_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ + } else CORRADE_INTERNAL_ASSERT_UNREACHABLE(); /* LCOV_EXCL_LINE */ for(const std::string& indexTuple: indexTuples) { std::vector indexStrings = Utility::String::split(indexTuple, '/');