From 1c9bec19993417b1f3b240f2bdb0745aa26c0cb3 Mon Sep 17 00:00:00 2001 From: truebrain Date: Tue, 20 Dec 2011 17:57:56 +0000 Subject: (svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC) --- src/core/enum_type.hpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/core/enum_type.hpp') diff --git a/src/core/enum_type.hpp b/src/core/enum_type.hpp index 21518d269..a6332296a 100644 --- a/src/core/enum_type.hpp +++ b/src/core/enum_type.hpp @@ -14,13 +14,13 @@ /** Some enums need to have allowed incrementing (i.e. StationClassID) */ #define DECLARE_POSTFIX_INCREMENT(type) \ - FORCEINLINE type operator ++(type& e, int) \ + inline type operator ++(type& e, int) \ { \ type e_org = e; \ e = (type)((int)e + 1); \ return e_org; \ } \ - FORCEINLINE type operator --(type& e, int) \ + inline type operator --(type& e, int) \ { \ type e_org = e; \ e = (type)((int)e - 1); \ @@ -31,13 +31,13 @@ /** Operators to allow to work with enum as with type safe bit set in C++ */ # define DECLARE_ENUM_AS_BIT_SET(mask_t) \ - FORCEINLINE mask_t operator | (mask_t m1, mask_t m2) {return (mask_t)((int)m1 | m2);} \ - FORCEINLINE mask_t operator & (mask_t m1, mask_t m2) {return (mask_t)((int)m1 & m2);} \ - FORCEINLINE mask_t operator ^ (mask_t m1, mask_t m2) {return (mask_t)((int)m1 ^ m2);} \ - FORCEINLINE mask_t& operator |= (mask_t& m1, mask_t m2) {m1 = m1 | m2; return m1;} \ - FORCEINLINE mask_t& operator &= (mask_t& m1, mask_t m2) {m1 = m1 & m2; return m1;} \ - FORCEINLINE mask_t& operator ^= (mask_t& m1, mask_t m2) {m1 = m1 ^ m2; return m1;} \ - FORCEINLINE mask_t operator ~(mask_t m) {return (mask_t)(~(int)m);} + inline mask_t operator | (mask_t m1, mask_t m2) {return (mask_t)((int)m1 | m2);} \ + inline mask_t operator & (mask_t m1, mask_t m2) {return (mask_t)((int)m1 & m2);} \ + inline mask_t operator ^ (mask_t m1, mask_t m2) {return (mask_t)((int)m1 ^ m2);} \ + inline mask_t& operator |= (mask_t& m1, mask_t m2) {m1 = m1 | m2; return m1;} \ + inline mask_t& operator &= (mask_t& m1, mask_t m2) {m1 = m1 & m2; return m1;} \ + inline mask_t& operator ^= (mask_t& m1, mask_t m2) {m1 = m1 ^ m2; return m1;} \ + inline mask_t operator ~(mask_t m) {return (mask_t)(~(int)m);} /** @@ -98,27 +98,27 @@ struct TinyEnumT { storage_type m_val; ///< here we hold the actual value in small (i.e. byte) form /** Cast operator - invoked then the value is assigned to the Tenum_t type */ - FORCEINLINE operator enum_type () const + inline operator enum_type () const { return (enum_type)m_val; } /** Assignment operator (from Tenum_t type) */ - FORCEINLINE TinyEnumT& operator = (enum_type e) + inline TinyEnumT& operator = (enum_type e) { m_val = (storage_type)e; return *this; } /** Assignment operator (from Tenum_t type) */ - FORCEINLINE TinyEnumT& operator = (uint u) + inline TinyEnumT& operator = (uint u) { m_val = (storage_type)u; return *this; } /** postfix ++ operator on tiny type */ - FORCEINLINE TinyEnumT operator ++ (int) + inline TinyEnumT operator ++ (int) { TinyEnumT org = *this; if (++m_val >= end) m_val -= (storage_type)(end - begin); @@ -126,7 +126,7 @@ struct TinyEnumT { } /** prefix ++ operator on tiny type */ - FORCEINLINE TinyEnumT& operator ++ () + inline TinyEnumT& operator ++ () { if (++m_val >= end) m_val -= (storage_type)(end - begin); return *this; @@ -140,34 +140,34 @@ struct SimpleTinyEnumT { storage_type m_val; ///< here we hold the actual value in small (i.e. byte) form /** Cast operator - invoked then the value is assigned to the storage_type */ - FORCEINLINE operator enum_type () const + inline operator enum_type () const { return (enum_type)this->m_val; } /** Assignment operator (from enum_type) */ - FORCEINLINE SimpleTinyEnumT &operator = (enum_type e) + inline SimpleTinyEnumT &operator = (enum_type e) { this->m_val = (storage_type)e; return *this; } /** Assignment operator (from general uint) */ - FORCEINLINE SimpleTinyEnumT &operator = (uint u) + inline SimpleTinyEnumT &operator = (uint u) { this->m_val = (storage_type)u; return *this; } /** Bit math (or) assignment operator (from enum_type) */ - FORCEINLINE SimpleTinyEnumT &operator |= (enum_type e) + inline SimpleTinyEnumT &operator |= (enum_type e) { this->m_val = (storage_type)((enum_type)this->m_val | e); return *this; } /** Bit math (and) assignment operator (from enum_type) */ - FORCEINLINE SimpleTinyEnumT &operator &= (enum_type e) + inline SimpleTinyEnumT &operator &= (enum_type e) { this->m_val = (storage_type)((enum_type)this->m_val & e); return *this; -- cgit v1.2.3-54-g00ecf