| Index: third_party/sqlite/sqlite-src-3100200/src/bitvec.c
|
| diff --git a/third_party/sqlite/src/src/bitvec.c b/third_party/sqlite/sqlite-src-3100200/src/bitvec.c
|
| similarity index 97%
|
| copy from third_party/sqlite/src/src/bitvec.c
|
| copy to third_party/sqlite/sqlite-src-3100200/src/bitvec.c
|
| index 52184aa964ce1898f35d1b3d87871c2d0ef4c53d..f7f544cff75961dfbf489d96dace5e0b32d81da9 100644
|
| --- a/third_party/sqlite/src/src/bitvec.c
|
| +++ b/third_party/sqlite/sqlite-src-3100200/src/bitvec.c
|
| @@ -41,7 +41,8 @@
|
|
|
| /* Round the union size down to the nearest pointer boundary, since that's how
|
| ** it will be aligned within the Bitvec struct. */
|
| -#define BITVEC_USIZE (((BITVEC_SZ-(3*sizeof(u32)))/sizeof(Bitvec*))*sizeof(Bitvec*))
|
| +#define BITVEC_USIZE \
|
| + (((BITVEC_SZ-(3*sizeof(u32)))/sizeof(Bitvec*))*sizeof(Bitvec*))
|
|
|
| /* Type of the array "element" for the bitmap representation.
|
| ** Should be a power of 2, and ideally, evenly divide into BITVEC_USIZE.
|
| @@ -126,10 +127,10 @@ Bitvec *sqlite3BitvecCreate(u32 iSize){
|
| ** If p is NULL (if the bitmap has not been created) or if
|
| ** i is out of range, then return false.
|
| */
|
| -int sqlite3BitvecTest(Bitvec *p, u32 i){
|
| - if( p==0 ) return 0;
|
| - if( i>p->iSize || i==0 ) return 0;
|
| +int sqlite3BitvecTestNotNull(Bitvec *p, u32 i){
|
| + assert( p!=0 );
|
| i--;
|
| + if( i>=p->iSize ) return 0;
|
| while( p->iDivisor ){
|
| u32 bin = i/p->iDivisor;
|
| i = i%p->iDivisor;
|
| @@ -149,6 +150,9 @@ int sqlite3BitvecTest(Bitvec *p, u32 i){
|
| return 0;
|
| }
|
| }
|
| +int sqlite3BitvecTest(Bitvec *p, u32 i){
|
| + return p!=0 && sqlite3BitvecTestNotNull(p,i);
|
| +}
|
|
|
| /*
|
| ** Set the i-th bit. Return 0 on success and an error code if
|
| @@ -341,7 +345,7 @@ int sqlite3BitvecBuiltinTest(int sz, int *aOp){
|
| ** bits to act as the reference */
|
| pBitvec = sqlite3BitvecCreate( sz );
|
| pV = sqlite3MallocZero( (sz+7)/8 + 1 );
|
| - pTmpSpace = sqlite3_malloc(BITVEC_SZ);
|
| + pTmpSpace = sqlite3_malloc64(BITVEC_SZ);
|
| if( pBitvec==0 || pV==0 || pTmpSpace==0 ) goto bitvec_end;
|
|
|
| /* NULL pBitvec tests */
|
|
|