aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2011-03-06 21:28:32 +0000
committerdrh <drh@noemail.net>2011-03-06 21:28:32 +0000
commitc126e63e4fda95f47ffe1cb294b5417c7a46c223 (patch)
tree65b7a94b2892db277a1111c79ae476b444767043 /src
parentd7255a207eab440617f4603b016350f075a9bf8b (diff)
downloadsqlite-c126e63e4fda95f47ffe1cb294b5417c7a46c223.tar.gz
sqlite-c126e63e4fda95f47ffe1cb294b5417c7a46c223.zip
Remove dead code identified by the clang static analyzer.
FossilOrigin-Name: 01a79d5a7af48fb7e50291c0c7c6283d3fb359d0
Diffstat (limited to 'src')
-rw-r--r--src/btree.c2
-rw-r--r--src/fkey.c2
-rw-r--r--src/insert.c4
-rw-r--r--src/prepare.c2
-rw-r--r--src/trigger.c1
-rw-r--r--src/update.c2
-rw-r--r--src/vdbe.c2
-rw-r--r--src/vdbeapi.c2
-rw-r--r--src/wal.c1
-rw-r--r--src/where.c6
10 files changed, 2 insertions, 22 deletions
diff --git a/src/btree.c b/src/btree.c
index f5960da38..fa0889adb 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -6179,9 +6179,7 @@ static int balance_nonroot(
}
}
if( minI>i ){
- int t;
MemPage *pT;
- t = apNew[i]->pgno;
pT = apNew[i];
apNew[i] = apNew[minI];
apNew[minI] = pT;
diff --git a/src/fkey.c b/src/fkey.c
index a385b814e..653cc1833 100644
--- a/src/fkey.c
+++ b/src/fkey.c
@@ -687,7 +687,6 @@ void sqlite3FkCheck(
int regNew /* New row data is stored here */
){
sqlite3 *db = pParse->db; /* Database handle */
- Vdbe *v; /* VM to write code to */
FKey *pFKey; /* Used to iterate through FKs */
int iDb; /* Index of database containing pTab */
const char *zDb; /* Name of database containing pTab */
@@ -699,7 +698,6 @@ void sqlite3FkCheck(
/* If foreign-keys are disabled, this function is a no-op. */
if( (db->flags&SQLITE_ForeignKeys)==0 ) return;
- v = sqlite3GetVdbe(pParse);
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
zDb = db->aDb[iDb].zName;
diff --git a/src/insert.c b/src/insert.c
index adf6ef2ed..851f778d4 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -465,7 +465,6 @@ void sqlite3Insert(
int regIns; /* Block of regs holding rowid+data being inserted */
int regRowid; /* registers holding insert rowid */
int regData; /* register holding first column to insert */
- int regRecord; /* Holds the assemblied row record */
int regEof = 0; /* Register recording end of SELECT data */
int *aRegIdx = 0; /* One register allocated to each index */
@@ -794,7 +793,6 @@ void sqlite3Insert(
/* Allocate registers for holding the rowid of the new row,
** the content of the new row, and the assemblied row record.
*/
- regRecord = ++pParse->nMem;
regRowid = regIns = pParse->nMem+1;
pParse->nMem += pTab->nCol + 1;
if( IsVirtual(pTab) ){
@@ -1188,7 +1186,7 @@ void sqlite3GenerateConstraintChecks(
case OE_Rollback:
case OE_Fail: {
char *zMsg;
- j1 = sqlite3VdbeAddOp3(v, OP_HaltIfNull,
+ sqlite3VdbeAddOp3(v, OP_HaltIfNull,
SQLITE_CONSTRAINT, onError, regData+i);
zMsg = sqlite3MPrintf(pParse->db, "%s.%s may not be NULL",
pTab->zName, pTab->aCol[i].zName);
diff --git a/src/prepare.c b/src/prepare.c
index 62a33b671..d778b8ba9 100644
--- a/src/prepare.c
+++ b/src/prepare.c
@@ -141,7 +141,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
int meta[5];
InitData initData;
char const *zMasterSchema;
- char const *zMasterName = SCHEMA_TABLE(iDb);
+ char const *zMasterName;
int openedTransaction = 0;
/*
diff --git a/src/trigger.c b/src/trigger.c
index b1d43d06d..ba8d47bcc 100644
--- a/src/trigger.c
+++ b/src/trigger.c
@@ -262,7 +262,6 @@ void sqlite3FinishTrigger(
int iDb; /* Database containing the trigger */
Token nameToken; /* Trigger name for error reporting */
- pTrig = pParse->pNewTrigger;
pParse->pNewTrigger = 0;
if( NEVER(pParse->nErr) || !pTrig ) goto triggerfinish_cleanup;
zName = pTrig->zName;
diff --git a/src/update.c b/src/update.c
index 045b4d176..315034d86 100644
--- a/src/update.c
+++ b/src/update.c
@@ -128,7 +128,6 @@ void sqlite3Update(
int regNew;
int regOld = 0;
int regRowSet = 0; /* Rowset of rows to be updated */
- int regRec; /* Register used for new table record to insert */
memset(&sContext, 0, sizeof(sContext));
db = pParse->db;
@@ -286,7 +285,6 @@ void sqlite3Update(
}
regNew = pParse->nMem + 1;
pParse->nMem += pTab->nCol;
- regRec = ++pParse->nMem;
/* Start the view context. */
if( isView ){
diff --git a/src/vdbe.c b/src/vdbe.c
index 823688e79..828baa529 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -2429,7 +2429,6 @@ case OP_MakeRecord: {
*/
nData = 0; /* Number of bytes of data space */
nHdr = 0; /* Number of bytes of header space */
- nByte = 0; /* Data space required for this record */
nZero = 0; /* Number of zero bytes at the end of the record */
nField = pOp->p1;
zAffinity = pOp->p4.z;
@@ -3703,7 +3702,6 @@ case OP_NewRowid: { /* out2-prerelease */
** and try again, up to 100 times.
*/
assert( pC->isTable );
- cnt = 0;
#ifdef SQLITE_32BIT_ROWID
# define MAX_ROWID 0x7fffffff
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index 5578b868e..76cd9215a 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -682,13 +682,11 @@ int sqlite3_data_count(sqlite3_stmt *pStmt){
*/
static Mem *columnMem(sqlite3_stmt *pStmt, int i){
Vdbe *pVm;
- int vals;
Mem *pOut;
pVm = (Vdbe *)pStmt;
if( pVm && pVm->pResultSet!=0 && i<pVm->nResColumn && i>=0 ){
sqlite3_mutex_enter(pVm->db->mutex);
- vals = sqlite3_data_count(pStmt);
pOut = &pVm->pResultSet[i];
}else{
/* If the value passed as the second argument is out of range, return
diff --git a/src/wal.c b/src/wal.c
index 9f7545b61..51ea18fb2 100644
--- a/src/wal.c
+++ b/src/wal.c
@@ -1649,7 +1649,6 @@ static int walCheckpoint(
}
assert( pIter );
- mxPage = pWal->hdr.nPage;
if( eMode!=SQLITE_CHECKPOINT_PASSIVE ) xBusy = xBusyCall;
/* Compute in mxSafeFrame the index of the last frame of the WAL that is
diff --git a/src/where.c b/src/where.c
index 727abdf3f..72529dde8 100644
--- a/src/where.c
+++ b/src/where.c
@@ -4047,7 +4047,6 @@ static Bitmask codeOneLoopStart(
**
*/
WhereClause *pOrWc; /* The OR-clause broken out into subterms */
- WhereTerm *pFinal; /* Final subterm within the OR-clause. */
SrcList *pOrTab; /* Shortened table list or OR-clause generation */
int regReturn = ++pParse->nMem; /* Register used with OP_Gosub */
@@ -4063,7 +4062,6 @@ static Bitmask codeOneLoopStart(
assert( pTerm->eOperator==WO_OR );
assert( (pTerm->wtFlags & TERM_ORINFO)!=0 );
pOrWc = &pTerm->u.pOrInfo->wc;
- pFinal = &pOrWc->a[pOrWc->nTerm-1];
pLevel->op = OP_Return;
pLevel->p1 = regReturn;
@@ -4172,7 +4170,6 @@ static Bitmask codeOneLoopStart(
** the use of indices become tests that are evaluated against each row of
** the relevant input tables.
*/
- k = 0;
for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){
Expr *pE;
testcase( pTerm->wtFlags & TERM_VIRTUAL ); /* IMP: R-30575-11662 */
@@ -4190,7 +4187,6 @@ static Bitmask codeOneLoopStart(
continue;
}
sqlite3ExprIfFalse(pParse, pE, addrCont, SQLITE_JUMPIFNULL);
- k = 1;
pTerm->wtFlags |= TERM_CODED;
}
@@ -4498,8 +4494,6 @@ WhereInfo *sqlite3WhereBegin(
** clause.
*/
notReady = ~(Bitmask)0;
- pTabItem = pTabList->a;
- pLevel = pWInfo->a;
andFlags = ~0;
WHERETRACE(("*** Optimizer Start ***\n"));
for(i=iFrom=0, pLevel=pWInfo->a; i<nTabList; i++, pLevel++){