From ed4c8a50505ab02a8f3a01e41f5f86acca04b81d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 7 Oct 2022 15:16:55 -0400 Subject: Avoid C-style casts in C++ code --- bindings/cpp/include/pugl/pugl.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'bindings') diff --git a/bindings/cpp/include/pugl/pugl.hpp b/bindings/cpp/include/pugl/pugl.hpp index 87cd378..3f21dc6 100644 --- a/bindings/cpp/include/pugl/pugl.hpp +++ b/bindings/cpp/include/pugl/pugl.hpp @@ -205,7 +205,7 @@ enum class Status { unsupported, ///< @copydoc PUGL_UNSUPPORTED }; -static_assert(Status(PUGL_UNSUPPORTED) == Status::unsupported, ""); +static_assert(static_cast(PUGL_UNSUPPORTED) == Status::unsupported, ""); /// @copydoc puglStrerror inline const char* @@ -226,14 +226,15 @@ enum class WorldType { module, ///< @copydoc PUGL_MODULE }; -static_assert(WorldType(PUGL_MODULE) == WorldType::module, ""); +static_assert(static_cast(PUGL_MODULE) == WorldType::module, ""); /// @copydoc PuglWorldFlag enum class WorldFlag { threads = PUGL_WORLD_THREADS, ///< @copydoc PUGL_WORLD_THREADS }; -static_assert(WorldFlag(PUGL_WORLD_THREADS) == WorldFlag::threads, ""); +static_assert(static_cast(PUGL_WORLD_THREADS) == WorldFlag::threads, + ""); using WorldFlags = PuglWorldFlags; ///< @copydoc PuglWorldFlags @@ -363,7 +364,8 @@ enum class ViewHint { refreshRate, ///< @copydoc PUGL_REFRESH_RATE }; -static_assert(ViewHint(PUGL_REFRESH_RATE) == ViewHint::refreshRate, ""); +static_assert(static_cast(PUGL_REFRESH_RATE) == ViewHint::refreshRate, + ""); using ViewHintValue = PuglViewHintValue; ///< @copydoc PuglViewHintValue @@ -378,7 +380,7 @@ enum class Cursor { upDown, ///< @copydoc PUGL_CURSOR_UP_DOWN }; -static_assert(Cursor(PUGL_CURSOR_UP_DOWN) == Cursor::upDown, ""); +static_assert(static_cast(PUGL_CURSOR_UP_DOWN) == Cursor::upDown, ""); /// @copydoc PuglView class View : protected detail::Wrapper -- cgit v1.2.1