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/misc/array.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/misc/array.hpp') 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]; -- cgit v1.2.3-54-g00ecf