Bug 209622 - bustage fix for stupid compilers (Sun WS and DEC OSF1) -

also remove unused configure test. r=dbaron sr=alecf
This commit is contained in:
bsmedberg%covad.net 2005-08-11 19:43:16 +00:00
Родитель 496e526f01
Коммит a6e421cd5a
3 изменённых файлов: 30 добавлений и 48 удалений

Просмотреть файл

@ -104,7 +104,7 @@ public:
* This function is especially useful for static hashtables.
* @return PR_TRUE if the table has been initialized.
*/
PRBool IsInitialized() const { return mTable.entrySize; }
PRBool IsInitialized() const { return this->mTable.entrySize; }
/**
* Return the number of entries in the table.
@ -186,7 +186,7 @@ public:
"nsBaseHashtable was not initialized properly.");
s_EnumReadArgs enumData = { enumFunc, userArg };
return PL_DHashTableEnumerate(NS_CONST_CAST(PLDHashTable*, &mTable),
return PL_DHashTableEnumerate(NS_CONST_CAST(PLDHashTable*, &this->mTable),
s_EnumReadStub,
&enumData);
}
@ -219,7 +219,7 @@ public:
"nsBaseHashtable was not initialized properly.");
s_EnumArgs enumData = { enumFunc, userArg };
return PL_DHashTableEnumerate(&mTable,
return PL_DHashTableEnumerate(&this->mTable,
s_EnumStub,
&enumData);
}
@ -230,10 +230,6 @@ public:
void Clear() { nsTHashtable<EntryType>::Clear(); }
protected:
#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
using nsTHashtable<nsBaseHashtableET<KeyClass,DataType> >::mTable;
#endif
/**
* used internally during EnumerateRead. Allocated on the stack.
* @param func the enumerator passed to EnumerateRead
@ -294,10 +290,6 @@ public:
void Clear();
protected:
#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
using nsTHashtable<EntryType>::mTable;
#endif
PRLock* mLock;
};
@ -365,8 +357,8 @@ nsBaseHashtable<KeyClass,DataType,UserDataType>::s_EnumStub
template<class KeyClass,class DataType,class UserDataType>
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::~nsBaseHashtableMT()
{
if (mLock)
PR_DestroyLock(mLock);
if (this->mLock)
PR_DestroyLock(this->mLock);
}
template<class KeyClass,class DataType,class UserDataType>
@ -376,19 +368,19 @@ nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Init(PRUint32 initSize)
if (!nsTHashtable<EntryType>::IsInitialized() && !nsTHashtable<EntryType>::Init(initSize))
return PR_FALSE;
mLock = PR_NewLock();
NS_WARN_IF_FALSE(mLock, "Error creating lock during nsBaseHashtableL::Init()");
this->mLock = PR_NewLock();
NS_WARN_IF_FALSE(this->mLock, "Error creating lock during nsBaseHashtableL::Init()");
return (mLock != nsnull);
return (this->mLock != nsnull);
}
template<class KeyClass,class DataType,class UserDataType>
PRUint32
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Count() const
{
PR_Lock(mLock);
PR_Lock(this->mLock);
PRUint32 count = nsTHashtable<EntryType>::Count();
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return count;
}
@ -398,10 +390,10 @@ PRBool
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Get(KeyType aKey,
UserDataType* pData) const
{
PR_Lock(mLock);
PR_Lock(this->mLock);
PRBool res =
nsBaseHashtable<KeyClass,DataType,UserDataType>::Get(aKey, pData);
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return res;
}
@ -411,10 +403,10 @@ PRBool
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Put(KeyType aKey,
UserDataType aData)
{
PR_Lock(mLock);
PR_Lock(this->mLock);
PRBool res =
nsBaseHashtable<KeyClass,DataType,UserDataType>::Put(aKey, aData);
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return res;
}
@ -423,9 +415,9 @@ template<class KeyClass,class DataType,class UserDataType>
void
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Remove(KeyType aKey)
{
PR_Lock(mLock);
PR_Lock(this->mLock);
nsBaseHashtable<KeyClass,DataType,UserDataType>::Remove(aKey);
PR_Unlock(mLock);
PR_Unlock(this->mLock);
}
template<class KeyClass,class DataType,class UserDataType>
@ -433,10 +425,10 @@ PRUint32
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::EnumerateRead
(EnumReadFunction fEnumCall, void* userArg) const
{
PR_Lock(mLock);
PR_Lock(this->mLock);
PRUint32 count =
nsBaseHashtable<KeyClass,DataType,UserDataType>::EnumerateRead(fEnumCall, userArg);
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return count;
}
@ -446,10 +438,10 @@ PRUint32
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Enumerate
(EnumFunction fEnumCall, void* userArg)
{
PR_Lock(mLock);
PR_Lock(this->mLock);
PRUint32 count =
nsBaseHashtable<KeyClass,DataType,UserDataType>::Enumerate(fEnumCall, userArg);
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return count;
}
@ -458,9 +450,9 @@ template<class KeyClass,class DataType,class UserDataType>
void
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Clear()
{
PR_Lock(mLock);
PR_Lock(this->mLock);
nsBaseHashtable<KeyClass,DataType,UserDataType>::Clear();
PR_Unlock(mLock);
PR_Unlock(this->mLock);
}
#endif // nsBaseHashtable_h__

Просмотреть файл

@ -86,11 +86,6 @@ public:
* @param pData if the key doesn't exist, pData will be set to nsnull.
*/
PRBool Get(KeyType aKey, UserDataType* pData) const;
protected:
#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
using nsBaseHashtableMT<KeyClass, nsAutoPtr<T>, T*>::mLock;
#endif
};
@ -117,7 +112,7 @@ nsClassHashtable<KeyClass,T>::Get(KeyType aKey, T** retVal) const
*retVal = nsnull;
return PR_FALSE;
};
}
//
@ -128,7 +123,7 @@ template<class KeyClass,class T>
PRBool
nsClassHashtableMT<KeyClass,T>::Get(KeyType aKey, T** retVal) const
{
PR_Lock(mLock);
PR_Lock(this->mLock);
typename nsBaseHashtableMT<KeyClass,nsAutoPtr<T>,T*>::EntryType* ent =
GetEntry(aKey);
@ -138,7 +133,7 @@ nsClassHashtableMT<KeyClass,T>::Get(KeyType aKey, T** retVal) const
if (retVal)
*retVal = ent->mData;
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return PR_TRUE;
}
@ -146,9 +141,9 @@ nsClassHashtableMT<KeyClass,T>::Get(KeyType aKey, T** retVal) const
if (retVal)
*retVal = nsnull;
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return PR_FALSE;
};
}
#endif // nsClassHashtable_h__

Просмотреть файл

@ -86,11 +86,6 @@ public:
* If the key doesn't exist, pData will be set to nsnull.
*/
PRBool Get(KeyType aKey, UserDataType* pData) const;
protected:
#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
using nsBaseHashtableMT<KeyClass, nsCOMPtr<Interface>, Interface*>::mLock;
#endif
};
@ -136,7 +131,7 @@ PRBool
nsInterfaceHashtableMT<KeyClass,Interface>::Get
(KeyType aKey, UserDataType* pInterface) const
{
PR_Lock(mLock);
PR_Lock(this->mLock);
typename nsBaseHashtableMT<KeyClass, nsCOMPtr<Interface>, Interface*>::EntryType* ent =
GetEntry(aKey);
@ -150,7 +145,7 @@ nsInterfaceHashtableMT<KeyClass,Interface>::Get
NS_IF_ADDREF(*pInterface);
}
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return PR_TRUE;
}
@ -160,7 +155,7 @@ nsInterfaceHashtableMT<KeyClass,Interface>::Get
if (pInterface)
*pInterface = nsnull;
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return PR_FALSE;
}