summaryrefslogtreecommitdiff
path: root/src/packedintarray.cpp
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2013-04-16 10:50:07 -0600
committerMike Buland <mike@xagasoft.com>2013-04-16 10:50:07 -0600
commit25989c6d3911b1d29a5866e668bff52537893afb (patch)
treedd07375016a8a3836605cf4e2d9eca829193693f /src/packedintarray.cpp
parent44542adf023315d60a8ffc4863f2b161b3c1eb90 (diff)
downloadclic-25989c6d3911b1d29a5866e668bff52537893afb.tar.gz
clic-25989c6d3911b1d29a5866e668bff52537893afb.tar.bz2
clic-25989c6d3911b1d29a5866e668bff52537893afb.tar.xz
clic-25989c6d3911b1d29a5866e668bff52537893afb.zip
Added operators: -, ==, !=, <, >, <=, >=
Still working on division, needed some other operators to make it work.
Diffstat (limited to 'src/packedintarray.cpp')
-rw-r--r--src/packedintarray.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/packedintarray.cpp b/src/packedintarray.cpp
index 7654356..7c54063 100644
--- a/src/packedintarray.cpp
+++ b/src/packedintarray.cpp
@@ -96,7 +96,7 @@ PackedIntArray::Unit PackedIntArray::get( int idx ) const
96 return ret; 96 return ret;
97} 97}
98 98
99PackedIntArray::Unit PackedIntArray::set( int idx, PackedIntArray::Unit i ) 99void PackedIntArray::set( int idx, PackedIntArray::Unit i )
100{ 100{
101 int iStore = idx*iBitWidth/StoreBits; 101 int iStore = idx*iBitWidth/StoreBits;
102 int iBit = (idx*iBitWidth)%StoreBits; 102 int iBit = (idx*iBitWidth)%StoreBits;
@@ -116,6 +116,17 @@ PackedIntArray::Unit PackedIntArray::set( int idx, PackedIntArray::Unit i )
116 } 116 }
117} 117}
118 118
119void PackedIntArray::set( const PackedIntArray &rSrc, int iStart, int iSize )
120{
121 iCount = iSize;
122 checkCapacity();
123
124 for( int j = 0; j < iSize; j++ )
125 {
126 set( j, rSrc.get( iStart+j ) );
127 }
128}
129
119Bu::String PackedIntArray::toBitString() const 130Bu::String PackedIntArray::toBitString() const
120{ 131{
121 Bu::String sRet; 132 Bu::String sRet;