]> granicus.if.org Git - icinga2/commitdiff
Remove unnecessary inline statements 5897/head
authorJean Flach <jean-marcel.flach@icinga.com>
Wed, 20 Dec 2017 12:22:38 +0000 (13:22 +0100)
committerJean Flach <jean-marcel.flach@icinga.com>
Wed, 20 Dec 2017 12:22:38 +0000 (13:22 +0100)
fixes #5886

lib/base/array.hpp
lib/base/convert.hpp
lib/base/dictionary.hpp
lib/base/function.hpp
lib/base/loader.hpp
lib/base/logger.hpp
lib/base/objectlock.hpp
lib/base/scriptframe.hpp
lib/base/string.hpp
lib/base/value.hpp
lib/config/expression.hpp

index 682fdfe81b7db34015dac92739a919567fcb7df3..b01a173dd1dcddf6a47ef1f2578f3fb69fe38945 100644 (file)
@@ -47,14 +47,14 @@ public:
 
        typedef std::vector<Value>::size_type SizeType;
 
-       inline Array(void)
+       Array(void)
        { }
 
-       inline Array(std::initializer_list<Value> init)
+       Array(std::initializer_list<Value> init)
            : m_Data(init)
        { }
 
-       inline ~Array(void)
+       ~Array(void)
        { }
 
        Value Get(SizeType index) const;
@@ -70,7 +70,7 @@ public:
         *
         * @returns An iterator.
         */
-       inline Iterator Begin(void)
+       Iterator Begin(void)
        {
                ASSERT(OwnsLock());
 
@@ -84,7 +84,7 @@ public:
         *
         * @returns An iterator.
         */
-       inline Iterator End(void)
+       Iterator End(void)
        {
                ASSERT(OwnsLock());
 
index 5e13a0f963e3a5c2c19db5c8b394d38190759ec7..5eb3d67ba1050519831f954f272373ef37f0649b 100644 (file)
@@ -59,17 +59,17 @@ public:
                }
        }
 
-       static inline long ToLong(const Value& val)
+       static long ToLong(const Value& val)
        {
                return val;
        }
 
-       static inline double ToDouble(const Value& val)
+       static double ToDouble(const Value& val)
        {
                return val;
        }
 
-       static inline bool ToBool(const Value& val)
+       static bool ToBool(const Value& val)
        {
                return val.ToBool();
        }
index 298079ba775adcdca69b0c12dd907819c7a0db44..05410bea8cc9817bba23cb83096abf43f2bcbaea 100644 (file)
@@ -49,10 +49,10 @@ public:
 
        typedef std::map<String, Value>::value_type Pair;
 
-       inline Dictionary(void)
+       Dictionary(void)
        { }
 
-       inline ~Dictionary(void)
+       ~Dictionary(void)
        { }
 
        Value Get(const String& key) const;
@@ -68,7 +68,7 @@ public:
         *
         * @returns An iterator.
         */
