From 2f770bb2107091a15f071e094afe45133649647d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 28 Nov 2015 18:28:10 +0100 Subject: [PATCH] MeshTools: fix warnings in build with CORRADE_NO_ASSERT. --- src/Magnum/MeshTools/Interleave.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Magnum/MeshTools/Interleave.h b/src/Magnum/MeshTools/Interleave.h index 0d9e51115..758b7c798 100644 --- a/src/Magnum/MeshTools/Interleave.h +++ b/src/Magnum/MeshTools/Interleave.h @@ -46,6 +46,9 @@ namespace Implementation { 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)); + #endif return first.size(); } @@ -163,10 +166,12 @@ parameters. contain the interleaved data. */ template void interleaveInto(Containers::ArrayView buffer, const T& first, const U&... next) { + #if !defined(CORRADE_NO_ASSERT) || defined(CORRADE_GRACEFUL_ASSERT) /* Verify expected buffer size */ const std::size_t attributeCount = Implementation::AttributeCount{}(first, next...); const std::size_t stride = Implementation::Stride{}(first, next...); CORRADE_ASSERT(attributeCount*stride <= buffer.size(), "MeshTools::interleaveInto(): the data buffer is too small, expected" << attributeCount*stride << "but got" << buffer.size(), ); + #endif /* Write data */ Implementation::writeInterleaved(stride, buffer.begin(), first, next...);