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
This commit is contained in:
cls%seawood.org
2004-02-23 22:12:03 +00:00
parent 432dfd284d
commit cdd48524c2

View File

@@ -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;
}