Skip to content

Commit 8b6f8dd

Browse files
committed
Fixed compiler error on constants with LL suffix
1 parent a023c19 commit 8b6f8dd

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

sqlite3/readme.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,16 @@ sqlite3ext.h
6262
#define SQLITE_ENABLE_FTS3_PARENTHESIS 1
6363
#define SQLITE_ENABLE_RTREE 1
6464
#define SQLITE_USE_URI 1
65+
66+
4. If you get compile errors like C2059 'bad suffix on number' on older compilers, remove the LL suffix from constants.
67+
For example, change:
68+
69+
&& i >= -2251799813685248LL && i < 2251799813685248LL);
70+
71+
to:
72+
73+
&& i >= -2251799813685248 && i < 2251799813685248);
74+
75+
This currently happens on four lines in the source in sqlite3.c.
76+
(Visual Studio 6.0 uses a suffix of i64 or ui64 instead of LL or ULL).
77+

sqlite3/sqlite3.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32398,7 +32398,7 @@ SQLITE_PRIVATE int sqlite3GetUInt32(const char *z, u32 *pI){
3239832398
int i;
3239932399
for(i=0; sqlite3Isdigit(z[i]); i++){
3240032400
v = v*10 + z[i] - '0';
32401-
if( v>4294967296LL ){ *pI = 0; return 0; }
32401+
if( v>4294967296ui64 ){ *pI = 0; return 0; }
3240232402
}
3240332403
if( i==0 || z[i]!=0 ){ *pI = 0; return 0; }
3240432404
*pI = (u32)v;
@@ -77210,7 +77210,7 @@ SQLITE_PRIVATE int sqlite3RealSameAsInt(double r1, sqlite3_int64 i){
7721077210
double r2 = (double)i;
7721177211
return r1==0.0
7721277212
|| (memcmp(&r1, &r2, sizeof(r1))==0
77213-
&& i >= -2251799813685248LL && i < 2251799813685248LL);
77213+
&& i >= -2251799813685248 && i < 2251799813685248);
7721477214
}
7721577215

7721677216
/*
@@ -88874,7 +88874,7 @@ case OP_Affinity: {
8887488874
testcase( pIn1->u.i==140737488355327LL );
8887588875
testcase( pIn1->u.i==-140737488355328LL );
8887688876
testcase( pIn1->u.i==-140737488355329LL );
88877-
if( pIn1->u.i<=140737488355327LL && pIn1->u.i>=-140737488355328LL ){
88877+
if( pIn1->u.i<=140737488355327 && pIn1->u.i>=-140737488355328 ){
8887888878
pIn1->flags |= MEM_IntReal;
8887988879
pIn1->flags &= ~MEM_Int;
8888088880
}else{
@@ -89076,7 +89076,7 @@ case OP_MakeRecord: {
8907689076
}else if( uu<=2147483647 ){
8907789077
nData += 4;
8907889078
pRec->uTemp = 4;
89079-
}else if( uu<=140737488355327LL ){
89079+
}else if( uu<=140737488355327 ){
8908089080
nData += 6;
8908189081
pRec->uTemp = 5;
8908289082
}else{

0 commit comments

Comments
 (0)