]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a compiler warning when SQLITE_DIRECT_OVERFLOW_READ is defined.
authordrh <drh@noemail.net>
Mon, 31 Mar 2014 23:57:41 +0000 (23:57 +0000)
committerdrh <drh@noemail.net>
Mon, 31 Mar 2014 23:57:41 +0000 (23:57 +0000)
Minor performance enhancement and size reduction.

FossilOrigin-Name: 96385dc460545807a5c8fcf6280a971700f84866

manifest
manifest.uuid
src/btree.c
src/btreeInt.h

index 1266012e4a48198c81386066e9695e8d5c746e06..a1eded678c7b91aa160d416e3b80b6473d952ff5 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Merge\sin\sthe\slatest\schanges\sand\sfixes\sfrom\strunk.
-D 2014-03-31T22:03:32.269
+C Fix\sa\scompiler\swarning\swhen\sSQLITE_DIRECT_OVERFLOW_READ\sis\sdefined.\nMinor\sperformance\senhancement\sand\ssize\sreduction.
+D 2014-03-31T23:57:41.627
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -164,9 +164,9 @@ F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
 F src/backup.c a729e63cf5cd1829507cb7b8e89f99b95141bb53
 F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb
 F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7
-F src/btree.c 33338d61b912b5219fc5b466db8e0d7385c0b18b
+F src/btree.c b1d6309d6623f4ea8d9466aebd1ec84adc40cb9b
 F src/btree.h d79306df4ed9181b48916737fe8871a4392c4594
-F src/btreeInt.h d1784d1e17d08d29e890190dbb9836fa64573381
+F src/btreeInt.h cf180d86b2e9e418f638d65baa425c4c69c0e0e3
 F src/build.c 0d50ef95aad63f4c4fc47f3fa2670d4557c45db0
 F src/callback.c 174e3c8656bc29f91d710ab61550d16eea34be98
 F src/complete.c dc1d136c0feee03c2f7550bafc0d29075e36deac
@@ -1159,7 +1159,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 d8e1f75ddf10f3c0b21acd5455f90fdcea54a948 b3296267fb67b9f59719a37093253062edde3746
-R 6014daa58aba2f75bf5f17a4d16cbf23
+P f6211540c9d66a08dc580dd733e4f4a98968ae30
+R a9646e8cad6830bc030ac01ef7720050
 U drh
-Z 6a8ee270f5925545ed8c5f82edf09850
+Z be4271c513a3efe06acb17f300ec9933
index 36c381c508f7539c62c46d84063d43932234ac5a..e03a98f749b86ddead3d9519a66a30e511ceb942 100644 (file)
@@ -1 +1 @@
-f6211540c9d66a08dc580dd733e4f4a98968ae30
\ No newline at end of file
+96385dc460545807a5c8fcf6280a971700f84866
\ No newline at end of file
index 9b50ebae4f49de2cfd769fd777cacd3b6672c705..cbb968ad8be6646e9dad6194203ee6204a69d357 100644 (file)
@@ -3633,7 +3633,8 @@ static int btreeCursor(
   pCur->pKeyInfo = pKeyInfo;
   pCur->pBtree = p;
   pCur->pBt = pBt;
-  pCur->curFlags = wrFlag ? BTCF_WriteFlag : 0;
+  assert( wrFlag==0 || wrFlag==BTCF_WriteFlag );
+  pCur->curFlags = wrFlag;
   pCur->pNext = pBt->pCursor;
   if( pCur->pNext ){
     pCur->pNext->pPrev = pCur;
@@ -3965,7 +3966,9 @@ static int accessPayload(
   int iIdx = 0;
   MemPage *pPage = pCur->apPage[pCur->iPage]; /* Btree page of current entry */
   BtShared *pBt = pCur->pBt;                  /* Btree this cursor belongs to */
-  int bEnd;                       /* True if reading to end of data */
+#ifdef SQLITE_DIRECT_OVERFLOW_READ
+  int bEnd;                                   /* True if reading to end of data */
+#endif
 
   assert( pPage );
   assert( pCur->eState==CURSOR_VALID );
@@ -3975,7 +3978,9 @@ static int accessPayload(
   getCellInfo(pCur);
   aPayload = pCur->info.pCell + pCur->info.nHeader;
   nKey = (pPage->intKey ? 0 : (int)pCur->info.nKey);
+#ifdef SQLITE_DIRECT_OVERFLOW_READ
   bEnd = (offset+amt==nKey+pCur->info.nData);
+#endif
 
   if( NEVER(offset+amt > nKey+pCur->info.nData) 
    || &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize]
index dff07f145ef45e7faa6bd95efce78140544faee8..d1cdd46983a9f1e4108f2e69469ec959aba8fb1f 100644 (file)
@@ -514,10 +514,10 @@ struct BtCursor {
 /*
 ** Legal values for BtCursor.curFlags
 */
-#define BTCF_ValidNKey    0x01   /* True if info.nKey is valid */
-#define BTCF_ValidOvfl    0x02   /* True if aOverflow is valid */
-#define BTCF_AtLast       0x04   /* Cursor is pointing ot the last entry */
-#define BTCF_WriteFlag    0x08   /* True if a write cursor */
+#define BTCF_WriteFlag    0x01   /* True if a write cursor */
+#define BTCF_ValidNKey    0x02   /* True if info.nKey is valid */
+#define BTCF_ValidOvfl    0x04   /* True if aOverflow is valid */
+#define BTCF_AtLast       0x08   /* Cursor is pointing ot the last entry */
 #define BTCF_Incrblob     0x10   /* True if an incremental I/O handle */
 
 /*