1 --- src/shared/unicode/BitArray.cpp.orig 2007-07-23 01:07:44.000000000 -0400
2 +++ src/shared/unicode/BitArray.cpp 2007-07-23 01:08:30.000000000 -0400
4 if (size % 8 == 0 && size/8%4 == 0) this->size--;
7 - if (array && int(array) != 1) delete[] array;
8 + if (array && long(array) != 1) delete[] array;
10 void BitArray::createArray(bool set){
11 array = new int[size];
14 void BitArray::setBit(int pos){
15 if (!array) createArray();
16 - if (int(array) == 1) return;
17 + if (long(array) == 1) return;
18 array[pos>>5] |= 1 << (pos&0x1f);
20 void BitArray::clearBit(int pos){
22 - if (int(array) == 1) createArray(true);
23 + if (long(array) == 1) createArray(true);
24 array[pos>>5] &= ~(1 << (pos&0x1f));
26 void BitArray::addRange(int s, int e){
27 - if (int(array) == 1) return;
28 + if (long(array) == 1) return;
29 if (!array) createArray();
34 void BitArray::clearRange(int s, int e){
36 - if (int(array) == 1) createArray(true);
37 + if (long(array) == 1) createArray(true);
40 int fillbytes = 0xFFFFFFFF << (s&0x1f);
44 void BitArray::addBitArray(BitArray* ba){
45 - if (int(array) == 1) return;
46 + if (long(array) == 1) return;
47 if (!ba || !ba->array) return;
48 - if (int(ba->array) == 1){
49 + if (long(ba->array) == 1){
54 void BitArray::clearBitArray(BitArray* ba){
55 if (array == null) return;
56 if (ba == null || ba->array == null) return;
57 - if (int(array) == 1) createArray(true);
58 - if (int(ba->array) == 1){
59 + if (long(array) == 1) createArray(true);
60 + if (long(ba->array) == 1){
61 if (array != null) delete[] array;
68 - if (int(ba->array) == 1) return;
69 - if (int(array) == 1) createArray(true);
70 + if (long(ba->array) == 1) return;
71 + if (long(array) == 1) createArray(true);
72 for(int i = 0; i < size; i++)
73 array[i] &= ba->array[i];
77 void BitArray::addBitArray(char *bits, int size){
78 - if (int(array) == 1) return;
79 + if (long(array) == 1) return;
80 if (!array) createArray();
81 for(int i = 0; i < size && i < this->size*4;i++)
82 ((char*)array)[i] |= bits[i];
84 void BitArray::clearBitArray(char *bits, int size){
86 - if (int(array) == 1) createArray(true);
87 + if (long(array) == 1) createArray(true);
88 for(int i = 0; i < size && i < this->size*4;i++)
89 ((char*)array)[i] &= ~bits[i];
92 bool BitArray::getBit(int pos){
93 if (!array) return false;
94 - if (int(array) == 1) return true;
95 + if (long(array) == 1) return true;
96 return (array[pos>>5] & (1<<(pos&0x1f))) != 0;