From: drh Date: Mon, 3 Mar 2014 18:25:24 +0000 (+0000) Subject: Fix compiler warnings. X-Git-Tag: version-3.8.4~34^2~2^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=295aedf097e947c5975cc1a79e16f779e7992f31;p=thirdparty%2Fsqlite.git Fix compiler warnings. FossilOrigin-Name: ba8993727e5752cbc92c7d78437e9e0510c899f7 --- diff --git a/manifest b/manifest index 15339f6098..d6d61e95b6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\slatest\strunk\schanges. -D 2014-03-03T17:48:03.279 +C Fix\scompiler\swarnings. +D 2014-03-03T18:25:24.475 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -278,10 +278,10 @@ F src/utf.c 6dc9ec9f1b3db43ae8ba0365377f11df1ee4c01c F src/util.c c46c90459ef9bdc0c6c73803cf4c55425b4771cf F src/vacuum.c 3728d74919d4fb1356f9e9a13e27773db60b7179 F src/vdbe.c 75c3f5d27ab79af214646cf37d7551bc8cec09c2 -F src/vdbe.h c6dc01f85cf3bdcc992d244aeff952c033fd5ad0 -F src/vdbeInt.h d55cab859abb2c6656911497ae74eba9dcf34e28 +F src/vdbe.h d189f92468a17a6f04daeec9df3b767f50557b21 +F src/vdbeInt.h 9ccca0bc7646c918d065943e44bead4bf5de213d F src/vdbeapi.c 5bc41aaea448a7fc250902c418f1795859be3820 -F src/vdbeaux.c e4a0f89d15097debae8117ba17e4a640a0d3116f +F src/vdbeaux.c f6d49b824fb9b4025098d73ba63a579bceab46c1 F src/vdbeblob.c d939997de046b8fcc607cfee4248f3d33dbcca50 F src/vdbemem.c 2d7918e4c80546d943414668b1485b2581f58a28 F src/vdbesort.c 46801acb342e5e4c07ba1777fe58880c143abb59 @@ -1153,7 +1153,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P d7f6837e6997a4d5c0fd2d08b52887d691dd6f97 c0fa0c0e2de50d7eda19ab8862496b18eff93538 -R 9a9d986bbf5df1b40c16a7d9f71c4a7c -U dan -Z 5c6a6f0f42fa42f03fa0c54709a35c4c +P 1d60356462f111ed147aa865dd17a13511db6ab7 +R 21f5b7d1de45908a8d9a08e2efe5ba51 +U drh +Z bf94921d4ecf2467a56de90bb29e8bf1 diff --git a/manifest.uuid b/manifest.uuid index a61bcd33e6..19e8b9d202 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1d60356462f111ed147aa865dd17a13511db6ab7 \ No newline at end of file +ba8993727e5752cbc92c7d78437e9e0510c899f7 \ No newline at end of file diff --git a/src/vdbe.h b/src/vdbe.h index 389c1d5ffb..66ca602ab7 100644 --- a/src/vdbe.h +++ b/src/vdbe.h @@ -211,10 +211,10 @@ void sqlite3VdbeSetVarmask(Vdbe*, int); #endif void sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,UnpackedRecord*); -int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*,int); +int sqlite3VdbeRecordCompare(int,const void*,const UnpackedRecord*,int); UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(KeyInfo *, char *, int, char **); -typedef int (*RecordCompare)(int,const void*,UnpackedRecord*,int); +typedef int (*RecordCompare)(int,const void*,const UnpackedRecord*,int); RecordCompare sqlite3VdbeFindCompare(UnpackedRecord*); #ifndef SQLITE_OMIT_TRIGGER diff --git a/src/vdbeInt.h b/src/vdbeInt.h index c16baff685..33c06142f6 100644 --- a/src/vdbeInt.h +++ b/src/vdbeInt.h @@ -391,7 +391,7 @@ u32 sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*); void sqlite3VdbeDeleteAuxData(Vdbe*, int, int); int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *); -int sqlite3VdbeIdxKeyCompare(VdbeCursor*,UnpackedRecord*,int*); +int sqlite3VdbeIdxKeyCompare(VdbeCursor*,const UnpackedRecord*,int*); int sqlite3VdbeIdxRowid(sqlite3*, BtCursor *, i64 *); int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); int sqlite3VdbeExec(Vdbe*); diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 10623ecbc0..0a2f11ab2b 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -3135,7 +3135,7 @@ void sqlite3VdbeRecordUnpack( */ static int vdbeRecordCompareDebug( int nKey1, const void *pKey1, /* Left key */ - UnpackedRecord *pPKey2 /* Right key */ + const UnpackedRecord *pPKey2 /* Right key */ ){ u32 d1; /* Offset into aKey[] of next data element */ u32 idx1; /* Offset into aKey[] of next header element */ @@ -3396,7 +3396,7 @@ static i64 vdbeRecordDecodeInt(u32 serial_type, const u8 *aKey){ */ int sqlite3VdbeRecordCompare( int nKey1, const void *pKey1, /* Left key */ - UnpackedRecord *const pPKey2, /* Right key */ + const UnpackedRecord *pPKey2, /* Right key */ int bSkip /* If true, skip the first field */ ){ u32 d1; /* Offset into aKey[] of next data element */ @@ -3474,7 +3474,7 @@ int sqlite3VdbeRecordCompare( if( serial_type==7 ){ lhs = mem1.r; }else{ - lhs = mem1.u.i; + lhs = (double)mem1.u.i; } if( lhs nKey1 ){ + if( (d1+mem1.n) > (unsigned)nKey1 ){ rc = 1; /* Corruption */ }else if( pKeyInfo->aColl[i] ){ mem1.enc = pKeyInfo->enc; @@ -3516,7 +3516,7 @@ int sqlite3VdbeRecordCompare( rc = -1; }else{ int nStr = (serial_type - 12) / 2; - if( (d1+nStr) > nKey1 ){ + if( (d1+nStr) > (unsigned)nKey1 ){ rc = 1; /* Corruption */ }else{ int nCmp = MIN(nStr, pRhs->n); @@ -3548,7 +3548,7 @@ int sqlite3VdbeRecordCompare( pRhs++; d1 += sqlite3VdbeSerialTypeLen(serial_type); idx1 += sqlite3VarintLen(serial_type); - }while( idx1nField && d1<=nKey1 ); + }while( idx1<(unsigned)szHdr1 && inField && d1<=(unsigned)nKey1 ); /* No memory allocation is ever used on mem1. Prove this using ** the following assert(). If the assert() fails, it indicates a @@ -3572,7 +3572,7 @@ int sqlite3VdbeRecordCompare( */ static int vdbeRecordCompareInt( int nKey1, const void *pKey1, /* Left key */ - UnpackedRecord *pPKey2, /* Right key */ + const UnpackedRecord *pPKey2, /* Right key */ int bSkip /* Ignored */ ){ const u8 *aKey = &((const u8*)pKey1)[*(const u8*)pKey1]; @@ -3580,6 +3580,7 @@ static int vdbeRecordCompareInt( int res; i64 v = pPKey2->aMem[0].u.i; i64 lhs; + UNUSED_PARAMETER(bSkip); assert( bSkip==0 ); @@ -3658,12 +3659,13 @@ static int vdbeRecordCompareInt( */ static int vdbeRecordCompareString( int nKey1, const void *pKey1, /* Left key */ - UnpackedRecord *pPKey2, /* Right key */ + const UnpackedRecord *pPKey2, /* Right key */ int bSkip ){ const u8 *aKey1 = (const u8*)pKey1; int serial_type; int res; + UNUSED_PARAMETER(bSkip); assert( bSkip==0 ); getVarint32(&aKey1[1], serial_type); @@ -3832,9 +3834,9 @@ idx_rowid_corruption: ** of the keys prior to the final rowid, not the entire key. */ int sqlite3VdbeIdxKeyCompare( - VdbeCursor *pC, /* The cursor to compare against */ - UnpackedRecord *pUnpacked, /* Unpacked version of key to compare against */ - int *res /* Write the comparison result here */ + VdbeCursor *pC, /* The cursor to compare against */ + const UnpackedRecord *pUnpacked, /* Unpacked version of key */ + int *res /* Write the comparison result here */ ){ i64 nCellKey = 0; int rc;