From 8c9c2b5ddb5a2c5784be35656d6641ce4cc69742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 21 Apr 2022 00:12:21 +0200 Subject: [PATCH] Trade: use the custom field/attribute helpers in debug printers. Like, it's a *debug printer*, why an inline call would matter in there. Or maybe it's that the debug printer was done way earlier than the helpers? ... and then copied, without a brain attached to my head, from MeshData to the new SceneData? --- src/Magnum/Trade/MeshData.cpp | 4 ++-- src/Magnum/Trade/SceneData.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Trade/MeshData.cpp b/src/Magnum/Trade/MeshData.cpp index 1f1b06c7b..af709a187 100644 --- a/src/Magnum/Trade/MeshData.cpp +++ b/src/Magnum/Trade/MeshData.cpp @@ -884,8 +884,8 @@ Debug& operator<<(Debug& debug, const MeshAttribute value) { if(!packed) debug << "Trade::MeshAttribute" << Debug::nospace; - if(UnsignedShort(value) >= UnsignedShort(MeshAttribute::Custom)) - return debug << (packed ? "Custom(" : "::Custom(") << Debug::nospace << (UnsignedInt(value) - UnsignedInt(MeshAttribute::Custom)) << Debug::nospace << ")"; + if(isMeshAttributeCustom(value)) + return debug << (packed ? "Custom(" : "::Custom(") << Debug::nospace << meshAttributeCustom(value) << Debug::nospace << ")"; switch(value) { /* LCOV_EXCL_START */ diff --git a/src/Magnum/Trade/SceneData.cpp b/src/Magnum/Trade/SceneData.cpp index 64a5b469f..602d3a976 100644 --- a/src/Magnum/Trade/SceneData.cpp +++ b/src/Magnum/Trade/SceneData.cpp @@ -112,8 +112,8 @@ Debug& operator<<(Debug& debug, const SceneField value) { if(!packed) debug << "Trade::SceneField" << Debug::nospace; - if(UnsignedInt(value) >= UnsignedInt(SceneField::Custom)) - return debug << (packed ? "Custom(" : "::Custom(") << Debug::nospace << (UnsignedInt(value) - UnsignedInt(SceneField::Custom)) << Debug::nospace << ")"; + if(isSceneFieldCustom(value)) + return debug << (packed ? "Custom(" : "::Custom(") << Debug::nospace << sceneFieldCustom(value) << Debug::nospace << ")"; switch(value) { /* LCOV_EXCL_START */