diff options
author | David Robillard <d@drobilla.net> | 2020-09-19 13:22:17 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-09-19 18:51:33 +0200 |
commit | 181bd895918c341e0a2ef1d0558a591028bf2d7d (patch) | |
tree | 6dcf8fe1d5aae548723663ffcff72788027ae850 | |
parent | d70aa80d71299c24ebd71537cfd620eff2b7e50d (diff) | |
download | pugl-181bd895918c341e0a2ef1d0558a591028bf2d7d.tar.gz pugl-181bd895918c341e0a2ef1d0558a591028bf2d7d.tar.bz2 pugl-181bd895918c341e0a2ef1d0558a591028bf2d7d.zip |
Fix clang-tidy warnings
-rw-r--r-- | .clang-tidy | 2 | ||||
-rw-r--r-- | pugl/pugl.hpp | 18 |
2 files changed, 16 insertions, 4 deletions
diff --git a/.clang-tidy b/.clang-tidy index 7e79698..c8039e1 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -8,8 +8,6 @@ Checks: > -cert-flp30-c, -clang-analyzer-alpha.*, -clang-analyzer-security.FloatLoopCounter, - -fuchsia-default-arguments-calls, - -fuchsia-default-arguments-declarations, -google-runtime-references, -hicpp-multiway-paths-covered, -hicpp-signed-bitwise, diff --git a/pugl/pugl.hpp b/pugl/pugl.hpp index 90036e4..3072560 100644 --- a/pugl/pugl.hpp +++ b/pugl/pugl.hpp @@ -274,7 +274,7 @@ private: class World : public detail::Wrapper<PuglWorld, puglFreeWorld> { public: - explicit World(WorldType type, WorldFlags flags = {}) + explicit World(WorldType type, WorldFlags flags) : Wrapper{puglNewWorld(static_cast<PuglWorldType>(type), flags)} , _clock(*this) { @@ -283,6 +283,14 @@ public: } } + explicit World(WorldType type) + : World{type, {}} + { + if (!cobj()) { + throw std::runtime_error("Failed to create pugl::World"); + } + } + /// @copydoc puglGetNativeWorld void* nativeWorld() { return puglGetNativeWorld(cobj()); } @@ -394,6 +402,12 @@ public: virtual ~View() = default; + View(const View&) = delete; + View& operator=(const View&) = delete; + + View(View&&) = delete; + View&& operator=(View&&) = delete; + const pugl::World& world() const { return _world; } pugl::World& world() { return _world; } @@ -580,7 +594,7 @@ private: template<class Typed, class Base> static const Typed& typedEventRef(const Base& base) { - const Typed& event = static_cast<const Typed&>(base); + const auto& event = static_cast<const Typed&>(base); static_assert(sizeof(event) == sizeof(typename Typed::BaseEvent), ""); static_assert(std::is_standard_layout<Typed>::value, ""); assert(event.type == Typed::type); |