replace unsigned int with the platform independent uintptr_t to make it more 64bit portable, and work around for mac gcc 4.0.0 bug in assert

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@521 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
syntheticpp 2006-01-27 08:58:17 +00:00
parent b98b203765
commit 698214fb58

View file

@ -114,10 +114,10 @@ namespace Loki
{ {
public: public:
RefCounted() RefCounted()
: pCount_(static_cast<unsigned int*>( : pCount_(static_cast<uintptr_t*>(
SmallObject<>::operator new(sizeof(unsigned int)))) SmallObject<>::operator new(sizeof(uintptr_t))))
{ {
assert(pCount_); assert(pCount_!=0);
*pCount_ = 1; *pCount_ = 1;
} }
@ -141,7 +141,7 @@ namespace Loki
{ {
if (!--*pCount_) if (!--*pCount_)
{ {
SmallObject<>::operator delete(pCount_, sizeof(unsigned int)); SmallObject<>::operator delete(pCount_, sizeof(uintptr_t));
return true; return true;
} }
return false; return false;
@ -154,7 +154,7 @@ namespace Loki
private: private:
// Data // Data
unsigned int* pCount_; uintptr_t* pCount_;
}; };
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -1337,6 +1337,9 @@ namespace std
#endif // SMARTPTR_INC_ #endif // SMARTPTR_INC_
// $Log$ // $Log$
// Revision 1.12 2006/01/27 08:58:17 syntheticpp
// replace unsigned int with the platform independent uintptr_t to make it more 64bit portable, and work around for mac gcc 4.0.0 bug in assert
//
// Revision 1.11 2006/01/22 13:31:12 syntheticpp // Revision 1.11 2006/01/22 13:31:12 syntheticpp
// add additional template parameter for the changed threading classes // add additional template parameter for the changed threading classes
// //