summaryrefslogtreecommitdiff
path: root/src/core/enum_type.hpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-20 17:57:56 +0000
committertruebrain <truebrain@openttd.org>2011-12-20 17:57:56 +0000
commit1c9bec19993417b1f3b240f2bdb0745aa26c0cb3 (patch)
treed09407cc962ee87ac1bbbbc60951cad74c6b1db7 /src/core/enum_type.hpp
parent7a38642a1c83531a65907ae784bc03a82d35132a (diff)
downloadopenttd-1c9bec19993417b1f3b240f2bdb0745aa26c0cb3.tar.xz
(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)
Diffstat (limited to 'src/core/enum_type.hpp')
-rw-r--r--src/core/enum_type.hpp38
1 files changed, 19 insertions, 19 deletions
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;