aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-11-24 11:36:31 +0000
committerMike Buland <eichlan@xagasoft.com>2006-11-24 11:36:31 +0000
commite1effceb2492aa930cb810866c8da437f57a86bb (patch)
treebc7d2e86f42030844ad3b90d69f907c855cccc14 /src
parente19acafd485a1c6a027bc967945d914fa5ed38b9 (diff)
downloadlibbu++-e1effceb2492aa930cb810866c8da437f57a86bb.tar.gz
libbu++-e1effceb2492aa930cb810866c8da437f57a86bb.tar.bz2
libbu++-e1effceb2492aa930cb810866c8da437f57a86bb.tar.xz
libbu++-e1effceb2492aa930cb810866c8da437f57a86bb.zip
Updates to the smart-pointer.
Diffstat (limited to 'src')
-rw-r--r--src/sptr.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sptr.h b/src/sptr.h
index c711a89..51e27b0 100644
--- a/src/sptr.h
+++ b/src/sptr.h
@@ -30,11 +30,11 @@ public:
30 pRefCnt( NULL ), 30 pRefCnt( NULL ),
31 pData( pSrc ) 31 pData( pSrc )
32 { 32 {
33 pRefCnt = new uint32_t; 33 pRefCnt = new int32_t;
34 (*pRefCnt) = 1; 34 (*pRefCnt) = 1;
35 } 35 }
36 36
37 uint32_t count() 37 int32_t count()
38 { 38 {
39 return *pRefCnt; 39 return *pRefCnt;
40 } 40 }
@@ -55,6 +55,8 @@ public:
55 pRefCnt = src.pRefCnt; 55 pRefCnt = src.pRefCnt;
56 pData = src.pData; 56 pData = src.pData;
57 (*pRefCnt) += 1; 57 (*pRefCnt) += 1;
58
59 return *this;
58 } 60 }
59 61
60 bool operator==( const SPtr<T> &src ) 62 bool operator==( const SPtr<T> &src )
@@ -78,7 +80,7 @@ private:
78 } 80 }
79 } 81 }
80 82
81 uint32_t *pRefCnt; 83 int32_t *pRefCnt;
82 T *pData; 84 T *pData;
83}; 85};
84 86