1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Silence a harmless unitialised variable warning in btree.c. Ticket #2862. (CVS 4650)

FossilOrigin-Name: b51782ccac28598eec7adc9302fe7d1986bfdaf8
This commit is contained in:
danielk1977
2008-01-01 06:19:02 +00:00
parent 7c9aaa7058
commit 8ea1cfaa9a
3 changed files with 20 additions and 22 deletions

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.434 2007/12/21 04:47:26 danielk1977 Exp $
** $Id: btree.c,v 1.435 2008/01/01 06:19:02 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
@@ -5729,9 +5729,6 @@ int sqlite3BtreeDelete(BtCursor *pCur){
*/
BtCursor leafCur;
unsigned char *pNext;
int szNext; /* The compiler warning is wrong: szNext is always
** initialized before use. Adding an extra initialization
** to silence the compiler slows down the code. */
int notUsed;
unsigned char *tempCell = 0;
assert( !pPage->leafData );
@@ -5741,6 +5738,7 @@ int sqlite3BtreeDelete(BtCursor *pCur){
rc = sqlite3PagerWrite(leafCur.pPage->pDbPage);
}
if( rc==SQLITE_OK ){
int szNext;
TRACE(("DELETE: table=%d delete internal from %d replace from leaf %d\n",
pCur->pgnoRoot, pPage->pgno, leafCur.pPage->pgno));
dropCell(pPage, pCur->idx, cellSizePtr(pPage, pCell));
@@ -5751,17 +5749,17 @@ int sqlite3BtreeDelete(BtCursor *pCur){
if( tempCell==0 ){
rc = SQLITE_NOMEM;
}
}
if( rc==SQLITE_OK ){
rc = insertCell(pPage, pCur->idx, pNext-4, szNext+4, tempCell, 0);
}
if( rc==SQLITE_OK ){
put4byte(findOverflowCell(pPage, pCur->idx), pgnoChild);
rc = balance(pPage, 0);
}
if( rc==SQLITE_OK ){
dropCell(leafCur.pPage, leafCur.idx, szNext);
rc = balance(leafCur.pPage, 0);
if( rc==SQLITE_OK ){
rc = insertCell(pPage, pCur->idx, pNext-4, szNext+4, tempCell, 0);
}
if( rc==SQLITE_OK ){
put4byte(findOverflowCell(pPage, pCur->idx), pgnoChild);
rc = balance(pPage, 0);
}
if( rc==SQLITE_OK ){
dropCell(leafCur.pPage, leafCur.idx, szNext);
rc = balance(leafCur.pPage, 0);
}
}
sqlite3_free(tempCell);
sqlite3BtreeReleaseTempCursor(&leafCur);