diff options
author | Mike Buland <mike@xagasoft.com> | 2013-04-16 10:50:07 -0600 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2013-04-16 10:50:07 -0600 |
commit | 25989c6d3911b1d29a5866e668bff52537893afb (patch) | |
tree | dd07375016a8a3836605cf4e2d9eca829193693f /src/packedintarray.cpp | |
parent | 44542adf023315d60a8ffc4863f2b161b3c1eb90 (diff) | |
download | clic-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 '')
-rw-r--r-- | src/packedintarray.cpp | 13 |
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 | ||
99 | PackedIntArray::Unit PackedIntArray::set( int idx, PackedIntArray::Unit i ) | 99 | void 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 | ||
119 | void 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 | |||
119 | Bu::String PackedIntArray::toBitString() const | 130 | Bu::String PackedIntArray::toBitString() const |
120 | { | 131 | { |
121 | Bu::String sRet; | 132 | Bu::String sRet; |