From f64e1ac2c3a72e79af23c028256250b094f860fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 26 Nov 2023 11:42:18 +0100 Subject: [PATCH] Text: fix unused variable warnings in a no-assert build. --- src/Magnum/Text/AbstractGlyphCache.cpp | 3 +-- src/Magnum/Text/DistanceFieldGlyphCache.cpp | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Text/AbstractGlyphCache.cpp b/src/Magnum/Text/AbstractGlyphCache.cpp index d6c71d15f..d2da74479 100644 --- a/src/Magnum/Text/AbstractGlyphCache.cpp +++ b/src/Magnum/Text/AbstractGlyphCache.cpp @@ -314,10 +314,9 @@ UnsignedInt AbstractGlyphCache::addGlyph(const UnsignedInt fontId, const Unsigne "Text::AbstractGlyphCache::addGlyph(): glyph" << fontGlyphId << "in font" << fontId << "already added at index" << state.fontGlyphMapping[fontOffset + fontGlyphId], {}); /** @todo expand once rotations (and thus negative rectangle sizes) are supported */ - const Range2Di rectanglePadded = rectangle.padded(state.padding); #ifndef CORRADE_NO_ASSERT const Range2Dui rectangleu{rectangle}; - const Range2Dui rectanglePaddedu{rectanglePadded}; + const Range2Dui rectanglePaddedu{rectangle.padded(state.padding)}; #endif CORRADE_ASSERT(UnsignedInt(layer) < UnsignedInt(state.image.size().z()) && (rectangleu.min() <= rectangleu.max()).all() && (rectanglePaddedu.min() <= Vector2ui{state.image.size().xy()}).all() && (rectanglePaddedu.max() <= Vector2ui{state.image.size().xy()}).all(), "Text::AbstractGlyphCache::addGlyph(): layer" << layer << "and rectangle" << Debug::packed << rectangle << "out of range for size" << Debug::packed << state.image.size() << "and padding" << Debug::packed << state.padding, {}); diff --git a/src/Magnum/Text/DistanceFieldGlyphCache.cpp b/src/Magnum/Text/DistanceFieldGlyphCache.cpp index 9819232ea..7308bf74a 100644 --- a/src/Magnum/Text/DistanceFieldGlyphCache.cpp +++ b/src/Magnum/Text/DistanceFieldGlyphCache.cpp @@ -123,6 +123,9 @@ void DistanceFieldGlyphCache::doSetImage(const Vector2i& offset, const ImageView support border clamp, (c) required the input texture to have certain wrapping mode set */ CORRADE_INTERNAL_ASSERT(image.storage().skip().xy() == offset); + #ifdef CORRADE_NO_ASSERT + static_cast(offset); + #endif const Vector2i paddedMin = Math::max(Vector2i{0}, image.storage().skip().xy() - padding()); const Vector2i paddedMax = Math::min(size().xy(),