summaryrefslogtreecommitdiff
path: root/src/misc/array.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/misc/array.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/misc/array.hpp')
-rw-r--r--src/misc/array.hpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/misc/array.hpp b/src/misc/array.hpp
index 5eae3e488..a3f243e10 100644
--- a/src/misc/array.hpp
+++ b/src/misc/array.hpp
@@ -30,7 +30,7 @@ protected:
SuperArray data; ///< array of arrays of items
/** return first sub-array with free space for new item */
- FORCEINLINE SubArray& FirstFreeSubArray()
+ inline SubArray& FirstFreeSubArray()
{
uint super_size = data.Length();
if (super_size > 0) {
@@ -42,11 +42,11 @@ protected:
public:
/** implicit constructor */
- FORCEINLINE SmallArray() { }
+ inline SmallArray() { }
/** Clear (destroy) all items */
- FORCEINLINE void Clear() {data.Clear();}
+ inline void Clear() {data.Clear();}
/** Return actual number of items */
- FORCEINLINE uint Length() const
+ inline uint Length() const
{
uint super_size = data.Length();
if (super_size == 0) return 0;
@@ -54,22 +54,22 @@ public:
return (super_size - 1) * B + sub_size;
}
/** return true if array is empty */
- FORCEINLINE bool IsEmpty() { return data.IsEmpty(); }
+ inline bool IsEmpty() { return data.IsEmpty(); }
/** return true if array is full */
- FORCEINLINE bool IsFull() { return data.IsFull() && data[N - 1].IsFull(); }
+ inline bool IsFull() { return data.IsFull() && data[N - 1].IsFull(); }
/** allocate but not construct new item */
- FORCEINLINE T *Append() { return FirstFreeSubArray().Append(); }
+ inline T *Append() { return FirstFreeSubArray().Append(); }
/** allocate and construct new item */
- FORCEINLINE T *AppendC() { return FirstFreeSubArray().AppendC(); }
+ inline T *AppendC() { return FirstFreeSubArray().AppendC(); }
/** indexed access (non-const) */
- FORCEINLINE T& operator [] (uint index)
+ inline T& operator [] (uint index)
{
const SubArray& s = data[index / B];
T& item = s[index % B];
return item;
}
/** indexed access (const) */
- FORCEINLINE const T& operator [] (uint index) const
+ inline const T& operator [] (uint index) const
{
const SubArray& s = data[index / B];
const T& item = s[index % B];