diff --git a/nano/node/common.hpp b/nano/node/common.hpp index 6f1bc79dd2..9d99cc0708 100644 --- a/nano/node/common.hpp +++ b/nano/node/common.hpp @@ -185,11 +185,11 @@ class message_header bool bulk_pull_is_count_present () const; static std::bitset<16> constexpr block_type_mask = std::bitset<16> (0x0f00); - inline bool valid_magic () const + bool valid_magic () const { return magic_number[0] == 'R' && magic_number[1] >= 'A' && magic_number[1] <= 'C'; } - inline bool valid_network () const + bool valid_network () const { return (magic_number[1] - 'A') == static_cast (nano::nano_network); } @@ -202,7 +202,7 @@ class message virtual ~message () = default; virtual void serialize (nano::stream &) const = 0; virtual void visit (nano::message_visitor &) const = 0; - virtual inline std::shared_ptr> to_bytes () const + virtual std::shared_ptr> to_bytes () const { std::shared_ptr> bytes (new std::vector); nano::vectorstream stream (*bytes); diff --git a/nano/node/stats.hpp b/nano/node/stats.hpp index 5f8ede333e..ecd8901fc8 100644 --- a/nano/node/stats.hpp +++ b/nano/node/stats.hpp @@ -63,7 +63,7 @@ class stat_datapoint std::chrono::system_clock::time_point timestamp{ std::chrono::system_clock::now () }; /** Add \addend to the current value and optionally update the timestamp */ - inline void add (uint64_t addend, bool update_timestamp = true) + void add (uint64_t addend, bool update_timestamp = true) { value += addend; if (update_timestamp) @@ -139,7 +139,7 @@ class stat_log_sink } /** Returns a reference to the log entry counter */ - inline size_t & entries () + size_t & entries () { return log_entries; } @@ -272,7 +272,7 @@ class stat * Call this to override the default sample interval and capacity, for a specific stat entry. * This must be called before any stat entries are added, as part of the node initialiation. */ - inline void configure (stat::type type, stat::detail detail, stat::dir dir, size_t interval, size_t capacity) + void configure (stat::type type, stat::detail detail, stat::dir dir, size_t interval, size_t capacity) { get_entry (key_of (type, detail, dir), interval, capacity); } @@ -280,32 +280,32 @@ class stat /** * Disables sampling for a given type/detail/dir combination */ - inline void disable_sampling (stat::type type, stat::detail detail, stat::dir dir) + void disable_sampling (stat::type type, stat::detail detail, stat::dir dir) { auto entry = get_entry (key_of (type, detail, dir)); entry->sample_interval = 0; } /** Increments the given counter */ - inline void inc (stat::type type, stat::dir dir = stat::dir::in) + void inc (stat::type type, stat::dir dir = stat::dir::in) { add (type, dir, 1); } /** Increments the counter for \detail, but doesn't update at the type level */ - inline void inc_detail_only (stat::type type, stat::detail detail, stat::dir dir = stat::dir::in) + void inc_detail_only (stat::type type, stat::detail detail, stat::dir dir = stat::dir::in) { add (type, detail, dir, 1); } /** Increments the given counter */ - inline void inc (stat::type type, stat::detail detail, stat::dir dir = stat::dir::in) + void inc (stat::type type, stat::detail detail, stat::dir dir = stat::dir::in) { add (type, detail, dir, 1); } /** Adds \p value to the given counter */ - inline void add (stat::type type, stat::dir dir, uint64_t value) + void add (stat::type type, stat::dir dir, uint64_t value) { add (type, detail::all, dir, value); } @@ -320,7 +320,7 @@ class stat * @param value The amount to add * @param detail_only If true, only update the detail-level counter */ - inline void add (stat::type type, stat::detail detail, stat::dir dir, uint64_t value, bool detail_only = false) + void add (stat::type type, stat::detail detail, stat::dir dir, uint64_t value, bool detail_only = false) { constexpr uint32_t no_detail_mask = 0xffff00ff; uint32_t key = key_of (type, detail, dir); @@ -340,12 +340,12 @@ class stat * To avoid recursion, the observer callback must only use the received data point snapshop, not query the stat object. * @param observer The observer receives a snapshot of the current samples. */ - inline void observe_sample (stat::type type, stat::detail detail, stat::dir dir, std::function &)> observer) + void observe_sample (stat::type type, stat::detail detail, stat::dir dir, std::function &)> observer) { get_entry (key_of (type, detail, dir))->sample_observers.add (observer); } - inline void observe_sample (stat::type type, stat::dir dir, std::function &)> observer) + void observe_sample (stat::type type, stat::dir dir, std::function &)> observer) { observe_sample (type, stat::detail::all, dir, observer); } @@ -355,25 +355,25 @@ class stat * To avoid recursion, the observer callback must only use the received counts, not query the stat object. * @param observer The observer receives the old and the new count. */ - inline void observe_count (stat::type type, stat::detail detail, stat::dir dir, std::function observer) + void observe_count (stat::type type, stat::detail detail, stat::dir dir, std::function observer) { get_entry (key_of (type, detail, dir))->count_observers.add (observer); } /** Returns a potentially empty list of the last N samples, where N is determined by the 'capacity' configuration */ - inline boost::circular_buffer * samples (stat::type type, stat::detail detail, stat::dir dir) + boost::circular_buffer * samples (stat::type type, stat::detail detail, stat::dir dir) { return &get_entry (key_of (type, detail, dir))->samples; } /** Returns current value for the given counter at the type level */ - inline uint64_t count (stat::type type, stat::dir dir = stat::dir::in) + uint64_t count (stat::type type, stat::dir dir = stat::dir::in) { return count (type, stat::detail::all, dir); } /** Returns current value for the given counter at the detail level */ - inline uint64_t count (stat::type type, stat::detail detail, stat::dir dir = stat::dir::in) + uint64_t count (stat::type type, stat::detail detail, stat::dir dir = stat::dir::in) { return get_entry (key_of (type, detail, dir))->counter.value; } @@ -396,7 +396,7 @@ class stat static std::string dir_to_string (uint32_t key); /** Constructs a key given type, detail and direction. This is used as input to update(...) and get_entry(...) */ - inline uint32_t key_of (stat::type type, stat::detail detail, stat::dir dir) const + uint32_t key_of (stat::type type, stat::detail detail, stat::dir dir) const { return static_cast (type) << 16 | static_cast (detail) << 8 | static_cast (dir); }