1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Fix harmless static-analyzer warnings.

FossilOrigin-Name: 32f33f356931242b59c01b5df7e180941231e3d9c91577ad33aa4a01e9d59092
This commit is contained in:
drh
2021-10-04 22:34:38 +00:00
parent d9403bc642
commit 7d4c94bc0f
15 changed files with 58 additions and 41 deletions

View File

@@ -3095,7 +3095,6 @@ static int lockBtree(BtShared *pBt){
MemPage *pPage1; /* Page 1 of the database file */
u32 nPage; /* Number of pages in the database */
u32 nPageFile = 0; /* Number of pages in the database file */
u32 nPageHeader; /* Number of pages in the database according to hdr */
assert( sqlite3_mutex_held(pBt->mutex) );
assert( pBt->pPage1==0 );
@@ -3107,7 +3106,7 @@ static int lockBtree(BtShared *pBt){
/* Do some checking to help insure the file we opened really is
** a valid database file.
*/
nPage = nPageHeader = get4byte(28+(u8*)pPage1->aData);
nPage = get4byte(28+(u8*)pPage1->aData);
sqlite3PagerPagecount(pBt->pPager, (int*)&nPageFile);
if( nPage==0 || memcmp(24+(u8*)pPage1->aData, 92+(u8*)pPage1->aData,4)!=0 ){
nPage = nPageFile;
@@ -7687,11 +7686,10 @@ static int balance_nonroot(
Pgno aPgno[NB+2]; /* Page numbers of new pages before shuffling */
Pgno aPgOrder[NB+2]; /* Copy of aPgno[] used for sorting pages */
u16 aPgFlags[NB+2]; /* flags field of new pages before shuffling */
CellArray b; /* Parsed information on cells being balanced */
CellArray b; /* Parsed information on cells being balanced */
memset(abDone, 0, sizeof(abDone));
b.nCell = 0;
b.apCell = 0;
memset(&b, 0, sizeof(b));
pBt = pParent->pBt;
assert( sqlite3_mutex_held(pBt->mutex) );
assert( sqlite3PagerIswriteable(pParent->pDbPage) );