aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/expr.c2
-rw-r--r--src/func.c2
-rw-r--r--src/printf.c2
-rw-r--r--src/update.c2
-rw-r--r--src/util.c4
-rw-r--r--src/vdbe.c2
-rw-r--r--src/vdbeaux.c8
7 files changed, 14 insertions, 8 deletions
diff --git a/src/expr.c b/src/expr.c
index b7b73946c..57243c74e 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1964,7 +1964,7 @@ static void codeInteger(Parse *pParse, Expr *pExpr, int negFlag, int iMem){
c = sqlite3Atoi64(z, &value, sqlite3Strlen30(z), SQLITE_UTF8);
if( c==0 || (c==2 && negFlag) ){
char *zV;
- if( negFlag ){ value = -value; }
+ if( negFlag ){ value = -value; } /* CLANG */
zV = dup8bytes(v, (char*)&value);
sqlite3VdbeAddOp4(v, OP_Int64, 0, iMem, 0, zV, P4_INT64);
}else{
diff --git a/src/func.c b/src/func.c
index 19c6d2251..2f21ac0e3 100644
--- a/src/func.c
+++ b/src/func.c
@@ -1240,7 +1240,7 @@ static void sumStep(sqlite3_context *context, int argc, sqlite3_value **argv){
i64 v = sqlite3_value_int64(argv[0]);
p->rSum += v;
if( (p->approx|p->overflow)==0 ){
- i64 iNewSum = p->iSum + v;
+ i64 iNewSum = p->iSum + v; /* CLANG */
int s1 = (int)(p->iSum >> (sizeof(i64)*8-1));
int s2 = (int)(v >> (sizeof(i64)*8-1));
int s3 = (int)(iNewSum >> (sizeof(i64)*8-1));
diff --git a/src/printf.c b/src/printf.c
index c88bb3000..21b6c0e11 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -400,7 +400,7 @@ void sqlite3VXPrintf(
v = va_arg(ap,int);
}
if( v<0 ){
- longvalue = -v;
+ longvalue = -v; /* CLANG */
prefix = '-';
}else{
longvalue = v;
diff --git a/src/update.c b/src/update.c
index 8bf58d766..045b4d176 100644
--- a/src/update.c
+++ b/src/update.c
@@ -396,7 +396,7 @@ void sqlite3Update(
pTrigger, pChanges, 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, onError
);
for(i=0; i<pTab->nCol; i++){
- if( aXRef[i]<0 || oldmask==0xffffffff || (oldmask & (1<<i)) ){
+ if( aXRef[i]<0 || oldmask==0xffffffff || (i<32 && (oldmask & (1<<i))) ){
sqlite3ExprCodeGetColumnOfTable(v, pTab, iCur, i, regOld+i);
}else{
sqlite3VdbeAddOp2(v, OP_Null, 0, regOld+i);
diff --git a/src/util.c b/src/util.c
index dfa127be0..ca22749fa 100644
--- a/src/util.c
+++ b/src/util.c
@@ -475,9 +475,9 @@ do_atoi_calc:
zStart = zNum;
while( zNum<zEnd && zNum[0]=='0' ){ zNum+=incr; } /* Skip leading zeros. */
for(i=0; &zNum[i]<zEnd && (c=zNum[i])>='0' && c<='9'; i+=incr){
- v = v*10 + c - '0';
+ v = v*10 + c - '0'; /* CLANG */
}
- *pNum = neg ? -v : v;
+ *pNum = neg ? -v : v; /* CLANG */
testcase( i==18 );
testcase( i==19 );
testcase( i==20 );
diff --git a/src/vdbe.c b/src/vdbe.c
index 00ed1438b..3a7397687 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -1246,7 +1246,7 @@ case OP_Remainder: { /* same as TK_REM, in1, in2, out3 */
iA = pIn1->u.i;
iB = pIn2->u.i;
switch( pOp->opcode ){
- case OP_Add: iB += iA; break;
+ case OP_Add: iB += iA; break; /* CLANG */
case OP_Subtract: iB -= iA; break;
case OP_Multiply: iB *= iA; break;
case OP_Divide: {
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index 64ff48991..4a1b1efbb 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -2497,7 +2497,13 @@ u32 sqlite3VdbeSerialType(Mem *pMem, int file_format){
if( file_format>=4 && (i&1)==i ){
return 8+(u32)i;
}
- u = i<0 ? -i : i;
+ if( i<0 ){
+ if( i<(-MAX_6BYTE) ) return 6;
+ /* Previous test prevents: u = -(-9223372036854775808) */
+ u = -i;
+ }else{
+ u = i;
+ }
if( u<=127 ) return 1;
if( u<=32767 ) return 2;
if( u<=8388607 ) return 3;