diff --git a/src/Magnum/MeshTools/Interleave.h b/src/Magnum/MeshTools/Interleave.h index 67cbbb82c..ff03bb6d2 100644 --- a/src/Magnum/MeshTools/Interleave.h +++ b/src/Magnum/MeshTools/Interleave.h @@ -44,11 +44,12 @@ namespace Implementation { resolution (the functions would otherwise need to be de-inlined to break cyclic dependencies) */ struct AttributeCount { - template typename std::enable_if::value, std::size_t>::type operator()(const T& first, const U&... next) const { - CORRADE_ASSERT(sizeof...(next) == 0 || AttributeCount{}(next...) == first.size() || AttributeCount{}(next...) == ~std::size_t(0), "MeshTools::interleave(): attribute arrays don't have the same length, expected" << first.size() << "but got" << AttributeCount{}(next...), 0); - #if defined(CORRADE_NO_ASSERT) && !defined(CORRADE_GRACEFUL_ASSERT) - static_cast(sizeof...(next)); + template typename std::enable_if::value, std::size_t>::type operator()(const T& first, const U&... + #if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT) + next #endif + ) const { + CORRADE_ASSERT(sizeof...(next) == 0 || AttributeCount{}(next...) == first.size() || AttributeCount{}(next...) == ~std::size_t(0), "MeshTools::interleave(): attribute arrays don't have the same length, expected" << first.size() << "but got" << AttributeCount{}(next...), 0); return first.size(); } diff --git a/src/Magnum/SceneGraph/Object.hpp b/src/Magnum/SceneGraph/Object.hpp index 9d3bcffeb..74bea0352 100644 --- a/src/Magnum/SceneGraph/Object.hpp +++ b/src/Magnum/SceneGraph/Object.hpp @@ -212,8 +212,10 @@ template std::vector Ob } std::vector>> jointObjects(objects); + #if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT) /* Scene object */ const Scene* scene = this->scene(); + #endif /* Nearest common ancestor not yet implemented - assert this is done on scene */ CORRADE_ASSERT(scene == this, "SceneGraph::Object::transformationMatrices(): currently implemented only for Scene", {}); diff --git a/src/Magnum/Text/Renderer.cpp b/src/Magnum/Text/Renderer.cpp index 3d13faa72..cde237fc6 100644 --- a/src/Magnum/Text/Renderer.cpp +++ b/src/Magnum/Text/Renderer.cpp @@ -93,13 +93,12 @@ std::tuple, Range2D> renderVerticesInternal(AbstractFont& fo /* Layout the line */ const auto layouter = font.layout(cache, size, line); - const UnsignedInt vertexCount = layouter->glyphCount()*4; /* Verify that we don't reallocate anything. The only problem might arise when the layouter decides to compose one character from more than one glyph (i.e. accents). Will remove the assert when this issue arises. */ - CORRADE_INTERNAL_ASSERT(vertices.size()+vertexCount <= vertices.capacity()); + CORRADE_INTERNAL_ASSERT(vertices.size() + layouter->glyphCount()*4 <= vertices.capacity()); /* Bounds of rendered line */ Range2D lineRectangle;