diff --git a/doc/changelog.dox b/doc/changelog.dox index e4887128f0..5c50dc61bf 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -1051,6 +1051,9 @@ See also: libraries, as that breaks builds with version 3.1.52+. See [mosra/magnum#633](https://github.com/mosra/magnum/issues/633) for more information. +- Fixed most remaining warnings on MSVC, in particular those related to + "conversion from T to void * of greater size" (see + [mosra/magnum#544](https://github.com/mosra/magnum/issues/544)). @subsection changelog-latest-bugfixes Bug fixes diff --git a/src/Magnum/Animation/Interpolation.cpp b/src/Magnum/Animation/Interpolation.cpp index 648e0f59bc..1fffa0425d 100644 --- a/src/Magnum/Animation/Interpolation.cpp +++ b/src/Magnum/Animation/Interpolation.cpp @@ -48,7 +48,7 @@ Debug& operator<<(Debug& debug, const Interpolation value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const Extrapolation value) { @@ -67,7 +67,7 @@ Debug& operator<<(Debug& debug, const Extrapolation value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } #endif diff --git a/src/Magnum/Animation/Player.cpp b/src/Magnum/Animation/Player.cpp index 437c6fcbcd..38fec6e7ea 100644 --- a/src/Magnum/Animation/Player.cpp +++ b/src/Magnum/Animation/Player.cpp @@ -40,7 +40,7 @@ Debug& operator<<(Debug& debug, const State value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } /* On non-MinGW Windows the instantiations are already marked with extern diff --git a/src/Magnum/Audio/AbstractImporter.cpp b/src/Magnum/Audio/AbstractImporter.cpp index 19ab89e583..a08fe835ea 100644 --- a/src/Magnum/Audio/AbstractImporter.cpp +++ b/src/Magnum/Audio/AbstractImporter.cpp @@ -154,7 +154,7 @@ Debug& operator<<(Debug& debug, const ImporterFeature value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const ImporterFeatures value) { diff --git a/src/Magnum/Audio/BufferFormat.cpp b/src/Magnum/Audio/BufferFormat.cpp index 287cf99009..a0b7a0d6e7 100644 --- a/src/Magnum/Audio/BufferFormat.cpp +++ b/src/Magnum/Audio/BufferFormat.cpp @@ -75,7 +75,7 @@ Debug& operator<<(Debug& debug, const BufferFormat value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(ALenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << ALenum(value) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/Audio/Context.cpp b/src/Magnum/Audio/Context.cpp index 566aa42b82..bee6af1e23 100644 --- a/src/Magnum/Audio/Context.cpp +++ b/src/Magnum/Audio/Context.cpp @@ -84,7 +84,7 @@ Debug& operator<<(Debug& debug, const Context::HrtfStatus value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(ALenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << ALenum(value) << Debug::nospace << ")"; } namespace { diff --git a/src/Magnum/Audio/Renderer.cpp b/src/Magnum/Audio/Renderer.cpp index c28221602f..99d09e8130 100644 --- a/src/Magnum/Audio/Renderer.cpp +++ b/src/Magnum/Audio/Renderer.cpp @@ -45,7 +45,7 @@ Debug& operator<<(Debug& debug, const Renderer::Error value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(ALenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << ALenum(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const Renderer::DistanceModel value) { @@ -65,7 +65,7 @@ Debug& operator<<(Debug& debug, const Renderer::DistanceModel value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(ALenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << ALenum(value) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/Audio/Source.cpp b/src/Magnum/Audio/Source.cpp index e736ddbd9f..79086f9f2f 100644 --- a/src/Magnum/Audio/Source.cpp +++ b/src/Magnum/Audio/Source.cpp @@ -139,7 +139,7 @@ Debug& operator<<(Debug& debug, const Source::State value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(ALint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << ALint(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const Source::Type value) { @@ -155,7 +155,7 @@ Debug& operator<<(Debug& debug, const Source::Type value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(ALint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << ALint(value) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/DebugTools/FrameProfiler.cpp b/src/Magnum/DebugTools/FrameProfiler.cpp index 87ea7347c3..bba0507c52 100644 --- a/src/Magnum/DebugTools/FrameProfiler.cpp +++ b/src/Magnum/DebugTools/FrameProfiler.cpp @@ -427,7 +427,7 @@ Debug& operator<<(Debug& debug, const FrameProfiler::Units value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } #ifdef MAGNUM_TARGET_GL @@ -656,7 +656,7 @@ Debug& operator<<(Debug& debug, const FrameProfilerGL::Value value) { if(1 << bit == UnsignedShort(value)) return debug << "::" << Debug::nospace << FrameProfilerGLValueNames[bit]; - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedShort(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const FrameProfilerGL::Values value) { diff --git a/src/Magnum/FileCallback.cpp b/src/Magnum/FileCallback.cpp index ba70bf9bca..50372dc610 100644 --- a/src/Magnum/FileCallback.cpp +++ b/src/Magnum/FileCallback.cpp @@ -42,7 +42,7 @@ Debug& operator<<(Debug& debug, const InputFileCallbackPolicy value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } } diff --git a/src/Magnum/GL/Attribute.cpp b/src/Magnum/GL/Attribute.cpp index 47b2e56982..e32394df3c 100644 --- a/src/Magnum/GL/Attribute.cpp +++ b/src/Magnum/GL/Attribute.cpp @@ -50,7 +50,7 @@ Debug& operator<<(Debug& debug, const DynamicAttribute::Kind value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const DynamicAttribute::Components value) { @@ -70,7 +70,7 @@ Debug& operator<<(Debug& debug, const DynamicAttribute::Components value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const DynamicAttribute::DataType value) { @@ -101,7 +101,7 @@ Debug& operator<<(Debug& debug, const DynamicAttribute::DataType value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } namespace Implementation { @@ -231,7 +231,7 @@ Debug& operator<<(Debug& debug, const SizedAttribute<1, 1>::Components value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const SizedAttribute<1, 2>::Components value) { @@ -246,7 +246,7 @@ Debug& operator<<(Debug& debug, const SizedAttribute<1, 2>::Components value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const SizedAttribute<1, 3>::Components value) { @@ -263,7 +263,7 @@ Debug& operator<<(Debug& debug, const SizedAttribute<1, 3>::Components value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const SizedAttribute<1, 4>::Components value) { @@ -282,7 +282,7 @@ Debug& operator<<(Debug& debug, const SizedAttribute<1, 4>::Components value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const SizedMatrixAttribute<2>::Components value) { @@ -295,7 +295,7 @@ Debug& operator<<(Debug& debug, const SizedMatrixAttribute<2>::Components value) /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const SizedMatrixAttribute<3>::Components value) { @@ -308,7 +308,7 @@ Debug& operator<<(Debug& debug, const SizedMatrixAttribute<3>::Components value) /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const SizedMatrixAttribute<4>::Components value) { @@ -321,7 +321,7 @@ Debug& operator<<(Debug& debug, const SizedMatrixAttribute<4>::Components value) /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const Attribute>::Components value) { @@ -344,7 +344,7 @@ Debug& operator<<(Debug& debug, const Attribute>::Compone /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const FloatAttribute::DataType value) { @@ -370,7 +370,7 @@ Debug& operator<<(Debug& debug, const FloatAttribute::DataType value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #ifndef MAGNUM_TARGET_GLES2 @@ -390,7 +390,7 @@ Debug& operator<<(Debug& debug, const IntAttribute::DataType value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif @@ -406,7 +406,7 @@ Debug& operator<<(Debug& debug, const DoubleAttribute::DataType value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif @@ -434,7 +434,7 @@ Debug& operator<<(Debug& debug, const Attribute>::DataTyp /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const Attribute>::DataType value) { @@ -464,7 +464,7 @@ Debug& operator<<(Debug& debug, const Attribute>::DataTyp /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } } diff --git a/src/Magnum/GL/Buffer.cpp b/src/Magnum/GL/Buffer.cpp index 63c124220f..e5793835b3 100644 --- a/src/Magnum/GL/Buffer.cpp +++ b/src/Magnum/GL/Buffer.cpp @@ -716,7 +716,7 @@ Debug& operator<<(Debug& debug, const Buffer::TargetHint value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #ifndef MAGNUM_TARGET_GLES2 @@ -733,7 +733,7 @@ Debug& operator<<(Debug& debug, const Buffer::Target value) { #undef _c } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif #endif diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index fc1454224a..1d6c6ea41a 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -1341,7 +1341,7 @@ Debug& operator<<(Debug& debug, const Context::Flag value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const Context::Flags value) { @@ -1388,7 +1388,7 @@ Debug& operator<<(Debug& debug, const Context::DetectedDriver value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const Context::DetectedDrivers value) { diff --git a/src/Magnum/GL/DebugOutput.cpp b/src/Magnum/GL/DebugOutput.cpp index ce13b7b195..eddfde54e4 100644 --- a/src/Magnum/GL/DebugOutput.cpp +++ b/src/Magnum/GL/DebugOutput.cpp @@ -248,7 +248,7 @@ Debug& operator<<(Debug& debug, const DebugOutput::Source value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const DebugOutput::Type value) { @@ -270,7 +270,7 @@ Debug& operator<<(Debug& debug, const DebugOutput::Type value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const DebugOutput::Severity value) { @@ -285,7 +285,7 @@ Debug& operator<<(Debug& debug, const DebugOutput::Severity value) { #undef _c } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif @@ -330,7 +330,7 @@ Debug& operator<<(Debug& debug, const DebugMessage::Source value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const DebugMessage::Type value) { @@ -348,7 +348,7 @@ Debug& operator<<(Debug& debug, const DebugMessage::Type value) { #undef _c } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif @@ -434,7 +434,7 @@ Debug& operator<<(Debug& debug, const DebugGroup::Source value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/GL/DefaultFramebuffer.cpp b/src/Magnum/GL/DefaultFramebuffer.cpp index 5b794e7ef1..20dd6280a0 100644 --- a/src/Magnum/GL/DefaultFramebuffer.cpp +++ b/src/Magnum/GL/DefaultFramebuffer.cpp @@ -140,7 +140,7 @@ Debug& operator<<(Debug& debug, const DefaultFramebuffer::Status value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/GL/Framebuffer.cpp b/src/Magnum/GL/Framebuffer.cpp index d6fa4a0aa1..7786108845 100644 --- a/src/Magnum/GL/Framebuffer.cpp +++ b/src/Magnum/GL/Framebuffer.cpp @@ -482,7 +482,7 @@ Debug& operator<<(Debug& debug, const Framebuffer::Status value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/GL/Mesh.cpp b/src/Magnum/GL/Mesh.cpp index 54fc0ac8ad..ecfb69acbe 100644 --- a/src/Magnum/GL/Mesh.cpp +++ b/src/Magnum/GL/Mesh.cpp @@ -144,7 +144,7 @@ Debug& operator<<(Debug& debug, const MeshPrimitive value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const MeshIndexType value) { @@ -160,7 +160,7 @@ Debug& operator<<(Debug& debug, const MeshIndexType value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/GL/PixelFormat.cpp b/src/Magnum/GL/PixelFormat.cpp index 119dde644f..5c2ff55010 100644 --- a/src/Magnum/GL/PixelFormat.cpp +++ b/src/Magnum/GL/PixelFormat.cpp @@ -408,7 +408,7 @@ Debug& operator<<(Debug& debug, const PixelFormat value) { #pragma GCC diagnostic pop #endif - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const PixelType value) { @@ -474,7 +474,7 @@ Debug& operator<<(Debug& debug, const PixelType value) { #pragma GCC diagnostic pop #endif - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } namespace { @@ -690,7 +690,7 @@ Debug& operator<<(Debug& debug, const CompressedPixelFormat value) { #pragma GCC diagnostic pop #endif - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/GL/Renderer.cpp b/src/Magnum/GL/Renderer.cpp index ab4164215a..a128b3127e 100644 --- a/src/Magnum/GL/Renderer.cpp +++ b/src/Magnum/GL/Renderer.cpp @@ -476,7 +476,7 @@ Debug& operator<<(Debug& debug, const Renderer::Error value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #ifndef MAGNUM_TARGET_WEBGL @@ -492,7 +492,7 @@ Debug& operator<<(Debug& debug, const Renderer::ResetNotificationStrategy value) /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const Renderer::GraphicsResetStatus value) { @@ -509,7 +509,7 @@ Debug& operator<<(Debug& debug, const Renderer::GraphicsResetStatus value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif #endif diff --git a/src/Magnum/GL/Sampler.cpp b/src/Magnum/GL/Sampler.cpp index e1da4e3e03..967a65e7ea 100644 --- a/src/Magnum/GL/Sampler.cpp +++ b/src/Magnum/GL/Sampler.cpp @@ -142,7 +142,7 @@ Debug& operator<<(Debug& debug, const SamplerFilter value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const SamplerMipmap value) { @@ -158,7 +158,7 @@ Debug& operator<<(Debug& debug, const SamplerMipmap value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const SamplerWrapping value) { @@ -178,7 +178,7 @@ Debug& operator<<(Debug& debug, const SamplerWrapping value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLint(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLint(value) << Debug::nospace << ")"; } #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) @@ -194,7 +194,7 @@ Debug& operator<<(Debug& debug, const SamplerCompareMode value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const SamplerCompareFunction value) { @@ -215,7 +215,7 @@ Debug& operator<<(Debug& debug, const SamplerCompareFunction value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif @@ -232,7 +232,7 @@ Debug& operator<<(Debug& debug, const SamplerDepthStencilMode value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif #endif diff --git a/src/Magnum/GL/Shader.cpp b/src/Magnum/GL/Shader.cpp index abfd27937d..8bc842f19b 100644 --- a/src/Magnum/GL/Shader.cpp +++ b/src/Magnum/GL/Shader.cpp @@ -983,7 +983,7 @@ Debug& operator<<(Debug& debug, const Shader::Type value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/GL/TextureFormat.cpp b/src/Magnum/GL/TextureFormat.cpp index c436070bf3..2b68dc592c 100644 --- a/src/Magnum/GL/TextureFormat.cpp +++ b/src/Magnum/GL/TextureFormat.cpp @@ -299,7 +299,7 @@ Debug& operator<<(Debug& debug, const TextureFormat value) { #pragma GCC diagnostic pop #endif - return debug << "(" << Debug::nospace << reinterpret_cast(GLenum(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << GLenum(value) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/GL/Version.cpp b/src/Magnum/GL/Version.cpp index 0061b518f1..1d7907e68c 100644 --- a/src/Magnum/GL/Version.cpp +++ b/src/Magnum/GL/Version.cpp @@ -72,7 +72,7 @@ Debug& operator<<(Debug& debug, const Version value) { /* LCOV_EXCL_STOP */ } - return debug << "Invalid(" << Debug::nospace << reinterpret_cast(Int(value)) << Debug::nospace << ")"; + return debug << "Invalid(" << Debug::nospace << Debug::hex << Int(value) << Debug::nospace << ")"; } #endif diff --git a/src/Magnum/ImageFlags.cpp b/src/Magnum/ImageFlags.cpp index 39cd7bfc1c..e04ed24205 100644 --- a/src/Magnum/ImageFlags.cpp +++ b/src/Magnum/ImageFlags.cpp @@ -52,7 +52,7 @@ Debug& operator<<(Debug& debug, const ImageFlag1D value) { #pragma warning(pop) #endif - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedShort(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const ImageFlag2D value) { @@ -69,7 +69,7 @@ Debug& operator<<(Debug& debug, const ImageFlag2D value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedShort(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const ImageFlag3D value) { @@ -87,7 +87,7 @@ Debug& operator<<(Debug& debug, const ImageFlag3D value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedShort(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const ImageFlags1D value) { diff --git a/src/Magnum/Mesh.cpp b/src/Magnum/Mesh.cpp index 4412a6d7bc..88f0e504f3 100644 --- a/src/Magnum/Mesh.cpp +++ b/src/Magnum/Mesh.cpp @@ -50,14 +50,14 @@ Debug& operator<<(Debug& debug, const MeshPrimitive value) { debug << "MeshPrimitive" << Debug::nospace; if(isMeshPrimitiveImplementationSpecific(value)) { - return debug << (packed ? "ImplementationSpecific(" : "::ImplementationSpecific(") << Debug::nospace << reinterpret_cast(meshPrimitiveUnwrap(value)) << Debug::nospace << ")"; + return debug << (packed ? "ImplementationSpecific(" : "::ImplementationSpecific(") << Debug::nospace << Debug::hex << meshPrimitiveUnwrap(value) << Debug::nospace << ")"; } if(UnsignedInt(value) - 1 < Containers::arraySize(MeshPrimitiveNames)) { return debug << (packed ? "" : "::") << Debug::nospace << MeshPrimitiveNames[UnsignedInt(value) - 1]; } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << (packed ? "" : ")"); } namespace { @@ -77,20 +77,20 @@ Debug& operator<<(Debug& debug, const MeshIndexType value) { debug << "MeshIndexType" << Debug::nospace; if(isMeshIndexTypeImplementationSpecific(value)) { - return debug << (packed ? "ImplementationSpecific(" : "::ImplementationSpecific(") << Debug::nospace << reinterpret_cast(meshIndexTypeUnwrap(value)) << Debug::nospace << ")"; + return debug << (packed ? "ImplementationSpecific(" : "::ImplementationSpecific(") << Debug::nospace << Debug::hex << meshIndexTypeUnwrap(value) << Debug::nospace << ")"; } if(UnsignedInt(value) - 1 < Containers::arraySize(MeshIndexTypeNames)) { return debug << (packed ? "" : "::") << Debug::nospace << MeshIndexTypeNames[UnsignedInt(value) - 1]; } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << (packed ? "" : ")"); } #endif UnsignedInt meshIndexTypeSize(const MeshIndexType type) { CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(type), - "meshIndexTypeSize(): can't determine size of an implementation-specific type" << reinterpret_cast(meshIndexTypeUnwrap(type)), {}); + "meshIndexTypeSize(): can't determine size of an implementation-specific type" << Debug::hex << meshIndexTypeUnwrap(type), {}); switch(type) { case MeshIndexType::UnsignedByte: return 1; diff --git a/src/Magnum/Mesh.h b/src/Magnum/Mesh.h index d3c940fd94..3a9f0f27c9 100644 --- a/src/Magnum/Mesh.h +++ b/src/Magnum/Mesh.h @@ -223,7 +223,7 @@ remaining 31 bits. Use @ref meshPrimitiveUnwrap() for the inverse operation. template constexpr MeshPrimitive meshPrimitiveWrap(T implementationSpecific) { static_assert(sizeof(T) <= 4, "types larger than 32bits are not supported"); return CORRADE_CONSTEXPR_ASSERT(!(UnsignedInt(implementationSpecific) & (1u << 31)), - "meshPrimitiveWrap(): implementation-specific value" << reinterpret_cast(implementationSpecific) << "already wrapped or too large"), + "meshPrimitiveWrap(): implementation-specific value" << Debug::hex << UnsignedInt(implementationSpecific) << "already wrapped or too large"), MeshPrimitive((1u << 31)|UnsignedInt(implementationSpecific)); } @@ -329,7 +329,7 @@ remaining 31 bits. Use @ref meshIndexTypeUnwrap() for the inverse operation. template constexpr MeshIndexType meshIndexTypeWrap(T implementationSpecific) { static_assert(sizeof(T) <= 4, "types larger than 32bits are not supported"); return CORRADE_CONSTEXPR_ASSERT(!(UnsignedInt(implementationSpecific) & (1u << 31)), - "meshIndexTypeWrap(): implementation-specific value" << reinterpret_cast(implementationSpecific) << "already wrapped or too large"), + "meshIndexTypeWrap(): implementation-specific value" << Debug::hex << UnsignedInt(implementationSpecific) << "already wrapped or too large"), MeshIndexType((1u << 31)|UnsignedInt(implementationSpecific)); } diff --git a/src/Magnum/MeshTools/Combine.cpp b/src/Magnum/MeshTools/Combine.cpp index 7138e775ad..5b5c2d1354 100644 --- a/src/Magnum/MeshTools/Combine.cpp +++ b/src/Magnum/MeshTools/Combine.cpp @@ -71,7 +71,7 @@ Trade::MeshData combineIndexedImplementation( this is easier; plus the user gets a less confusing function name in the message */ CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - assertPrefix << "attribute" << j << "of mesh" << i << "has an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), + assertPrefix << "attribute" << j << "of mesh" << i << "has an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), (Trade::MeshData{MeshPrimitive::Points, 0})); attributes[attributeOffset++] = mesh.attributeData(j); } @@ -130,7 +130,7 @@ Trade::MeshData combineIndexedAttributes(const Containers::Iterable(meshIndexTypeUnwrap(indexType)), + "MeshTools::combineIndexedAttributes(): data" << i << "has an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(indexType), (Trade::MeshData{MeshPrimitive{}, 0})); if(i == 0) { primitive = meshes[i].primitive(); @@ -188,13 +188,13 @@ Trade::MeshData combineFaceAttributes(const Trade::MeshData& mesh, const Trade:: /* Make a combined index array. First copy the mesh indices as-is. */ const MeshIndexType meshIndexType = mesh.indexType(); CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(meshIndexType), - "MeshTools::combineFaceAttributes(): vertex mesh has an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(meshIndexType)), + "MeshTools::combineFaceAttributes(): vertex mesh has an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(meshIndexType), (Trade::MeshData{MeshPrimitive{}, 0})); const UnsignedInt meshIndexSize = meshIndexTypeSize(meshIndexType); UnsignedInt faceIndexSize; if(faceAttributes.isIndexed()) { CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(faceAttributes.indexType()), - "MeshTools::combineFaceAttributes(): face mesh has an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(faceAttributes.indexType())), + "MeshTools::combineFaceAttributes(): face mesh has an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(faceAttributes.indexType()), (Trade::MeshData{MeshPrimitive{}, 0})); faceIndexSize = meshIndexTypeSize(faceAttributes.indexType()); } else faceIndexSize = 4; diff --git a/src/Magnum/MeshTools/Compile.cpp b/src/Magnum/MeshTools/Compile.cpp index f021db714a..d00f3c883b 100644 --- a/src/Magnum/MeshTools/Compile.cpp +++ b/src/Magnum/MeshTools/Compile.cpp @@ -126,7 +126,7 @@ GL::Mesh compileInternal(const Trade::MeshData& meshData, GL::Buffer&& indices, const VertexFormat format = meshData.attributeFormat(i); if(isVertexFormatImplementationSpecific(format)) { if(!(flags & CompileFlag::NoWarnOnCustomAttributes)) - Warning{} << "MeshTools::compile(): ignoring attribute" << meshData.attributeName(i) << "with an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)); + Warning{} << "MeshTools::compile(): ignoring attribute" << meshData.attributeName(i) << "with an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format); continue; } diff --git a/src/Magnum/MeshTools/CompressIndices.cpp b/src/Magnum/MeshTools/CompressIndices.cpp index f84085c7c9..a5e348a534 100644 --- a/src/Magnum/MeshTools/CompressIndices.cpp +++ b/src/Magnum/MeshTools/CompressIndices.cpp @@ -56,7 +56,7 @@ template inline Containers::Array compress(const Contain template Containers::Pair, MeshIndexType> compressIndicesImplementation(const Containers::StridedArrayView1D& indices, const MeshIndexType atLeast, const Long offset) { CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(atLeast), - "MeshTools::compressIndices(): can't compress to an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(atLeast)), + "MeshTools::compressIndices(): can't compress to an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(atLeast), (Containers::Pair, MeshIndexType>{nullptr, MeshIndexType::UnsignedInt})); const UnsignedInt max = Math::max(indices) - offset; @@ -154,7 +154,7 @@ Trade::MeshData compressIndices(Trade::MeshData&& mesh, MeshIndexType atLeast) { result = compressIndicesImplementation(indices, atLeast, offset); } else { CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(mesh.indexType()), - "MeshTools::compressIndices(): mesh has an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(mesh.indexType())), + "MeshTools::compressIndices(): mesh has an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(mesh.indexType()), (Trade::MeshData{MeshPrimitive{}, 0})); CORRADE_INTERNAL_ASSERT(mesh.indexType() == MeshIndexType::UnsignedByte); auto indices = mesh.indices(); diff --git a/src/Magnum/MeshTools/Concatenate.cpp b/src/Magnum/MeshTools/Concatenate.cpp index fc608cb182..e20229bfef 100644 --- a/src/Magnum/MeshTools/Concatenate.cpp +++ b/src/Magnum/MeshTools/Concatenate.cpp @@ -102,7 +102,7 @@ Trade::MeshData concatenate(Containers::Array&& indexData, const UnsignedI /* If the mesh is indexed, copy the indices over, expanded to 32bit */ if(mesh.isIndexed()) { CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(mesh.indexType()), - assertPrefix << "mesh" << i << "has an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(mesh.indexType())), + assertPrefix << "mesh" << i << "has an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(mesh.indexType()), (Trade::MeshData{MeshPrimitive{}, 0})); Containers::ArrayView dst = indices.slice(indexOffset, indexOffset + mesh.indexCount()); @@ -176,7 +176,7 @@ Trade::MeshData concatenate(const Containers::Iterable& m for(std::size_t i = 0; i != meshes.front().attributeCount(); ++i) { const VertexFormat format = meshes.front().attributeFormat(i); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "MeshTools::concatenate(): attribute" << i << "of the first mesh has an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), + "MeshTools::concatenate(): attribute" << i << "of the first mesh has an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), (Trade::MeshData{MeshPrimitive::Points, 0})); } #endif diff --git a/src/Magnum/MeshTools/Concatenate.h b/src/Magnum/MeshTools/Concatenate.h index db167f18be..fa5ae8de5c 100644 --- a/src/Magnum/MeshTools/Concatenate.h +++ b/src/Magnum/MeshTools/Concatenate.h @@ -111,7 +111,7 @@ template class Allocator = Containers::ArrayAllocator> void conc for(std::size_t i = 0; i != destination.attributeCount(); ++i) { const VertexFormat format = destination.attributeFormat(i); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "MeshTools::concatenateInto(): attribute" << i << "of the destination mesh has an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), ); + "MeshTools::concatenateInto(): attribute" << i << "of the destination mesh has an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), ); } #endif diff --git a/src/Magnum/MeshTools/Duplicate.cpp b/src/Magnum/MeshTools/Duplicate.cpp index 86bde1dc0b..697fa886b8 100644 --- a/src/Magnum/MeshTools/Duplicate.cpp +++ b/src/Magnum/MeshTools/Duplicate.cpp @@ -83,19 +83,19 @@ void duplicateInto(const Containers::StridedArrayView2D& indices, co Trade::MeshData duplicate(const Trade::MeshData& mesh, const Containers::ArrayView extra) { CORRADE_ASSERT(mesh.isIndexed(), "MeshTools::duplicate(): mesh data not indexed", (Trade::MeshData{MeshPrimitive::Triangles, 0})); CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(mesh.indexType()), - "MeshTools::duplicate(): mesh has an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(mesh.indexType())), + "MeshTools::duplicate(): mesh has an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(mesh.indexType()), (Trade::MeshData{MeshPrimitive{}, 0})); #ifndef CORRADE_NO_ASSERT for(std::size_t i = 0; i != mesh.attributeCount(); ++i) { const VertexFormat format = mesh.attributeFormat(i); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "MeshTools::duplicate(): attribute" << i << "has an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), + "MeshTools::duplicate(): attribute" << i << "has an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), (Trade::MeshData{MeshPrimitive::Points, 0})); } for(std::size_t i = 0; i != extra.size(); ++i) { const VertexFormat format = extra[i].format(); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "MeshTools::duplicate(): extra attribute" << i << "has an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), + "MeshTools::duplicate(): extra attribute" << i << "has an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), (Trade::MeshData{MeshPrimitive::Points, 0})); } #endif diff --git a/src/Magnum/MeshTools/GenerateIndices.cpp b/src/Magnum/MeshTools/GenerateIndices.cpp index f33fa1adbf..0dce93b0c8 100644 --- a/src/Magnum/MeshTools/GenerateIndices.cpp +++ b/src/Magnum/MeshTools/GenerateIndices.cpp @@ -579,7 +579,7 @@ void generateQuadIndicesInto(const Containers::StridedArrayView1D Trade::MeshData generateIndices(Trade::MeshData&& mesh) { CORRADE_ASSERT(!mesh.isIndexed() || !isMeshIndexTypeImplementationSpecific(mesh.indexType()), - "MeshTools::generateIndices(): mesh has an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(mesh.indexType())), + "MeshTools::generateIndices(): mesh has an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(mesh.indexType()), (Trade::MeshData{MeshPrimitive{}, 0})); const UnsignedInt vertexCount = mesh.vertexCount(); diff --git a/src/Magnum/MeshTools/Interleave.cpp b/src/Magnum/MeshTools/Interleave.cpp index 67b980833c..6ef80f49bc 100644 --- a/src/Magnum/MeshTools/Interleave.cpp +++ b/src/Magnum/MeshTools/Interleave.cpp @@ -141,7 +141,7 @@ Containers::Array interleavedLayout(Trade::MeshData&& minOffset = 0; for(UnsignedInt i = 0, max = mesh.attributeCount(); i != max; ++i) { CORRADE_ASSERT(!isVertexFormatImplementationSpecific(mesh.attributeFormat(i)), - "MeshTools::interleavedLayout(): attribute" << i << "has an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(mesh.attributeFormat(i))), {}); + "MeshTools::interleavedLayout(): attribute" << i << "has an implementation-specific format" << Debug::hex << vertexFormatUnwrap(mesh.attributeFormat(i)), {}); stride += attributeSize(mesh, i); } } @@ -156,7 +156,7 @@ Containers::Array interleavedLayout(Trade::MeshData&& stride += extra[i].stride(); } else { CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "MeshTools::interleavedLayout(): extra attribute" << i << "has an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), {}); + "MeshTools::interleavedLayout(): extra attribute" << i << "has an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), {}); stride += attributeSize(extra[i]); ++extraAttributeCount; } @@ -292,7 +292,7 @@ Trade::MeshData interleave(Trade::MeshData&& mesh, const Containers::ArrayView(meshIndexTypeUnwrap(indexType)) << Debug::nospace << ", enable MeshTools::InterleaveFlag::PreserveStridedIndices to pass the array through unchanged", + "MeshTools::interleave(): mesh has an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(indexType) << Debug::nospace << ", enable MeshTools::InterleaveFlag::PreserveStridedIndices to pass the array through unchanged", (Trade::MeshData{MeshPrimitive{}, 0})); const std::size_t indexTypeSize = meshIndexTypeSize(indexType); diff --git a/src/Magnum/MeshTools/RemoveDuplicates.cpp b/src/Magnum/MeshTools/RemoveDuplicates.cpp index bb0de2c2cd..e0e8ad261a 100644 --- a/src/Magnum/MeshTools/RemoveDuplicates.cpp +++ b/src/Magnum/MeshTools/RemoveDuplicates.cpp @@ -406,7 +406,7 @@ Trade::MeshData removeDuplicates(const Trade::MeshData& mesh) { for(std::size_t i = 0; i != mesh.attributeCount(); ++i) { const VertexFormat format = mesh.attributeFormat(i); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "MeshTools::removeDuplicates(): attribute" << i << "has an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), + "MeshTools::removeDuplicates(): attribute" << i << "has an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), (Trade::MeshData{MeshPrimitive::Points, 0})); } #endif @@ -414,7 +414,7 @@ Trade::MeshData removeDuplicates(const Trade::MeshData& mesh) { /* This has to be checked before passing the data to interleave() as there it would die also, but with a confusing function name in the message */ CORRADE_ASSERT(!mesh.isIndexed() || !isMeshIndexTypeImplementationSpecific(mesh.indexType()), - "MeshTools::removeDuplicates(): mesh has an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(mesh.indexType())), + "MeshTools::removeDuplicates(): mesh has an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(mesh.indexType()), (Trade::MeshData{MeshPrimitive{}, 0})); /* Turn the passed data into an interleaved owned mutable instance we can @@ -489,7 +489,7 @@ Trade::MeshData removeDuplicatesFuzzy(const Trade::MeshData& mesh, const Float f for(UnsignedInt i = 0; i != owned.attributeCount(); ++i) { const VertexFormat format = owned.attributeFormat(i); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "MeshTools::removeDuplicatesFuzzy(): attribute" << i << "has an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), + "MeshTools::removeDuplicatesFuzzy(): attribute" << i << "has an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), (Trade::MeshData{MeshPrimitive::Points, 0})); /* Floats, with special attribute-dependent handling */ @@ -574,7 +574,7 @@ Trade::MeshData removeDuplicatesFuzzy(const Trade::MeshData& mesh, const Float f indexType = MeshIndexType::UnsignedInt; } else { CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(owned.indexType()), - "MeshTools::removeDuplicatesFuzzy(): mesh has an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(owned.indexType())), + "MeshTools::removeDuplicatesFuzzy(): mesh has an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(owned.indexType()), (Trade::MeshData{MeshPrimitive{}, 0})); vertexCount = removeDuplicatesIndexedInPlace( owned.mutableIndices(), diff --git a/src/Magnum/MeshTools/Transform.cpp b/src/Magnum/MeshTools/Transform.cpp index 9eee8405d7..6712e2298a 100644 --- a/src/Magnum/MeshTools/Transform.cpp +++ b/src/Magnum/MeshTools/Transform.cpp @@ -45,7 +45,7 @@ Trade::MeshData transform2D(const Trade::MeshData& mesh, const Matrix3& transfor #endif const VertexFormat positionAttributeFormat = mesh.attributeFormat(*positionAttributeId); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(positionAttributeFormat), - "MeshTools::transform2D(): positions have an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(positionAttributeFormat)), + "MeshTools::transform2D(): positions have an implementation-specific format" << Debug::hex << vertexFormatUnwrap(positionAttributeFormat), (Trade::MeshData{MeshPrimitive::Points, 0})); CORRADE_ASSERT(vertexFormatComponentCount(positionAttributeFormat) == 2, "MeshTools::transform2D(): expected 2D positions but got" << positionAttributeFormat, @@ -142,7 +142,7 @@ Trade::MeshData transform3D(const Trade::MeshData& mesh, const Matrix4& transfor #endif const VertexFormat positionAttributeFormat = mesh.attributeFormat(*positionAttributeId); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(positionAttributeFormat), - "MeshTools::transform3D(): positions have an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(positionAttributeFormat)), + "MeshTools::transform3D(): positions have an implementation-specific format" << Debug::hex << vertexFormatUnwrap(positionAttributeFormat), (Trade::MeshData{MeshPrimitive::Points, 0})); CORRADE_ASSERT(vertexFormatComponentCount(positionAttributeFormat) == 3, "MeshTools::transform3D(): expected 3D positions but got" << positionAttributeFormat, @@ -168,7 +168,7 @@ Trade::MeshData transform3D(const Trade::MeshData& mesh, const Matrix4& transfor if(tangentAttributeId) { tangentAttributeFormat = mesh.attributeFormat(*tangentAttributeId); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(tangentAttributeFormat), - "MeshTools::transform3D(): tangents have an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(tangentAttributeFormat)), + "MeshTools::transform3D(): tangents have an implementation-specific format" << Debug::hex << vertexFormatUnwrap(tangentAttributeFormat), (Trade::MeshData{MeshPrimitive::Points, 0})); desiredTangentVertexFormat = vertexFormatComponentCount(mesh.attributeFormat(*tangentAttributeId)) == 4 ? VertexFormat::Vector4 : VertexFormat::Vector3; @@ -179,7 +179,7 @@ Trade::MeshData transform3D(const Trade::MeshData& mesh, const Matrix4& transfor if(bitangentAttributeId) { bitangentAttributeFormat = mesh.attributeFormat(*bitangentAttributeId); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(bitangentAttributeFormat), - "MeshTools::transform3D(): bitangents have an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(bitangentAttributeFormat)), + "MeshTools::transform3D(): bitangents have an implementation-specific format" << Debug::hex << vertexFormatUnwrap(bitangentAttributeFormat), (Trade::MeshData{MeshPrimitive::Points, 0})); if(bitangentAttributeFormat != VertexFormat::Vector3) attributes[*bitangentAttributeId] = Trade::MeshAttributeData{Trade::MeshAttribute::Bitangent, VertexFormat::Vector3, nullptr, 0, morphTargetId}; @@ -188,7 +188,7 @@ Trade::MeshData transform3D(const Trade::MeshData& mesh, const Matrix4& transfor if(normalAttributeId) { normalAttributeFormat = mesh.attributeFormat(*normalAttributeId); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(normalAttributeFormat), - "MeshTools::transform3D(): normals have an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(normalAttributeFormat)), + "MeshTools::transform3D(): normals have an implementation-specific format" << Debug::hex << vertexFormatUnwrap(normalAttributeFormat), (Trade::MeshData{MeshPrimitive::Points, 0})); if(normalAttributeFormat != VertexFormat::Vector3) attributes[*normalAttributeId] = Trade::MeshAttributeData{Trade::MeshAttribute::Normal, VertexFormat::Vector3, nullptr, 0, morphTargetId}; @@ -323,7 +323,7 @@ Trade::MeshData transformTextureCoordinates2D(const Trade::MeshData& mesh, const #endif const VertexFormat textureCoordinateAttributeFormat = mesh.attributeFormat(*textureCoordinateAttributeId); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(textureCoordinateAttributeFormat), - "MeshTools::transformTextureCoordinates2D(): texture coordinates have an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(textureCoordinateAttributeFormat)), + "MeshTools::transformTextureCoordinates2D(): texture coordinates have an implementation-specific format" << Debug::hex << vertexFormatUnwrap(textureCoordinateAttributeFormat), (Trade::MeshData{MeshPrimitive::Points, 0})); /* Copy original attributes to a mutable array so we can update the diff --git a/src/Magnum/PixelFormat.cpp b/src/Magnum/PixelFormat.cpp index b6bafbccc0..095cbe4d4a 100644 --- a/src/Magnum/PixelFormat.cpp +++ b/src/Magnum/PixelFormat.cpp @@ -36,7 +36,7 @@ namespace Magnum { UnsignedInt pixelFormatSize(const PixelFormat format) { CORRADE_ASSERT(!isPixelFormatImplementationSpecific(format), - "pixelFormatSize(): can't determine size of an implementation-specific format" << reinterpret_cast(pixelFormatUnwrap(format)), {}); + "pixelFormatSize(): can't determine size of an implementation-specific format" << Debug::hex << pixelFormatUnwrap(format), {}); #ifdef CORRADE_TARGET_GCC #pragma GCC diagnostic push @@ -120,7 +120,7 @@ UnsignedInt pixelFormatSize(const PixelFormat format) { PixelFormat pixelFormatChannelFormat(const PixelFormat format) { CORRADE_ASSERT(!isPixelFormatImplementationSpecific(format), - "pixelFormatChannelFormat(): can't determine channel format of an implementation-specific format" << reinterpret_cast(pixelFormatUnwrap(format)), {}); + "pixelFormatChannelFormat(): can't determine channel format of an implementation-specific format" << Debug::hex << pixelFormatUnwrap(format), {}); #ifdef CORRADE_TARGET_GCC #pragma GCC diagnostic push @@ -211,7 +211,7 @@ PixelFormat pixelFormatChannelFormat(const PixelFormat format) { UnsignedInt pixelFormatChannelCount(const PixelFormat format) { CORRADE_ASSERT(!isPixelFormatImplementationSpecific(format), - "pixelFormatChannelCount(): can't determine channel count of an implementation-specific format" << reinterpret_cast(pixelFormatUnwrap(format)), {}); + "pixelFormatChannelCount(): can't determine channel count of an implementation-specific format" << Debug::hex << pixelFormatUnwrap(format), {}); #ifdef CORRADE_TARGET_GCC #pragma GCC diagnostic push @@ -292,7 +292,7 @@ UnsignedInt pixelFormatChannelCount(const PixelFormat format) { bool isPixelFormatNormalized(const PixelFormat format) { CORRADE_ASSERT(!isPixelFormatImplementationSpecific(format), - "isPixelFormatNormalized(): can't determine type of an implementation-specific format" << reinterpret_cast(pixelFormatUnwrap(format)), {}); + "isPixelFormatNormalized(): can't determine type of an implementation-specific format" << Debug::hex << pixelFormatUnwrap(format), {}); #ifdef CORRADE_TARGET_GCC #pragma GCC diagnostic push @@ -371,7 +371,7 @@ bool isPixelFormatNormalized(const PixelFormat format) { bool isPixelFormatIntegral(const PixelFormat format) { CORRADE_ASSERT(!isPixelFormatImplementationSpecific(format), - "isPixelFormatIntegral(): can't determine type of an implementation-specific format" << reinterpret_cast(pixelFormatUnwrap(format)), {}); + "isPixelFormatIntegral(): can't determine type of an implementation-specific format" << Debug::hex << pixelFormatUnwrap(format), {}); #ifdef CORRADE_TARGET_GCC #pragma GCC diagnostic push @@ -450,7 +450,7 @@ bool isPixelFormatIntegral(const PixelFormat format) { bool isPixelFormatFloatingPoint(const PixelFormat format) { CORRADE_ASSERT(!isPixelFormatImplementationSpecific(format), - "isPixelFormatFloatingPoint(): can't determine type of an implementation-specific format" << reinterpret_cast(pixelFormatUnwrap(format)), {}); + "isPixelFormatFloatingPoint(): can't determine type of an implementation-specific format" << Debug::hex << pixelFormatUnwrap(format), {}); #ifdef CORRADE_TARGET_GCC #pragma GCC diagnostic push @@ -529,7 +529,7 @@ bool isPixelFormatFloatingPoint(const PixelFormat format) { bool isPixelFormatSrgb(const PixelFormat format) { CORRADE_ASSERT(!isPixelFormatImplementationSpecific(format), - "isPixelFormatSrgb(): can't determine colorspace of an implementation-specific format" << reinterpret_cast(pixelFormatUnwrap(format)), {}); + "isPixelFormatSrgb(): can't determine colorspace of an implementation-specific format" << Debug::hex << pixelFormatUnwrap(format), {}); #ifdef CORRADE_TARGET_GCC #pragma GCC diagnostic push @@ -608,7 +608,7 @@ bool isPixelFormatSrgb(const PixelFormat format) { bool isPixelFormatDepthOrStencil(const PixelFormat format) { CORRADE_ASSERT(!isPixelFormatImplementationSpecific(format), - "isPixelFormatDepthOrStencil(): can't determine type of an implementation-specific format" << reinterpret_cast(pixelFormatUnwrap(format)), {}); + "isPixelFormatDepthOrStencil(): can't determine type of an implementation-specific format" << Debug::hex << pixelFormatUnwrap(format), {}); #ifdef CORRADE_TARGET_GCC #pragma GCC diagnostic push @@ -686,7 +686,7 @@ bool isPixelFormatDepthOrStencil(const PixelFormat format) { PixelFormat pixelFormat(const PixelFormat format, const UnsignedInt channelCount, const bool srgb) { CORRADE_ASSERT(!isPixelFormatImplementationSpecific(format), - "pixelFormat(): can't assemble a format out of an implementation-specific format" << reinterpret_cast(pixelFormatUnwrap(format)), {}); + "pixelFormat(): can't assemble a format out of an implementation-specific format" << Debug::hex << pixelFormatUnwrap(format), {}); CORRADE_ASSERT(!isPixelFormatDepthOrStencil(format), "pixelFormat(): can't assemble a format out of" << format, {}); @@ -747,14 +747,14 @@ Debug& operator<<(Debug& debug, const PixelFormat value) { debug << "PixelFormat" << Debug::nospace; if(isPixelFormatImplementationSpecific(value)) { - return debug << (packed ? "ImplementationSpecific(" : "::ImplementationSpecific(") << Debug::nospace << reinterpret_cast(pixelFormatUnwrap(value)) << Debug::nospace << ")"; + return debug << (packed ? "ImplementationSpecific(" : "::ImplementationSpecific(") << Debug::nospace << Debug::hex << pixelFormatUnwrap(value) << Debug::nospace << ")"; } if(UnsignedInt(value) - 1 < Containers::arraySize(PixelFormatNames)) { return debug << (packed ? "" : "::") << Debug::nospace << PixelFormatNames[UnsignedInt(value) - 1]; } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << (packed ? "" : ")"); } #endif @@ -787,7 +787,7 @@ constexpr UnsignedShort CompressedBlockData[] { Vector3i compressedPixelFormatBlockSize(const CompressedPixelFormat format) { CORRADE_ASSERT(!(UnsignedInt(format) & (1 << 31)), - "compressedPixelFormatBlockSize(): can't determine size of an implementation-specific format" << reinterpret_cast(compressedPixelFormatUnwrap(format)), {}); + "compressedPixelFormatBlockSize(): can't determine size of an implementation-specific format" << Debug::hex << compressedPixelFormatUnwrap(format), {}); CORRADE_ASSERT(UnsignedInt(format) - 1 < Containers::arraySize(CompressedBlockData), "compressedPixelFormatBlockSize(): invalid format" << format, {}); @@ -807,7 +807,7 @@ Vector3i compressedBlockSize(const CompressedPixelFormat format) { UnsignedInt compressedPixelFormatBlockDataSize(const CompressedPixelFormat format) { CORRADE_ASSERT(!(UnsignedInt(format) & (1 << 31)), - "compressedPixelFormatBlockDataSize(): can't determine size of an implementation-specific format" << reinterpret_cast(compressedPixelFormatUnwrap(format)), {}); + "compressedPixelFormatBlockDataSize(): can't determine size of an implementation-specific format" << Debug::hex << compressedPixelFormatUnwrap(format), {}); CORRADE_ASSERT(UnsignedInt(format) - 1 < Containers::arraySize(CompressedBlockData), "compressedPixelFormatBlockDataSize(): invalid format" << format, {}); @@ -822,14 +822,14 @@ Debug& operator<<(Debug& debug, const CompressedPixelFormat value) { debug << "CompressedPixelFormat" << Debug::nospace; if(isCompressedPixelFormatImplementationSpecific(value)) { - return debug << (packed ? "ImplementationSpecific(" : "::ImplementationSpecific(") << Debug::nospace << reinterpret_cast(compressedPixelFormatUnwrap(value)) << Debug::nospace << ")"; + return debug << (packed ? "ImplementationSpecific(" : "::ImplementationSpecific(") << Debug::nospace << Debug::hex << compressedPixelFormatUnwrap(value) << Debug::nospace << ")"; } if(UnsignedInt(value) - 1 < Containers::arraySize(CompressedPixelFormatNames)) { return debug << (packed ? "" : "::") << Debug::nospace << CompressedPixelFormatNames[UnsignedInt(value) - 1]; } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << (packed ? "" : ")"); } #endif diff --git a/src/Magnum/PixelFormat.h b/src/Magnum/PixelFormat.h index fcab00b5a3..209f05033b 100644 --- a/src/Magnum/PixelFormat.h +++ b/src/Magnum/PixelFormat.h @@ -966,7 +966,7 @@ template constexpr PixelFormat pixelFormatWrap(T implementationSpecific static_assert(sizeof(T) <= 4, "format types larger than 32bits are not supported"); return CORRADE_CONSTEXPR_ASSERT(!(UnsignedInt(implementationSpecific) & (1u << 31)), - "pixelFormatWrap(): implementation-specific value" << reinterpret_cast(implementationSpecific) << "already wrapped or too large"), + "pixelFormatWrap(): implementation-specific value" << Debug::hex << UnsignedInt(implementationSpecific) << "already wrapped or too large"), PixelFormat((1u << 31)|UnsignedInt(implementationSpecific)); } @@ -2599,7 +2599,7 @@ template constexpr CompressedPixelFormat compressedPixelFormatWrap(T im static_assert(sizeof(T) <= 4, "format types larger than 32bits are not supported"); return CORRADE_CONSTEXPR_ASSERT(!(UnsignedInt(implementationSpecific) & (1u << 31)), - "compressedPixelFormatWrap(): implementation-specific value" << reinterpret_cast(implementationSpecific) << "already wrapped or too large"), + "compressedPixelFormatWrap(): implementation-specific value" << Debug::hex << UnsignedInt(implementationSpecific) << "already wrapped or too large"), CompressedPixelFormat((1u << 31)|UnsignedInt(implementationSpecific)); } diff --git a/src/Magnum/Resource.cpp b/src/Magnum/Resource.cpp index 70f4294b5f..545ad055d4 100644 --- a/src/Magnum/Resource.cpp +++ b/src/Magnum/Resource.cpp @@ -46,7 +46,7 @@ Debug& operator<<(Debug& debug, const ResourceState value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const ResourceKey& value) { diff --git a/src/Magnum/Sampler.cpp b/src/Magnum/Sampler.cpp index 1db6889c5d..89e30116de 100644 --- a/src/Magnum/Sampler.cpp +++ b/src/Magnum/Sampler.cpp @@ -45,7 +45,7 @@ Debug& operator<<(Debug& debug, const SamplerFilter value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const SamplerMipmap value) { @@ -64,7 +64,7 @@ Debug& operator<<(Debug& debug, const SamplerMipmap value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const SamplerWrapping value) { @@ -85,7 +85,7 @@ Debug& operator<<(Debug& debug, const SamplerWrapping value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << (packed ? "" : ")"); } #endif diff --git a/src/Magnum/SceneGraph/Animable.cpp b/src/Magnum/SceneGraph/Animable.cpp index 3f25a38e37..e244e81a42 100644 --- a/src/Magnum/SceneGraph/Animable.cpp +++ b/src/Magnum/SceneGraph/Animable.cpp @@ -42,7 +42,7 @@ Debug& operator<<(Debug& debug, const AnimationState value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/ShaderTools/AbstractConverter.cpp b/src/Magnum/ShaderTools/AbstractConverter.cpp index b23c942223..fcef944b9f 100644 --- a/src/Magnum/ShaderTools/AbstractConverter.cpp +++ b/src/Magnum/ShaderTools/AbstractConverter.cpp @@ -751,7 +751,7 @@ Debug& operator<<(Debug& debug, const ConverterFeature value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const ConverterFeatures value) { @@ -786,7 +786,7 @@ Debug& operator<<(Debug& debug, const ConverterFlag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const ConverterFlags value) { @@ -816,7 +816,7 @@ Debug& operator<<(Debug& debug, const Format value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/ShaderTools/Stage.cpp b/src/Magnum/ShaderTools/Stage.cpp index 4ccbcec268..cc5a3a8d90 100644 --- a/src/Magnum/ShaderTools/Stage.cpp +++ b/src/Magnum/ShaderTools/Stage.cpp @@ -55,7 +55,7 @@ Debug& operator<<(Debug& debug, const Stage value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/Shaders/DistanceFieldVectorGL.cpp b/src/Magnum/Shaders/DistanceFieldVectorGL.cpp index 409da6834f..aeefe7f8f3 100644 --- a/src/Magnum/Shaders/DistanceFieldVectorGL.cpp +++ b/src/Magnum/Shaders/DistanceFieldVectorGL.cpp @@ -527,7 +527,7 @@ Debug& operator<<(Debug& debug, const DistanceFieldVectorGLFlag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const DistanceFieldVectorGLFlags value) { diff --git a/src/Magnum/Shaders/FlatGL.cpp b/src/Magnum/Shaders/FlatGL.cpp index 16cb89c5a0..042630c745 100644 --- a/src/Magnum/Shaders/FlatGL.cpp +++ b/src/Magnum/Shaders/FlatGL.cpp @@ -868,7 +868,7 @@ Debug& operator<<(Debug& debug, const FlatGLFlag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedShort(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const FlatGLFlags value) { diff --git a/src/Magnum/Shaders/Line.cpp b/src/Magnum/Shaders/Line.cpp index 244b802571..23d9ea6c59 100644 --- a/src/Magnum/Shaders/Line.cpp +++ b/src/Magnum/Shaders/Line.cpp @@ -56,7 +56,7 @@ Debug& operator<<(Debug& debug, const LineCapStyle value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const LineJoinStyle value) { @@ -71,7 +71,7 @@ Debug& operator<<(Debug& debug, const LineJoinStyle value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const LineVertexAnnotation value) { @@ -90,7 +90,7 @@ Debug& operator<<(Debug& debug, const LineVertexAnnotation value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const LineVertexAnnotations value) { diff --git a/src/Magnum/Shaders/LineGL.cpp b/src/Magnum/Shaders/LineGL.cpp index abc49b8617..b61caba51c 100644 --- a/src/Magnum/Shaders/LineGL.cpp +++ b/src/Magnum/Shaders/LineGL.cpp @@ -511,7 +511,7 @@ Debug& operator<<(Debug& debug, const LineGLFlag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedShort(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const LineGLFlags value) { diff --git a/src/Magnum/Shaders/MeshVisualizerGL.cpp b/src/Magnum/Shaders/MeshVisualizerGL.cpp index 504c9d6fcc..084e1fa96c 100644 --- a/src/Magnum/Shaders/MeshVisualizerGL.cpp +++ b/src/Magnum/Shaders/MeshVisualizerGL.cpp @@ -1792,7 +1792,7 @@ Debug& operator<<(Debug& debug, const MeshVisualizerGL2D::Flag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const MeshVisualizerGL3D::Flag value) { @@ -1850,7 +1850,7 @@ Debug& operator<<(Debug& debug, const MeshVisualizerGL3D::Flag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const MeshVisualizerGL2D::Flags value) { diff --git a/src/Magnum/Shaders/PhongGL.cpp b/src/Magnum/Shaders/PhongGL.cpp index 966dcba6f0..fd45c94de7 100644 --- a/src/Magnum/Shaders/PhongGL.cpp +++ b/src/Magnum/Shaders/PhongGL.cpp @@ -1370,7 +1370,7 @@ Debug& operator<<(Debug& debug, const PhongGL::Flag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const PhongGL::Flags value) { diff --git a/src/Magnum/Shaders/VectorGL.cpp b/src/Magnum/Shaders/VectorGL.cpp index b14f924605..8db7ff32af 100644 --- a/src/Magnum/Shaders/VectorGL.cpp +++ b/src/Magnum/Shaders/VectorGL.cpp @@ -506,7 +506,7 @@ Debug& operator<<(Debug& debug, const VectorGLFlag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const VectorGLFlags value) { diff --git a/src/Magnum/Shaders/VertexColorGL.cpp b/src/Magnum/Shaders/VertexColorGL.cpp index 86308363a4..6115dad74a 100644 --- a/src/Magnum/Shaders/VertexColorGL.cpp +++ b/src/Magnum/Shaders/VertexColorGL.cpp @@ -348,7 +348,7 @@ Debug& operator<<(Debug& debug, const VertexColorGLFlag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const VertexColorGLFlags value) { diff --git a/src/Magnum/Test/VersionTest.cpp b/src/Magnum/Test/VersionTest.cpp index ad661e8766..ddb468f332 100644 --- a/src/Magnum/Test/VersionTest.cpp +++ b/src/Magnum/Test/VersionTest.cpp @@ -46,7 +46,7 @@ void VersionTest::test() { Debug{} << "MAGNUM_VERSION_MONTH:" << MAGNUM_VERSION_MONTH; #ifdef MAGNUM_VERSION_COMMIT Debug{} << "MAGNUM_VERSION_COMMIT:" << MAGNUM_VERSION_COMMIT; - Debug{} << "MAGNUM_VERSION_HASH:" << reinterpret_cast(MAGNUM_VERSION_HASH); + Debug{} << "MAGNUM_VERSION_HASH:" << Debug::hex << MAGNUM_VERSION_HASH; Debug{} << "MAGNUM_VERSION_STRING:" << MAGNUM_VERSION_STRING; #else Debug{} << "No Git version information available."; diff --git a/src/Magnum/Text/AbstractFont.cpp b/src/Magnum/Text/AbstractFont.cpp index de7a883ced..2017e06140 100644 --- a/src/Magnum/Text/AbstractFont.cpp +++ b/src/Magnum/Text/AbstractFont.cpp @@ -400,7 +400,7 @@ Debug& operator<<(Debug& debug, const FontFeature value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const FontFeatures value) { diff --git a/src/Magnum/Text/AbstractFontConverter.cpp b/src/Magnum/Text/AbstractFontConverter.cpp index 5a65a2c05e..83558d9c27 100644 --- a/src/Magnum/Text/AbstractFontConverter.cpp +++ b/src/Magnum/Text/AbstractFontConverter.cpp @@ -298,7 +298,7 @@ Debug& operator<<(Debug& debug, const FontConverterFeature value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(Containers::enumCastUnderlyingType(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << Containers::enumCastUnderlyingType(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const FontConverterFeatures value) { diff --git a/src/Magnum/Text/AbstractGlyphCache.cpp b/src/Magnum/Text/AbstractGlyphCache.cpp index d2da744794..40ee07383c 100644 --- a/src/Magnum/Text/AbstractGlyphCache.cpp +++ b/src/Magnum/Text/AbstractGlyphCache.cpp @@ -57,7 +57,7 @@ Debug& operator<<(Debug& debug, const GlyphCacheFeature value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const GlyphCacheFeatures value) { diff --git a/src/Magnum/Text/Alignment.cpp b/src/Magnum/Text/Alignment.cpp index d648018f1f..9c621431cf 100644 --- a/src/Magnum/Text/Alignment.cpp +++ b/src/Magnum/Text/Alignment.cpp @@ -75,7 +75,7 @@ Debug& operator<<(Debug& debug, const Alignment value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/Text/Direction.cpp b/src/Magnum/Text/Direction.cpp index 73e39d54f3..965d779c81 100644 --- a/src/Magnum/Text/Direction.cpp +++ b/src/Magnum/Text/Direction.cpp @@ -44,7 +44,7 @@ Debug& operator<<(Debug& debug, const ShapeDirection value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const LayoutDirection value) { @@ -61,7 +61,7 @@ Debug& operator<<(Debug& debug, const LayoutDirection value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } }} diff --git a/src/Magnum/Text/Implementation/printFourCC.h b/src/Magnum/Text/Implementation/printFourCC.h index 7d279861ad..b4c93b6fec 100644 --- a/src/Magnum/Text/Implementation/printFourCC.h +++ b/src/Magnum/Text/Implementation/printFourCC.h @@ -43,7 +43,7 @@ inline Debug& printFourCC(Debug& debug, UnsignedInt value) { const char data[]{'\'', char(c), '\'', '\0'}; debug << data; } else { - debug << reinterpret_cast(c); + debug << Debug::hex << c; } value >>= 8; diff --git a/src/Magnum/TextureTools/Atlas.cpp b/src/Magnum/TextureTools/Atlas.cpp index d6337c138c..e60710dc71 100644 --- a/src/Magnum/TextureTools/Atlas.cpp +++ b/src/Magnum/TextureTools/Atlas.cpp @@ -60,7 +60,7 @@ Debug& operator<<(Debug& debug, const AtlasLandfillFlag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const AtlasLandfillFlags value) { diff --git a/src/Magnum/Trade/AbstractImageConverter.cpp b/src/Magnum/Trade/AbstractImageConverter.cpp index d128d51429..e966c54ec5 100644 --- a/src/Magnum/Trade/AbstractImageConverter.cpp +++ b/src/Magnum/Trade/AbstractImageConverter.cpp @@ -1346,7 +1346,7 @@ Debug& operator<<(Debug& debug, const ImageConverterFeature value) { #endif } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const ImageConverterFeatures value) { @@ -1386,7 +1386,7 @@ Debug& operator<<(Debug& debug, const ImageConverterFlag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const ImageConverterFlags value) { diff --git a/src/Magnum/Trade/AbstractImporter.cpp b/src/Magnum/Trade/AbstractImporter.cpp index 143c187779..3e476f7ec5 100644 --- a/src/Magnum/Trade/AbstractImporter.cpp +++ b/src/Magnum/Trade/AbstractImporter.cpp @@ -1633,7 +1633,7 @@ Debug& operator<<(Debug& debug, const ImporterFeature value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const ImporterFeatures value) { @@ -1655,7 +1655,7 @@ Debug& operator<<(Debug& debug, const ImporterFlag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const ImporterFlags value) { diff --git a/src/Magnum/Trade/AbstractSceneConverter.cpp b/src/Magnum/Trade/AbstractSceneConverter.cpp index 617504a5df..8478ee5052 100644 --- a/src/Magnum/Trade/AbstractSceneConverter.cpp +++ b/src/Magnum/Trade/AbstractSceneConverter.cpp @@ -1752,7 +1752,7 @@ Debug& operator<<(Debug& debug, const SceneConverterFeature value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const SceneConverterFeatures value) { @@ -1797,7 +1797,7 @@ Debug& operator<<(Debug& debug, const SceneConverterFlag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const SceneConverterFlags value) { @@ -1834,7 +1834,7 @@ Debug& operator<<(Debug& debug, const SceneContent value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const SceneContents value) { diff --git a/src/Magnum/Trade/AnimationData.cpp b/src/Magnum/Trade/AnimationData.cpp index 53257815c6..983aaef203 100644 --- a/src/Magnum/Trade/AnimationData.cpp +++ b/src/Magnum/Trade/AnimationData.cpp @@ -70,7 +70,7 @@ Debug& operator<<(Debug& debug, const AnimationTrackType value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } UnsignedInt animationTrackTypeSize(const AnimationTrackType type) { @@ -189,7 +189,7 @@ Debug& operator<<(Debug& debug, const AnimationTrackTarget value) { #endif } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedShort(value) << Debug::nospace << (packed ? "" : ")"); } namespace { diff --git a/src/Magnum/Trade/CameraData.cpp b/src/Magnum/Trade/CameraData.cpp index adc762ed79..6ac150508f 100644 --- a/src/Magnum/Trade/CameraData.cpp +++ b/src/Magnum/Trade/CameraData.cpp @@ -62,7 +62,7 @@ Debug& operator<<(Debug& debug, const CameraType value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } }} diff --git a/src/Magnum/Trade/Data.cpp b/src/Magnum/Trade/Data.cpp index 1c4b40b06e..dfc2ba39c4 100644 --- a/src/Magnum/Trade/Data.cpp +++ b/src/Magnum/Trade/Data.cpp @@ -46,7 +46,7 @@ Debug& operator<<(Debug& debug, const DataFlag value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const DataFlags value) { diff --git a/src/Magnum/Trade/LightData.cpp b/src/Magnum/Trade/LightData.cpp index e9974fc108..ba8015fcc5 100644 --- a/src/Magnum/Trade/LightData.cpp +++ b/src/Magnum/Trade/LightData.cpp @@ -83,7 +83,7 @@ Debug& operator<<(Debug& debug, const LightType value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } #endif diff --git a/src/Magnum/Trade/MaterialData.cpp b/src/Magnum/Trade/MaterialData.cpp index d4212ff4b7..a2f8bc2684 100644 --- a/src/Magnum/Trade/MaterialData.cpp +++ b/src/Magnum/Trade/MaterialData.cpp @@ -1151,7 +1151,7 @@ Debug& operator<<(Debug& debug, const MaterialLayer value) { debug << "Trade::MaterialLayer" << Debug::nospace; if(UnsignedInt(value) - 1 >= Containers::arraySize(LayerMap)) - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << ")"; return debug << "::" << Debug::nospace << LayerMap[UnsignedInt(value) - 1]; } @@ -1160,7 +1160,7 @@ Debug& operator<<(Debug& debug, const MaterialAttribute value) { debug << "Trade::MaterialAttribute" << Debug::nospace; if(UnsignedInt(value) - 1 >= Containers::arraySize(AttributeMap)) - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << ")"; /* LayerName is prefixed with a single space, drop that */ Containers::StringView string = AttributeMap[UnsignedInt(value) - 1].name; @@ -1226,7 +1226,7 @@ Debug& operator<<(Debug& debug, const MaterialAttributeType value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedShort(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const MaterialType value) { @@ -1247,7 +1247,7 @@ Debug& operator<<(Debug& debug, const MaterialType value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const MaterialTypes value) { @@ -1273,7 +1273,7 @@ Debug& operator<<(Debug& debug, const MaterialData::Flag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const MaterialData::Flags value) { @@ -1300,7 +1300,7 @@ Debug& operator<<(Debug& debug, const MaterialAlphaMode value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } }} diff --git a/src/Magnum/Trade/MeshData.cpp b/src/Magnum/Trade/MeshData.cpp index 04af97197a..f5662b0069 100644 --- a/src/Magnum/Trade/MeshData.cpp +++ b/src/Magnum/Trade/MeshData.cpp @@ -583,7 +583,7 @@ void MeshData::indicesInto(const Containers::StridedArrayView1D& de "Trade::MeshData::indicesInto(): the mesh is not indexed", ); CORRADE_ASSERT(destination.size() == indexCount(), "Trade::MeshData::indicesInto(): expected a view with" << indexCount() << "elements but got" << destination.size(), ); CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(_indexType), - "Trade::MeshData::indicesInto(): can't extract data out of an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(_indexType)), ); + "Trade::MeshData::indicesInto(): can't extract data out of an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(_indexType), ); const auto destination1ui = Containers::arrayCast<2, UnsignedInt>(destination); const Containers::StridedArrayView2D indexData = indices(); @@ -617,7 +617,7 @@ void MeshData::positions2DInto(const Containers::StridedArrayView1D& de CORRADE_ASSERT(destination.size() == _vertexCount, "Trade::MeshData::positions2DInto(): expected a view with" << _vertexCount << "elements but got" << destination.size(), ); const MeshAttributeData& attribute = _attributes[attributeId]; CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format), - "Trade::MeshData::positions2DInto(): can't extract data out of an implementation-specific vertex format" << reinterpret_cast(vertexFormatUnwrap(attribute._format)), ); + "Trade::MeshData::positions2DInto(): can't extract data out of an implementation-specific vertex format" << Debug::hex << vertexFormatUnwrap(attribute._format), ); const Containers::StridedArrayView1D attributeData = attributeDataViewInternal(attribute); const auto destination2f = Containers::arrayCast<2, Float>(destination); @@ -672,7 +672,7 @@ void MeshData::positions3DInto(const Containers::StridedArrayView1D& de CORRADE_ASSERT(destination.size() == _vertexCount, "Trade::MeshData::positions3DInto(): expected a view with" << _vertexCount << "elements but got" << destination.size(), ); const MeshAttributeData& attribute = _attributes[attributeId]; CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format), - "Trade::MeshData::positions3DInto(): can't extract data out of an implementation-specific vertex format" << reinterpret_cast(vertexFormatUnwrap(attribute._format)), ); + "Trade::MeshData::positions3DInto(): can't extract data out of an implementation-specific vertex format" << Debug::hex << vertexFormatUnwrap(attribute._format), ); const Containers::StridedArrayView1D attributeData = attributeDataViewInternal(attribute); const Containers::StridedArrayView2D destination2f = Containers::arrayCast<2, Float>(Containers::arrayCast(destination)); const Containers::StridedArrayView2D destination3f = Containers::arrayCast<2, Float>(destination); @@ -776,7 +776,7 @@ void MeshData::tangentsInto(const Containers::StridedArrayView1D& desti CORRADE_ASSERT(destination.size() == _vertexCount, "Trade::MeshData::tangentsInto(): expected a view with" << _vertexCount << "elements but got" << destination.size(), ); const MeshAttributeData& attribute = _attributes[attributeId]; CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format), - "Trade::MeshData::tangentsInto(): can't extract data out of an implementation-specific vertex format" << reinterpret_cast(vertexFormatUnwrap(attribute._format)), ); + "Trade::MeshData::tangentsInto(): can't extract data out of an implementation-specific vertex format" << Debug::hex << vertexFormatUnwrap(attribute._format), ); /* If the tangent is four-component, ignore the last component; otherwise copy/unpack given format directly */ @@ -810,7 +810,7 @@ void MeshData::bitangentSignsInto(const Containers::StridedArrayView1D& d CORRADE_ASSERT(destination.size() == _vertexCount, "Trade::MeshData::bitangentSignsInto(): expected a view with" << _vertexCount << "elements but got" << destination.size(), ); const MeshAttributeData& attribute = _attributes[attributeId]; CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format), - "Trade::MeshData::bitangentSignsInto(): can't extract data out of an implementation-specific vertex format" << reinterpret_cast(vertexFormatUnwrap(attribute._format)), ); + "Trade::MeshData::bitangentSignsInto(): can't extract data out of an implementation-specific vertex format" << Debug::hex << vertexFormatUnwrap(attribute._format), ); const Containers::StridedArrayView1D attributeData = attributeDataViewInternal(attribute); const auto destination1f = Containers::arrayCast<2, Float>(destination); @@ -842,7 +842,7 @@ void MeshData::bitangentsInto(const Containers::StridedArrayView1D& des CORRADE_ASSERT(destination.size() == _vertexCount, "Trade::MeshData::bitangentsInto(): expected a view with" << _vertexCount << "elements but got" << destination.size(), ); const MeshAttributeData& attribute = _attributes[attributeId]; CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format), - "Trade::MeshData::bitangentsInto(): can't extract data out of an implementation-specific vertex format" << reinterpret_cast(vertexFormatUnwrap(attribute._format)), ); + "Trade::MeshData::bitangentsInto(): can't extract data out of an implementation-specific vertex format" << Debug::hex << vertexFormatUnwrap(attribute._format), ); tangentsOrNormalsInto(attributeDataViewInternal(attribute), destination, attribute._format); } @@ -863,7 +863,7 @@ void MeshData::normalsInto(const Containers::StridedArrayView1D& destin CORRADE_ASSERT(destination.size() == _vertexCount, "Trade::MeshData::normalsInto(): expected a view with" << _vertexCount << "elements but got" << destination.size(), ); const MeshAttributeData& attribute = _attributes[attributeId]; CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format), - "Trade::MeshData::normalsInto(): can't extract data out of an implementation-specific vertex format" << reinterpret_cast(vertexFormatUnwrap(attribute._format)), ); + "Trade::MeshData::normalsInto(): can't extract data out of an implementation-specific vertex format" << Debug::hex << vertexFormatUnwrap(attribute._format), ); tangentsOrNormalsInto(attributeDataViewInternal(attribute), destination, attribute._format); } @@ -884,7 +884,7 @@ void MeshData::textureCoordinates2DInto(const Containers::StridedArrayView1D(vertexFormatUnwrap(attribute._format)), ); + "Trade::MeshData::textureCoordinatesInto(): can't extract data out of an implementation-specific vertex format" << Debug::hex << vertexFormatUnwrap(attribute._format), ); const Containers::StridedArrayView1D attributeData = attributeDataViewInternal(attribute); const auto destination2f = Containers::arrayCast<2, Float>(destination); @@ -928,7 +928,7 @@ void MeshData::colorsInto(const Containers::StridedArrayView1D& destinat CORRADE_ASSERT(destination.size() == _vertexCount, "Trade::MeshData::colorsInto(): expected a view with" << _vertexCount << "elements but got" << destination.size(), ); const MeshAttributeData& attribute = _attributes[attributeId]; CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format), - "Trade::MeshData::colorsInto(): can't extract data out of an implementation-specific vertex format" << reinterpret_cast(vertexFormatUnwrap(attribute._format)), ); + "Trade::MeshData::colorsInto(): can't extract data out of an implementation-specific vertex format" << Debug::hex << vertexFormatUnwrap(attribute._format), ); const Containers::StridedArrayView1D attributeData = attributeDataViewInternal(attribute); const Containers::StridedArrayView2D destination3f = Containers::arrayCast<2, Float>(Containers::arrayCast(destination)); const Containers::StridedArrayView2D destination4f = Containers::arrayCast<2, Float>(destination); @@ -989,7 +989,7 @@ void MeshData::jointIdsInto(const Containers::StridedArrayView2D& d CORRADE_ASSERT(destination.isContiguous<1>(), "Trade::MeshData::jointIdsInto(): second view dimension is not contiguous", ); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format), - "Trade::MeshData::jointIdsInto(): can't extract data out of an implementation-specific vertex format" << reinterpret_cast(vertexFormatUnwrap(attribute._format)), ); + "Trade::MeshData::jointIdsInto(): can't extract data out of an implementation-specific vertex format" << Debug::hex << vertexFormatUnwrap(attribute._format), ); const Containers::StridedArrayView1D attributeData = attributeDataViewInternal(attribute); if(attribute._format == VertexFormat::UnsignedInt) @@ -1026,7 +1026,7 @@ void MeshData::weightsInto(const Containers::StridedArrayView2D& destinat CORRADE_ASSERT(destination.isContiguous<1>(), "Trade::MeshData::weightsInto(): second view dimension is not contiguous", ); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format), - "Trade::MeshData::weightsInto(): can't extract data out of an implementation-specific vertex format" << reinterpret_cast(vertexFormatUnwrap(attribute._format)), ); + "Trade::MeshData::weightsInto(): can't extract data out of an implementation-specific vertex format" << Debug::hex << vertexFormatUnwrap(attribute._format), ); const Containers::StridedArrayView1D attributeData = attributeDataViewInternal(attribute); if(attribute._format == VertexFormat::Float) @@ -1057,7 +1057,7 @@ void MeshData::objectIdsInto(const Containers::StridedArrayView1D& CORRADE_ASSERT(destination.size() == _vertexCount, "Trade::MeshData::objectIdsInto(): expected a view with" << _vertexCount << "elements but got" << destination.size(), ); const MeshAttributeData& attribute = _attributes[attributeId]; CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format), - "Trade::MeshData::objectIdsInto(): can't extract data out of an implementation-specific vertex format" << reinterpret_cast(vertexFormatUnwrap(attribute._format)), ); + "Trade::MeshData::objectIdsInto(): can't extract data out of an implementation-specific vertex format" << Debug::hex << vertexFormatUnwrap(attribute._format), ); const Containers::StridedArrayView1D attributeData = attributeDataViewInternal(attribute); const auto destination1ui = Containers::arrayCast<2, UnsignedInt>(destination); @@ -1120,7 +1120,7 @@ Debug& operator<<(Debug& debug, const MeshAttribute value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedShort(value) << Debug::nospace << (packed ? "" : ")"); } }} diff --git a/src/Magnum/Trade/MeshData.h b/src/Magnum/Trade/MeshData.h index 50f5a66575..dccf76f5f8 100644 --- a/src/Magnum/Trade/MeshData.h +++ b/src/Magnum/Trade/MeshData.h @@ -2289,7 +2289,7 @@ namespace Implementation { template MeshIndexData::MeshIndexData(const MeshIndexType type, T&& data) noexcept: _type{type} { const Containers::ArrayView erased = data; CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(type), - "Trade::MeshIndexData: can't create index data from a contiguous view and an implementation-specific type" << reinterpret_cast(meshIndexTypeUnwrap(type)) << Debug::nospace << ", pass a strided view instead", ); + "Trade::MeshIndexData: can't create index data from a contiguous view and an implementation-specific type" << Debug::hex << meshIndexTypeUnwrap(type) << Debug::nospace << ", pass a strided view instead", ); const std::size_t typeSize = meshIndexTypeSize(type); CORRADE_ASSERT(erased.size()%typeSize == 0, "Trade::MeshIndexData: view size" << erased.size() << "does not correspond to" << type, ); @@ -2657,7 +2657,7 @@ template Containers::StridedArrayView1D MeshData::indices() co if(!data.stride()[1]) return {}; #endif CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(_indexType), - "Trade::MeshData::indices(): can't cast data from an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(_indexType)), {}); + "Trade::MeshData::indices(): can't cast data from an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(_indexType), {}); CORRADE_ASSERT(Implementation::meshIndexTypeFor() == _indexType, "Trade::MeshData::indices(): indices are" << _indexType << "but requested" << Implementation::meshIndexTypeFor(), {}); return Containers::arrayCast<1, const T>(data); @@ -2671,7 +2671,7 @@ template Containers::StridedArrayView1D MeshData::mutableIndices() { if(!data.stride()[1]) return {}; #endif CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(_indexType), - "Trade::MeshData::mutableIndices(): can't cast data from an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(_indexType)), {}); + "Trade::MeshData::mutableIndices(): can't cast data from an implementation-specific index type" << Debug::hex << meshIndexTypeUnwrap(_indexType), {}); CORRADE_ASSERT(Implementation::meshIndexTypeFor() == _indexType, "Trade::MeshData::mutableIndices(): indices are" << _indexType << "but requested" << Implementation::meshIndexTypeFor(), {}); return Containers::arrayCast<1, T>(data); @@ -2684,7 +2684,7 @@ template bool MeshData::checkVertexFormatCompatibility(const MeshAttrib #endif ) const { CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format), - prefix << "can't cast data from an implementation-specific vertex format" << reinterpret_cast(vertexFormatUnwrap(attribute._format)), false); + prefix << "can't cast data from an implementation-specific vertex format" << Debug::hex << vertexFormatUnwrap(attribute._format), false); CORRADE_ASSERT(Implementation::isVertexFormatCompatible::type>(attribute._format), prefix << attribute._name << "is" << attribute._format << "but requested a type equivalent to" << Implementation::vertexFormatFor::type>(), false); CORRADE_ASSERT(!attribute._arraySize || std::is_array::value, diff --git a/src/Magnum/Trade/ObjectData2D.cpp b/src/Magnum/Trade/ObjectData2D.cpp index 158097b633..af76db4059 100644 --- a/src/Magnum/Trade/ObjectData2D.cpp +++ b/src/Magnum/Trade/ObjectData2D.cpp @@ -116,7 +116,7 @@ Debug& operator<<(Debug& debug, const ObjectInstanceType2D value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const ObjectFlag2D value) { @@ -130,7 +130,7 @@ Debug& operator<<(Debug& debug, const ObjectFlag2D value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const ObjectFlags2D value) { diff --git a/src/Magnum/Trade/ObjectData3D.cpp b/src/Magnum/Trade/ObjectData3D.cpp index 614e3caee4..0efbd16b78 100644 --- a/src/Magnum/Trade/ObjectData3D.cpp +++ b/src/Magnum/Trade/ObjectData3D.cpp @@ -113,7 +113,7 @@ Debug& operator<<(Debug& debug, const ObjectInstanceType3D value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const ObjectFlag3D value) { @@ -127,7 +127,7 @@ Debug& operator<<(Debug& debug, const ObjectFlag3D value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const ObjectFlags3D value) { diff --git a/src/Magnum/Trade/PhongMaterialData.cpp b/src/Magnum/Trade/PhongMaterialData.cpp index f595abdad2..d693b3221c 100644 --- a/src/Magnum/Trade/PhongMaterialData.cpp +++ b/src/Magnum/Trade/PhongMaterialData.cpp @@ -451,7 +451,7 @@ Debug& operator<<(Debug& debug, const PhongMaterialData::Flag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const PhongMaterialData::Flags value) { diff --git a/src/Magnum/Trade/SceneData.cpp b/src/Magnum/Trade/SceneData.cpp index 6950755a2a..a80935957b 100644 --- a/src/Magnum/Trade/SceneData.cpp +++ b/src/Magnum/Trade/SceneData.cpp @@ -71,7 +71,7 @@ Debug& operator<<(Debug& debug, const SceneMappingType value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } UnsignedInt sceneMappingTypeSize(const SceneMappingType type) { @@ -137,7 +137,7 @@ Debug& operator<<(Debug& debug, const SceneField value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const SceneFieldType value) { @@ -259,7 +259,7 @@ Debug& operator<<(Debug& debug, const SceneFieldType value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedShort(value) << Debug::nospace << (packed ? "" : ")"); } UnsignedInt sceneFieldTypeSize(const SceneFieldType type) { @@ -545,7 +545,7 @@ Debug& operator<<(Debug& debug, const SceneFieldFlag value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedShort(value) << Debug::nospace << (packed ? "" : ")"); } Debug& operator<<(Debug& debug, const SceneFieldFlags value) { diff --git a/src/Magnum/Trade/TextureData.cpp b/src/Magnum/Trade/TextureData.cpp index f156a5fc77..eb6ea08a58 100644 --- a/src/Magnum/Trade/TextureData.cpp +++ b/src/Magnum/Trade/TextureData.cpp @@ -48,7 +48,7 @@ Debug& operator<<(Debug& debug, const TextureType value) { /* LCOV_EXCL_STOP */ } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << (packed ? "" : ")"); } #endif diff --git a/src/Magnum/VertexFormat.cpp b/src/Magnum/VertexFormat.cpp index b4e3b95a68..9f101c054d 100644 --- a/src/Magnum/VertexFormat.cpp +++ b/src/Magnum/VertexFormat.cpp @@ -34,7 +34,7 @@ namespace Magnum { UnsignedInt vertexFormatSize(const VertexFormat format) { CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "vertexFormatSize(): can't determine size of an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), {}); + "vertexFormatSize(): can't determine size of an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), {}); switch(format) { case VertexFormat::UnsignedByte: @@ -171,7 +171,7 @@ UnsignedInt vertexFormatSize(const VertexFormat format) { UnsignedInt vertexFormatComponentCount(const VertexFormat format) { CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "vertexFormatComponentCount(): can't determine component count of an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), {}); + "vertexFormatComponentCount(): can't determine component count of an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), {}); switch(format) { case VertexFormat::Float: @@ -297,7 +297,7 @@ UnsignedInt vertexFormatComponentCount(const VertexFormat format) { VertexFormat vertexFormatComponentFormat(const VertexFormat format) { CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "vertexFormatComponentFormat(): can't determine component format of an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), {}); + "vertexFormatComponentFormat(): can't determine component format of an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), {}); switch(format) { case VertexFormat::Float: @@ -433,7 +433,7 @@ VertexFormat vertexFormatComponentFormat(const VertexFormat format) { UnsignedInt vertexFormatVectorCount(const VertexFormat format) { CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "vertexFormatVectorCount(): can't determine vector count of an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), {}); + "vertexFormatVectorCount(): can't determine vector count of an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), {}); switch(format) { case VertexFormat::Float: @@ -559,7 +559,7 @@ UnsignedInt vertexFormatVectorCount(const VertexFormat format) { UnsignedInt vertexFormatVectorStride(const VertexFormat format) { CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "vertexFormatVectorStride(): can't determine vector count of an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), {}); + "vertexFormatVectorStride(): can't determine vector count of an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), {}); switch(format) { case VertexFormat::UnsignedByte: @@ -688,7 +688,7 @@ UnsignedInt vertexFormatVectorStride(const VertexFormat format) { bool isVertexFormatNormalized(const VertexFormat format) { CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "isVertexFormatNormalized(): can't determine normalization of an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), {}); + "isVertexFormatNormalized(): can't determine normalization of an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), {}); switch(format) { case VertexFormat::Float: @@ -810,7 +810,7 @@ bool isVertexFormatNormalized(const VertexFormat format) { VertexFormat vertexFormat(const VertexFormat format, const UnsignedInt componentCount, const bool normalized) { CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "vertexFormat(): can't assemble a format out of an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), {}); + "vertexFormat(): can't assemble a format out of an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), {}); VertexFormat componentFormat = vertexFormatComponentFormat(format); @@ -851,7 +851,7 @@ VertexFormat vertexFormat(const VertexFormat format, const UnsignedInt component VertexFormat vertexFormat(const VertexFormat format, const UnsignedInt vectorCount, UnsignedInt componentCount, const bool aligned) { CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "vertexFormat(): can't assemble a format out of an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), {}); + "vertexFormat(): can't assemble a format out of an implementation-specific format" << Debug::hex << vertexFormatUnwrap(format), {}); CORRADE_ASSERT(vectorCount >= 2 && vectorCount <= 4, "vertexFormat(): invalid vector count" << vectorCount, {}); CORRADE_ASSERT(componentCount >= 2 && componentCount <= 4, @@ -916,14 +916,14 @@ Debug& operator<<(Debug& debug, const VertexFormat value) { debug << "VertexFormat" << Debug::nospace; if(isVertexFormatImplementationSpecific(value)) { - return debug << (packed ? "ImplementationSpecific(" : "::ImplementationSpecific(") << Debug::nospace << reinterpret_cast(vertexFormatUnwrap(value)) << Debug::nospace << ")"; + return debug << (packed ? "ImplementationSpecific(" : "::ImplementationSpecific(") << Debug::nospace << Debug::hex << vertexFormatUnwrap(value) << Debug::nospace << ")"; } if(UnsignedInt(value) - 1 < Containers::arraySize(VertexFormatNames)) { return debug << (packed ? "" : "::") << Debug::nospace << VertexFormatNames[UnsignedInt(value) - 1]; } - return debug << (packed ? "" : "(") << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << (packed ? "" : ")"); + return debug << (packed ? "" : "(") << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << (packed ? "" : ")"); } } diff --git a/src/Magnum/VertexFormat.h b/src/Magnum/VertexFormat.h index fc77d2f6fc..2bcfa086f2 100644 --- a/src/Magnum/VertexFormat.h +++ b/src/Magnum/VertexFormat.h @@ -1346,7 +1346,7 @@ remaining 31 bits. Use @ref vertexFormatUnwrap() for the inverse operation. template constexpr VertexFormat vertexFormatWrap(T implementationSpecific) { static_assert(sizeof(T) <= 4, "types larger than 32bits are not supported"); return CORRADE_CONSTEXPR_ASSERT(!(UnsignedInt(implementationSpecific) & (1u << 31)), - "vertexFormatWrap(): implementation-specific value" << reinterpret_cast(implementationSpecific) << "already wrapped or too large"), + "vertexFormatWrap(): implementation-specific value" << Debug::hex << UnsignedInt(implementationSpecific) << "already wrapped or too large"), VertexFormat((1u << 31)|UnsignedInt(implementationSpecific)); } diff --git a/src/Magnum/Vk/DeviceFeatures.cpp b/src/Magnum/Vk/DeviceFeatures.cpp index 328578d555..18ecefc611 100644 --- a/src/Magnum/Vk/DeviceFeatures.cpp +++ b/src/Magnum/Vk/DeviceFeatures.cpp @@ -53,7 +53,7 @@ Debug& operator<<(Debug& debug, const DeviceFeature value) { return debug << "::" << Debug::nospace << FeatureNames[UnsignedInt(value)]; } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const DeviceFeatures& value) { diff --git a/src/Magnum/Vk/DeviceProperties.cpp b/src/Magnum/Vk/DeviceProperties.cpp index 5783762d0c..7b9d1bc1d5 100644 --- a/src/Magnum/Vk/DeviceProperties.cpp +++ b/src/Magnum/Vk/DeviceProperties.cpp @@ -716,7 +716,7 @@ Debug& operator<<(Debug& debug, const QueueFlag value) { } /* Flag bits should be in hex, unlike plain values */ - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const QueueFlags value) { @@ -740,7 +740,7 @@ Debug& operator<<(Debug& debug, const MemoryHeapFlag value) { } /* Flag bits should be in hex, unlike plain values */ - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const MemoryHeapFlags value) { diff --git a/src/Magnum/Vk/Handle.cpp b/src/Magnum/Vk/Handle.cpp index 306ebed4ac..e3ca0eac4c 100644 --- a/src/Magnum/Vk/Handle.cpp +++ b/src/Magnum/Vk/Handle.cpp @@ -41,7 +41,7 @@ Debug& operator<<(Debug& debug, const HandleFlag value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const HandleFlags value) { diff --git a/src/Magnum/Vk/Image.cpp b/src/Magnum/Vk/Image.cpp index 7b3e507f10..789b7efd22 100644 --- a/src/Magnum/Vk/Image.cpp +++ b/src/Magnum/Vk/Image.cpp @@ -84,7 +84,7 @@ Debug& operator<<(Debug& debug, const ImageAspect value) { } /* Flag bits should be in hex, unlike plain values */ - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const ImageAspects value) { diff --git a/src/Magnum/Vk/Memory.cpp b/src/Magnum/Vk/Memory.cpp index 656d89322b..e7828f6987 100644 --- a/src/Magnum/Vk/Memory.cpp +++ b/src/Magnum/Vk/Memory.cpp @@ -148,7 +148,7 @@ Debug& operator<<(Debug& debug, const MemoryFlag value) { } /* Flag bits should be in hex, unlike plain values */ - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedInt(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedInt(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const MemoryFlags value) { diff --git a/src/Magnum/Vk/Pipeline.cpp b/src/Magnum/Vk/Pipeline.cpp index 485d8d5aea..7bf0d42779 100644 --- a/src/Magnum/Vk/Pipeline.cpp +++ b/src/Magnum/Vk/Pipeline.cpp @@ -501,7 +501,7 @@ Debug& operator<<(Debug& debug, const DynamicRasterizationState value) { return debug << "::" << Debug::nospace << DynamicRasterizationStateNames[UnsignedInt(value)]; } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedByte(value) << Debug::nospace << ")"; } Debug& operator<<(Debug& debug, const DynamicRasterizationStates& value) { diff --git a/src/MagnumPlugins/WavAudioImporter/WavHeader.cpp b/src/MagnumPlugins/WavAudioImporter/WavHeader.cpp index 78834f22ac..ec8c39be2e 100644 --- a/src/MagnumPlugins/WavAudioImporter/WavHeader.cpp +++ b/src/MagnumPlugins/WavAudioImporter/WavHeader.cpp @@ -50,7 +50,7 @@ Debug& operator<<(Debug& debug, const WavAudioFormat value) { /* LCOV_EXCL_STOP */ } - return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedShort(value)) << Debug::nospace << ")"; + return debug << "(" << Debug::nospace << Debug::hex << UnsignedShort(value) << Debug::nospace << ")"; } }}}