Mercurial > hg > Applications > Grep
comparison c/regexParser/bitVector.cc @ 116:66c633575b53 pairPro
remove error and warning
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 24 Nov 2015 17:07:08 +0900 |
parents | ca30f8334741 |
children | 166136236891 |
comparison
equal
deleted
inserted
replaced
115:ca30f8334741 | 116:66c633575b53 |
---|---|
1 #include <stdio.h> | 1 #include <stdio.h> |
2 #include <stdlib.h> | 2 #include <stdlib.h> |
3 #include <string.h> | 3 #include <string.h> |
4 #include "bitVector.h" | 4 #include "bitVector.h" |
5 #include "regexParser.h" | |
6 | |
7 extern BitVectorListPtr allocateBitVectorList(); | 5 extern BitVectorListPtr allocateBitVectorList(); |
8 BitVectorListPtr createBitVector(NodePtr,BitVectorListPtr); | |
9 const BitVectorPtr allocateBitVector(); | 6 const BitVectorPtr allocateBitVector(); |
10 BitVectorPtr bitSet(int); | |
11 void bitPrint(BitVectorPtr); | |
12 | 7 |
13 int bitBlock = sizeof(unsigned long) * 8; | 8 int bitBlock = sizeof(unsigned long) * 8; |
14 | 9 |
15 BitVectorListPtr createBitVector(NodePtr n,BitVectorListPtr bvl) { | 10 BitVectorListPtr createBitVector(NodePtr n,BitVectorListPtr bvl) { |
16 BitVectorListPtr nextBvl = allocateBitVectorList(); | 11 BitVectorListPtr nextBvl = allocateBitVectorList(); |
41 | 36 |
42 BitVectorPtr bitSet(int bitSetPosition) { | 37 BitVectorPtr bitSet(int bitSetPosition) { |
43 | 38 |
44 BitVectorPtr bi = allocateBitVector(); | 39 BitVectorPtr bi = allocateBitVector(); |
45 | 40 |
46 bi->arrayNum = (bitSetPosition + bitBlock - 1) / bitBlock; | 41 bi->arrayNum = (bitSetPosition + bitBlock) / bitBlock; |
47 | 42 |
48 int arrayPosition = bitSetPosition / bitBlock; | 43 int arrayPosition = bitSetPosition / bitBlock; |
49 | 44 |
50 unsigned long tmp = 1 << (bitSetPosition % bitBlock); | 45 unsigned long tmp = 1 << (bitSetPosition % bitBlock); |
51 bi->bitContainer[arrayPosition] = bi->bitContainer[arrayPosition] | tmp; | 46 bi->bitContainer[arrayPosition] = bi->bitContainer[arrayPosition] | tmp; |