From cdd48524c20de74f49207fab95e0b204a111a1b0 Mon Sep 17 00:00:00 2001 From: "cls%seawood.org" Date: Mon, 23 Feb 2004 22:12:03 +0000 Subject: [PATCH] Explicitly mark inlined functions with |inline| & drop NS_COM since we rely upon these functions being inlined. Works around mingw gcc bustage. Bug #226609 r=darin sr=dbaron git-svn-id: svn://10.0.0.236/trunk@153116 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsSegmentedBuffer.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mozilla/xpcom/io/nsSegmentedBuffer.h b/mozilla/xpcom/io/nsSegmentedBuffer.h index de1dcba6a1d..95323613f66 100644 --- a/mozilla/xpcom/io/nsSegmentedBuffer.h +++ b/mozilla/xpcom/io/nsSegmentedBuffer.h @@ -73,32 +73,32 @@ public: NS_COM void Empty(); // frees all segments - NS_COM PRUint32 GetSegmentCount() { + inline PRUint32 GetSegmentCount() { if (mFirstSegmentIndex <= mLastSegmentIndex) return mLastSegmentIndex - mFirstSegmentIndex; else return mSegmentArrayCount + mLastSegmentIndex - mFirstSegmentIndex; } - NS_COM PRUint32 GetSegmentSize() { return mSegmentSize; } - PRUint32 GetMaxSize() { return mMaxSize; } - PRUint32 GetSize() { return GetSegmentCount() * mSegmentSize; } + inline PRUint32 GetSegmentSize() { return mSegmentSize; } + inline PRUint32 GetMaxSize() { return mMaxSize; } + inline PRUint32 GetSize() { return GetSegmentCount() * mSegmentSize; } - NS_COM char* GetSegment(PRUint32 indx) { + inline char* GetSegment(PRUint32 indx) { NS_ASSERTION(indx < GetSegmentCount(), "index out of bounds"); PRInt32 i = ModSegArraySize(mFirstSegmentIndex + (PRInt32)indx); return mSegmentArray[i]; } protected: - PRInt32 ModSegArraySize(PRInt32 n) { + inline PRInt32 ModSegArraySize(PRInt32 n) { PRUint32 result = n & (mSegmentArrayCount - 1); NS_ASSERTION(result == n % mSegmentArrayCount, "non-power-of-2 mSegmentArrayCount"); return result; } - PRBool IsFull() { + inline PRBool IsFull() { return ModSegArraySize(mLastSegmentIndex + 1) == mFirstSegmentIndex; }