aboutsummaryrefslogtreecommitdiffstats
path: root/bindings/cpp/include
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-10-07 15:16:55 -0400
committerDavid Robillard <d@drobilla.net>2022-10-07 15:16:55 -0400
commited4c8a50505ab02a8f3a01e41f5f86acca04b81d (patch)
tree3c06732998db625fb771bbaeab69d249bf7ba517 /bindings/cpp/include
parent92132eca5e75d3f95a3eb7e015c47765a79925cc (diff)
downloadpugl-ed4c8a50505ab02a8f3a01e41f5f86acca04b81d.tar.gz
pugl-ed4c8a50505ab02a8f3a01e41f5f86acca04b81d.tar.bz2
pugl-ed4c8a50505ab02a8f3a01e41f5f86acca04b81d.zip
Avoid C-style casts in C++ code
Diffstat (limited to 'bindings/cpp/include')
-rw-r--r--bindings/cpp/include/pugl/pugl.hpp12
1 files changed, 7 insertions, 5 deletions
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<Status>(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<WorldType>(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<WorldFlag>(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<ViewHint>(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<Cursor>(PUGL_CURSOR_UP_DOWN) == Cursor::upDown, "");
/// @copydoc PuglView
class View : protected detail::Wrapper<PuglView, puglFreeView>