From f589f032147c706eca235e38772070fca0ba3ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 2 Oct 2024 18:48:23 +0200 Subject: [PATCH] Move a source-local array closer to the function that uses it. --- src/Magnum/PixelFormat.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Magnum/PixelFormat.cpp b/src/Magnum/PixelFormat.cpp index 095cbe4d4..f57fb25b5 100644 --- a/src/Magnum/PixelFormat.cpp +++ b/src/Magnum/PixelFormat.cpp @@ -761,12 +761,6 @@ Debug& operator<<(Debug& debug, const PixelFormat value) { namespace { #ifndef DOXYGEN_GENERATING_OUTPUT /* It gets *really* confused */ -constexpr const char* CompressedPixelFormatNames[] { - #define _c(format, width, height, depth, size) #format, - #include "Magnum/Implementation/compressedPixelFormatMapping.hpp" - #undef _c -}; - constexpr UnsignedShort CompressedBlockData[] { /* Assuming w/h/d/s is never larger than 16 (and never zero), each number has 1 subtracted and packed into four bits, 16 bits in total. The size @@ -814,6 +808,18 @@ UnsignedInt compressedPixelFormatBlockDataSize(const CompressedPixelFormat forma return (CompressedBlockData[UnsignedInt(format) - 1] & 0xf) + 1; } +namespace { + +#ifndef DOXYGEN_GENERATING_OUTPUT +constexpr const char* CompressedPixelFormatNames[] { + #define _c(format, width, height, depth, size) #format, + #include "Magnum/Implementation/compressedPixelFormatMapping.hpp" + #undef _c +}; +#endif + +} + #ifndef DOXYGEN_GENERATING_OUTPUT Debug& operator<<(Debug& debug, const CompressedPixelFormat value) { const bool packed = debug.immediateFlags() >= Debug::Flag::Packed;