-       inline Iterator Begin(void)
+       Iterator Begin(void)
        {
                ASSERT(OwnsLock());
 
@@ -82,7 +82,7 @@ public:
         *
         * @returns An iterator.
         */
-       inline Iterator End(void)
+       Iterator End(void)
        {
                ASSERT(OwnsLock());
 
@@ -98,7 +98,7 @@ public:
         *
         * @param it The iterator.
         */
-       inline void Remove(Iterator it)
+       void Remove(Iterator it)
        {
                ASSERT(OwnsLock());
 
index 6dc0700805e07597087eaa5e745494c1bdc4cea5..6922ca1fe92b65ebaecd7665064f31c0fe6ced5a 100644 (file)
@@ -51,12 +51,12 @@ public:
        Value Invoke(const std::vector<Value>& arguments = std::vector<Value>());
        Value InvokeThis(const Value& otherThis, const std::vector<Value>& arguments = std::vector<Value>());
 
-       inline bool IsSideEffectFree(void) const
+       bool IsSideEffectFree(void) const
        {
                return GetSideEffectFree();
        }
 
-       inline bool IsDeprecated(void) const
+       bool IsDeprecated(void) const
        {
                return GetDeprecated();
        }
index 0a05f6214eabf657f744baaea69f5bde7f1f4275..e7d9d39d8d35f66c575740ae11e8e8ece4166d90 100644 (file)
@@ -35,12 +35,12 @@ public:
            : m_Callback(callback), m_Priority(priority)
        { }
 
-       inline bool operator<(const DeferredInitializer& other) const
+       bool operator<(const DeferredInitializer& other) const
        {
                return m_Priority < other.m_Priority;
        }
 
-       inline void operator()(void)
+       void operator()(void)
        {
                m_Callback();
        }
index 589c5e0fd13844b1c4221779387e9f194c33623f..ad16d0d4fe7e233eb051b5466281acaa4318f460 100644 (file)
@@ -109,17 +109,17 @@ I2_BASE_API void IcingaLog(LogSeverity severity, const String& facility, const S
 class Log
 {
 public:
-       inline Log(LogSeverity severity, const String& facility, const String& message)
+       Log(LogSeverity severity, const String& facility, const String& message)
                : m_Severity(severity), m_Facility(facility)
        {
                m_Buffer << message;
        }
 
-       inline Log(LogSeverity severity, const String& facility)
+       Log(LogSeverity severity, const String& facility)
                : m_Severity(severity), m_Facility(facility)
        { }
 
-       inline ~Log(void)
+       ~Log(void)
        {
                IcingaLog(m_Severity, m_Facility, m_Buffer.str());
        }
index 3908d27a4d6138b0d430e566d43c05f1d96b16f8..cc8770923731b18e75ce52b48002dab52317e19d 100644 (file)
@@ -34,30 +34,30 @@ namespace icinga
 struct I2_BASE_API ObjectLock
 {
 public:
-       inline ObjectLock(void)
+       ObjectLock(void)
                : m_Object(nullptr), m_Locked(false)
        { }
 
-       inline ~ObjectLock(void)
+       ~ObjectLock(void)
        {
                Unlock();
        }
 
-       inline ObjectLock(const Object::Ptr& object)
+       ObjectLock(const Object::Ptr& object)
                : m_Object(object.get()), m_Locked(false)
        {
                if (m_Object)
                        Lock();
        }
 
-       inline ObjectLock(const Object *object)
+       ObjectLock(const Object *object)
                : m_Object(object), m_Locked(false)
        {
                if (m_Object)
                        Lock();
        }
 
-       inline static void LockMutex(const Object *object)
+       static void LockMutex(const Object *object)
        {
                unsigned int it = 0;
 
@@ -94,7 +94,7 @@ public:
 #endif /* _WIN32 */
        }
 
-       inline void Lock(void)
+       void Lock(void)
        {
                ASSERT(!m_Locked && m_Object);
 
@@ -111,7 +111,7 @@ public:
 #endif /* I2_DEBUG */
        }
 
-       inline static void Spin(unsigned int it)
+       static void Spin(unsigned int it)
        {
                if (it < 8) {
                        /* Do nothing. */
@@ -130,7 +130,7 @@ public:
                }
        }
 
-       inline void Unlock(void)
+       void Unlock(void)
        {
 #ifdef I2_DEBUG
                if (m_Locked) {
index 06fdad0fdaf8a61ff00eed8c10863c89df63fcd9..98e54dd3d136606a6262ca6470a85f7edfdf5914 100644 (file)
@@ -52,8 +52,8 @@ private:
        static boost::thread_specific_ptr<std::stack<ScriptFrame *> > m_ScriptFrames;
        static Array::Ptr m_Imports;
 
-       inline static void PushFrame(ScriptFrame *frame);
-       inline static ScriptFrame *PopFrame(void);
+       static void PushFrame(ScriptFrame *frame);
+       static ScriptFrame *PopFrame(void);
 
        void InitializeFrame(void);
 };
index ae94e952fb0567036932252515dccbbed0ef975c..961112004631296a9f52ccf882394a5b455a8021 100644 (file)
@@ -58,23 +58,23 @@ public:
 
        typedef std::string::size_type SizeType;
 
-       inline String(void)
+       String(void)
                : m_Data()
        { }
 
-       inline String(const char *data)
+       String(const char *data)
                : m_Data(data)
        { }
 
-       inline String(const std::string& data)
+       String(const std::string& data)
                : m_Data(data)
        { }
 
-       inline String(std::string&& data)
+       String(std::string&& data)
                : m_Data(data)
        { }
 
-       inline String(String::SizeType n, char c)
+       String(String::SizeType n, char c)
                : m_Data(n, c)
        { }
 
@@ -90,7 +90,7 @@ public:
        String(Value&& other);
 #endif /* _MSC_VER */
 
-       inline ~String(void)
+       ~String(void)
        { }
 
        template<typename InputIterator>
@@ -112,35 +112,35 @@ public:
 
        String& operator=(Value&& rhs);
 
-       inline String& operator=(const std::string& rhs)
+       String& operator=(const std::string& rhs)
        {
                m_Data = rhs;
                return *this;
        }
 
-       inline String& operator=(const char *rhs)
+       String& operator=(const char *rhs)
        {
                m_Data = rhs;
                return *this;
        }
 
-       inline const char& operator[](SizeType pos) const
+       const char& operator[](SizeType pos) const
        {
                return m_Data[pos];
        }
 
-       inline char& operator[](SizeType pos)
+       char& operator[](SizeType pos)
        {
                return m_Data[pos];
        }
 
-       inline String& operator+=(const String& rhs)
+       String& operator+=(const String& rhs)
        {
                m_Data += rhs.m_Data;
                return *this;
        }
 
-       inline String& operator+=(const char *rhs)
+       String& operator+=(const char *rhs)
        {
                m_Data += rhs;
                return *this;
@@ -148,153 +148,153 @@ public:
 
        String& operator+=(const Value& rhs);
 
-       inline String& operator+=(char rhs)
+       String& operator+=(char rhs)
        {
                m_Data += rhs;
                return *this;
        }
 
-       inline bool IsEmpty(void) const
+       bool IsEmpty(void) const
        {
                return m_Data.empty();
        }
 
-       inline bool operator<(const String& rhs) const
+       bool operator<(const String& rhs) const
        {
                return m_Data < rhs.m_Data;
        }
 
-       inline operator const std::string&(void) const
+       operator const std::string&(void) const
        {
                return m_Data;
        }
 
-       inline const char *CStr(void) const
+       const char *CStr(void) const
        {
                return m_Data.c_str();
        }
 
-       inline void Clear(void)
+       void Clear(void)
        {
                m_Data.clear();
        }
 
-       inline SizeType GetLength(void) const
+       SizeType GetLength(void) const
        {
                return m_Data.size();
        }
 
-       inline std::string& GetData(void)
+       std::string& GetData(void)
        {
                return m_Data;
        }
 
-       inline const std::string& GetData(void) const
+       const std::string& GetData(void) const
        {
                return m_Data;
        }
 
-       inline SizeType Find(const String& str, SizeType pos = 0) const
+       SizeType Find(const String& str, SizeType pos = 0) const
        {
                return m_Data.find(str, pos);
        }
 
-       inline SizeType RFind(const String& str, SizeType pos = NPos) const
+       SizeType RFind(const String& str, SizeType pos = NPos) const
        {
                return m_Data.rfind(str, pos);
        }
 
-       inline SizeType FindFirstOf(const char *s, SizeType pos = 0) const
+       SizeType FindFirstOf(const char *s, SizeType pos = 0) const
        {
                return m_Data.find_first_of(s, pos);
        }
 
-       inline SizeType FindFirstOf(char ch, SizeType pos = 0) const
+       SizeType FindFirstOf(char ch, SizeType pos = 0) const
        {
                return m_Data.find_first_of(ch, pos);
        }
 
-       inline SizeType FindFirstNotOf(const char *s, SizeType pos = 0) const
+       SizeType FindFirstNotOf(const char *s, SizeType pos = 0) const
        {
                return m_Data.find_first_not_of(s, pos);
        }
 
-       inline SizeType FindFirstNotOf(char ch, SizeType pos = 0) const
+       SizeType FindFirstNotOf(char ch, SizeType pos = 0) const
        {
                return m_Data.find_first_not_of(ch, pos);
        }
 
-       inline SizeType FindLastOf(const char *s, SizeType pos = NPos) const
+       SizeType FindLastOf(const char *s, SizeType pos = NPos) const
        {
                return m_Data.find_last_of(s, pos);
        }
 
-       inline SizeType FindLastOf(char ch, SizeType pos = NPos) const
+       SizeType FindLastOf(char ch, SizeType pos = NPos) const
        {
                return m_Data.find_last_of(ch, pos);
        }
 
-       inline String SubStr(SizeType first, SizeType len = NPos) const
+       String SubStr(SizeType first, SizeType len = NPos) const
        {
                return m_Data.substr(first, len);
        }
 
-       inline std::vector<String> Split(const char *separators) const
+       std::vector<String> Split(const char *separators) const
        {
                std::vector<String> result;
                boost::algorithm::split(result, m_Data, boost::is_any_of(separators));
                return result;
        }
 
-       inline void Replace(SizeType first, SizeType second, const String& str)
+       void Replace(SizeType first, SizeType second, const String& str)
        {
                m_Data.replace(first, second, str);
        }
 
-       inline String Trim(void) const
+       String Trim(void) const
        {
                String t = m_Data;
                boost::algorithm::trim(t);
                return t;
        }
 
-       inline String ToLower(void) const
+       String ToLower(void) const
        {
                String t = m_Data;
                boost::algorithm::to_lower(t);
                return t;
        }
 
-       inline String ToUpper(void) const
+       String ToUpper(void) const
        {
                String t = m_Data;
                boost::algorithm::to_upper(t);
                return t;
        }
 
-       inline String Reverse(void) const
+       String Reverse(void) const
        {
                String t = m_Data;
                std::reverse(t.m_Data.begin(), t.m_Data.end());
                return t;
        }
 
-       inline void Append(int count, char ch)
+       void Append(int count, char ch)
        {
                m_Data.append(count, ch);
        }
 
-       inline bool Contains(const String& str) const
+       bool Contains(const String& str) const
        {
                return (m_Data.find(str) != std::string::npos);
        }
 
-       inline void swap(String& str)
+       void swap(String& str)
        {
                m_Data.swap(str.m_Data);
        }
 
-       inline Iterator erase(Iterator first, Iterator last)
+       Iterator erase(Iterator first, Iterator last)
        {
                return m_Data.erase(first, last);
        }
@@ -305,42 +305,42 @@ public:
                m_Data.insert(p, first, last);
        }
 
-       inline Iterator Begin(void)
+       Iterator Begin(void)
        {
                return m_Data.begin();
        }
 
-       inline ConstIterator Begin(void) const
+       ConstIterator Begin(void) const
        {
                return m_Data.begin();
        }
 
-       inline Iterator End(void)
+       Iterator End(void)
        {
                return m_Data.end();
        }
 
-       inline ConstIterator End(void) const
+       ConstIterator End(void) const
        {
                return m_Data.end();
        }
 
-       inline ReverseIterator RBegin(void)
+       ReverseIterator RBegin(void)
        {
                return m_Data.rbegin();
        }
 
-       inline ConstReverseIterator RBegin(void) const
+       ConstReverseIterator RBegin(void) const
        {
                return m_Data.rbegin();
        }
 
-       inline ReverseIterator REnd(void)
+       ReverseIterator REnd(void)
        {
                return m_Data.rend();
        }
 
-       inline ConstReverseIterator REnd(void) const
+       ConstReverseIterator REnd(void) const
        {
                return m_Data.rend();
        }
index 996a6a25b615a02bb727e117b3fdbfa98240b722..972201ac0be71cc7204e5f216c7d281e7fb25ebb 100644 (file)
@@ -52,53 +52,53 @@ enum ValueType
 class I2_BASE_API Value
 {
 public:
-       inline Value(void)
+       Value(void)
        { }
 
-       inline Value(std::nullptr_t)
+       Value(std::nullptr_t)
        { }
 
-       inline Value(int value)
+       Value(int value)
                : m_Value(double(value))
        { }
 
-       inline Value(unsigned int value)
+       Value(unsigned int value)
                : m_Value(double(value))
        { }
 
-       inline Value(long value)
+       Value(long value)
                : m_Value(double(value))
        { }
 
-       inline Value(unsigned long value)
+       Value(unsigned long value)
                : m_Value(double(value))
        { }
 
-       inline Value(long long value)
+       Value(long long value)
                : m_Value(double(value))
        { }
 
-       inline Value(unsigned long long value)
+       Value(unsigned long long value)
                : m_Value(double(value))
        { }
 
-       inline Value(double value)
+       Value(double value)
                : m_Value(value)
        { }
 
-       inline Value(bool value)
+       Value(bool value)
                : m_Value(value)
        { }
 
-       inline Value(const String& value)
+       Value(const String& value)
                : m_Value(value)
        { }
 
-       inline Value(String&& value)
+       Value(String&& value)
                : m_Value(value)
        { }
 
-       inline Value(const char *value)
+       Value(const char *value)
                : m_Value(String(value))
        { }
 
@@ -115,7 +115,7 @@ public:
 #endif /* BOOST_VERSION */
        }
 
-       inline Value(Object *value)
+       Value(Object *value)
        {
                if (!value)
                        return;
@@ -124,7 +124,7 @@ public:
        }
 
        template<typename T>
-       inline Value(const intrusive_ptr<T>& value)
+       Value(const intrusive_ptr<T>& value)
        {
                if (!value)
                        return;
@@ -198,7 +198,7 @@ public:
        *
        * @returns true if the variant is empty, false otherwise.
        */
-       inline bool IsEmpty(void) const
+       bool IsEmpty(void) const
        {
                return (GetType() == ValueEmpty || (IsString() && boost::get<String>(m_Value).IsEmpty()));
        }
@@ -208,7 +208,7 @@ public:
        *
        * @returns true if the variant is scalar, false otherwise.
        */
-       inline bool IsScalar(void) const
+       bool IsScalar(void) const
        {
                return !IsEmpty() && !IsObject();
        }
@@ -218,7 +218,7 @@ public:
        *
        * @returns true if the variant is a number.
        */
-       inline bool IsNumber(void) const
+       bool IsNumber(void) const
        {
                return (GetType() == ValueNumber);
        }
@@ -228,7 +228,7 @@ public:
         *
         * @returns true if the variant is a boolean.
         */
-       inline bool IsBoolean(void) const
+       bool IsBoolean(void) const
        {
                return (GetType() == ValueBoolean);
        }
@@ -238,7 +238,7 @@ public:
        *
        * @returns true if the variant is a string.
        */
-       inline bool IsString(void) const
+       bool IsString(void) const
        {
                return (GetType() == ValueString);
        }
@@ -248,7 +248,7 @@ public:
        *
        * @returns true if the variant is a non-null object, false otherwise.
        */
-       inline bool IsObject(void) const
+       bool IsObject(void) const
        {
                return  (GetType() == ValueObject);
        }
@@ -267,12 +267,12 @@ public:
        *
        * @returns The type.
        */
-       inline ValueType GetType(void) const
+       ValueType GetType(void) const
        {
                return static_cast<ValueType>(m_Value.which());
        }
 
-       inline void Swap(Value& other)
+       void Swap(Value& other)
        {
                m_Value.swap(other.m_Value);
        }
index 46a373556fdab8ade4858f98e38e275668cf3fc0..01d438f13fbef084ffa9d5f9add99e5043cf1e58 100644 (file)
@@ -44,12 +44,12 @@ public:
            : m_Hints(std::move(hints))
        { }
 
-       inline void AddMessage(const String& message, const DebugInfo& di)
+       void AddMessage(const String& message, const DebugInfo& di)
        {
                GetMessages()->Add(new Array({ message, di.Path, di.FirstLine, di.FirstColumn, di.LastLine, di.LastColumn }));
        }
 
-       inline DebugHint GetChild(const String& name)
+       DebugHint GetChild(const String& name)
        {
                const Dictionary::Ptr& children = GetChildren();