diff options
Diffstat (limited to 'raul')
-rw-r--r-- | raul/Maid.hpp | 4 | ||||
-rw-r--r-- | raul/Socket.hpp | 5 | ||||
-rw-r--r-- | raul/TimeSlice.hpp | 3 | ||||
-rw-r--r-- | raul/TimeStamp.hpp | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/raul/Maid.hpp b/raul/Maid.hpp index b7ae5d9..1479f71 100644 --- a/raul/Maid.hpp +++ b/raul/Maid.hpp @@ -66,12 +66,14 @@ public: class Disposer { public: explicit Disposer(Maid* maid) : _maid(maid) {} - Disposer() : _maid(nullptr) {} + + Disposer() = default; void operator()(T* obj) { if (_maid) { _maid->dispose(obj); } } + private: Maid* _maid{nullptr}; }; diff --git a/raul/Socket.hpp b/raul/Socket.hpp index df7645a..579a5cd 100644 --- a/raul/Socket.hpp +++ b/raul/Socket.hpp @@ -175,9 +175,8 @@ Socket::set_addr(const std::string& uri) host = "0.0.0.0"; // INADDR_ANY } - struct addrinfo* ainfo; - int st = 0; - if ((st = getaddrinfo(host.c_str(), port.c_str(), nullptr, &ainfo))) { + struct addrinfo* ainfo = nullptr; + if (getaddrinfo(host.c_str(), port.c_str(), nullptr, &ainfo)) { return false; } diff --git a/raul/TimeSlice.hpp b/raul/TimeSlice.hpp index 3f629ea..7758602 100644 --- a/raul/TimeSlice.hpp +++ b/raul/TimeSlice.hpp @@ -130,7 +130,8 @@ public: inline TimeUnit beats_unit() const { return _start_beats.unit(); } inline TimeUnit ticks_unit() const { return _start_ticks.unit(); } - inline TimeUnit real_unit() const { return {TimeUnit::SECONDS, 0}; } + + static inline TimeUnit real_unit() { return {TimeUnit::SECONDS, 0}; } private: inline void update_beat_time() { diff --git a/raul/TimeStamp.hpp b/raul/TimeStamp.hpp index c07a552..d8d4939 100644 --- a/raul/TimeStamp.hpp +++ b/raul/TimeStamp.hpp @@ -93,7 +93,7 @@ public: { dec = std::max(0.0, dec); dec = std::min(double(std::numeric_limits<uint32_t>::max()), dec); - double integral; + double integral = 0.0; const double fractional = modf(dec, &integral); _ticks = static_cast<uint32_t>(integral); _subticks = static_cast<uint32_t>(fractional * unit.ppt()); |