From: drh Date: Thu, 8 Sep 2005 14:17:20 +0000 (+0000) Subject: Remove a few unused variables detected by Borland C. Ticket #1412. (CVS 2675) X-Git-Tag: version-3.6.10~3484 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4f26bb62a8416c8b79af4daa207143b13b7175fe;p=thirdparty%2Fsqlite.git Remove a few unused variables detected by Borland C. Ticket #1412. (CVS 2675) FossilOrigin-Name: cdfe372a958fb446485913e860d52b87fffd34e4 --- diff --git a/manifest b/manifest index 72fbe83181..add0e5fe57 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Aggregates\swith\sGROUP\sBY\scan\ssometimes\sreturn\sno\sresult\srows.\s(CVS\s2674) -D 2005-09-08T12:57:28 +C Remove\sa\sfew\sunused\svariables\sdetected\sby\sBorland\sC.\s\sTicket\s#1412.\s(CVS\s2675) +D 2005-09-08T14:17:20 F Makefile.in 12784cdce5ffc8dfb707300c34e4f1eb3b8a14f1 F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -32,9 +32,9 @@ F src/alter.c 26d755f2143719dd3f5b8aaf6cbe3c7f95332528 F src/analyze.c 29c1344053f0e26e3320449483c7157e09d2a77f F src/attach.c 4b21689700a72ae281fa85dbaff06b2a62bd49ee F src/auth.c 31e2304bef67f44d635655f44234387ea7d21454 -F src/btree.c 5b3bc015c49a41c025cfdf8ad36051f3007e2cb0 +F src/btree.c a1ee183067f20eb5ba33ca45ed47acbc7214fe44 F src/btree.h 1ed561263ca0e335bc3e81d761c9d5ff8c22f61e -F src/build.c fcedb4baf328f7846c0c686d46d5c4d0d0842423 +F src/build.c 86181cbd89e67e99d0f235428d3b9640ccf17101 F src/callback.c 9a1162c8f9dae9fad6d548339669aacb5f6cf76b F src/complete.c 4de937dfdd4c79a501772ab2035b26082f337a79 F src/date.c 7444b0900a28da77e57e3337a636873cff0ae940 @@ -66,7 +66,7 @@ F src/random.c 90adff4e73a3b249eb4f1fc2a6ff9cf78c7233a4 F src/select.c 2bba89bb64cd41991e5843617e2851c29661638d F src/shell.c b21daba017b8feef2fdc65ecde57f70209494217 F src/sqlite.h.in 461b2535550cf77aedfd44385da11ef7d63e57a2 -F src/sqliteInt.h 0688a83d0a6d8a483666f742bceebe56a6f4d1bc +F src/sqliteInt.h b72e8dfa8c3beb329e8c488384572c127f228f1c F src/table.c 25b3ff2b39b7d87e8d4a5da0713d68dfc06cbee9 F src/tclsqlite.c ac94682f9e601dd373912c46414a5a842db2089a F src/test1.c b569b60e35f0e3ea20e5ebfaf6e522a01c08d481 @@ -80,14 +80,14 @@ F src/update.c c2716c2115533ffae3d08bf8853aaba4f970f37e F src/utf.c bda5eb85039ef16f2d17004c1e18c96e1ab0a80c F src/util.c 5650f6fe5ee30e0678985ad7b94da91e3f85752b F src/vacuum.c 829d9e1a6d7c094b80e0899686670932eafd768c -F src/vdbe.c 1caa73395943e20c61cde11deedf05cb37847f87 +F src/vdbe.c f722fbaf81890c342a1e1bf5a8a1600c5212ba47 F src/vdbe.h c8e105979fc7aaf5b8004e9621904e3bd096dfa2 F src/vdbeInt.h 3dd2a29c7b0a55404c35f93caae81fb42f4cb70a F src/vdbeapi.c 6df708808458df837100521be72e728a581b5206 F src/vdbeaux.c a0aaf135c39825027366b5129f85191226d8b333 F src/vdbefifo.c 9efb94c8c3f4c979ebd0028219483f88e57584f5 -F src/vdbemem.c e1da6b772e8a05e95ede8eb6f2f6d0ef4f2e1034 -F src/where.c 92ab208abe6bec15e81616b8c1a619be23ece506 +F src/vdbemem.c fea0744936008831daa17cdc75056c3ca1469690 +F src/where.c d69b304e506a78a1cf6b31e7a58408703a166dc2 F tclinstaller.tcl 046e3624671962dc50f0481d7c25b38ef803eb42 F test/all.test 7f0988442ab811dfa41793b5b550f5828ce316f3 F test/alter.test 9d6837a3d946b73df692b7cef2a7644d2e2f6bc6 @@ -306,7 +306,7 @@ F www/tclsqlite.tcl 3df553505b6efcad08f91e9b975deb2e6c9bb955 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 3c555a87493128620ac967faf7c63c2a58856e9e -R 6b6b6dcfe86fc8c820bc96221b7fd247 +P 0c3e368d4766685b94a44f2c514e2dea806c297c +R 2154391a51bd3c5316cb4611d67dd0e3 U drh -Z db9de90b9b51092ac5db6e1c74b63c06 +Z 3f3449015248b67f23f79f2beae7c832 diff --git a/manifest.uuid b/manifest.uuid index 7027abb725..ca41482caf 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0c3e368d4766685b94a44f2c514e2dea806c297c \ No newline at end of file +cdfe372a958fb446485913e860d52b87fffd34e4 \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index a8978f3315..6b778b4adf 100644 --- a/src/btree.c +++ b/src/btree.c @@ -9,7 +9,7 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** $Id: btree.c,v 1.265 2005/08/27 16:36:49 drh Exp $ +** $Id: btree.c,v 1.266 2005/09/08 14:17:20 drh Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** For a detailed discussion of BTrees, refer to @@ -2481,13 +2481,11 @@ static const unsigned char *fetchPayload( ){ unsigned char *aPayload; MemPage *pPage; - Btree *pBt; u32 nKey; int nLocal; assert( pCur!=0 && pCur->pPage!=0 ); assert( pCur->isValid ); - pBt = pCur->pBt; pPage = pCur->pPage; pageIntegrity(pPage); assert( pCur->idx>=0 && pCur->idxnCell ); @@ -2585,7 +2583,6 @@ static int isRootPage(MemPage *pPage){ ** the largest cell index. */ static void moveToParent(BtCursor *pCur){ - Pgno oldPgno; MemPage *pParent; MemPage *pPage; int idxParent; @@ -2600,7 +2597,6 @@ static void moveToParent(BtCursor *pCur){ pageIntegrity(pParent); idxParent = pPage->idxParent; sqlite3pager_ref(pParent->aData); - oldPgno = pPage->pgno; releasePage(pPage); pCur->pPage = pParent; pCur->info.nSize = 0; @@ -5480,7 +5476,7 @@ static int checkTreePage( u8 *data; BtCursor cur; Btree *pBt; - int maxLocal, usableSize; + int usableSize; char zContext[100]; char *hit; @@ -5497,7 +5493,6 @@ static int checkTreePage( "unable to get the page. error code=%d", rc); return 0; } - maxLocal = pPage->leafData ? pBt->maxLeaf : pBt->maxLocal; if( (rc = initPage(pPage, pParent))!=0 ){ checkAppendMsg(pCheck, zContext, "initPage() returns error code %d", rc); releasePage(pPage); diff --git a/src/build.c b/src/build.c index e6c914c244..6d94c494f4 100644 --- a/src/build.c +++ b/src/build.c @@ -22,7 +22,7 @@ ** COMMIT ** ROLLBACK ** -** $Id: build.c,v 1.346 2005/09/08 00:13:27 drh Exp $ +** $Id: build.c,v 1.347 2005/09/08 14:17:20 drh Exp $ */ #include "sqliteInt.h" #include @@ -132,7 +132,6 @@ void sqlite3FinishCoding(Parse *pParse){ void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){ va_list ap; char *zSql; - int rc; # define SAVE_SZ (sizeof(Parse) - offsetof(Parse,nVar)) char saveBuf[SAVE_SZ]; @@ -147,7 +146,7 @@ void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){ pParse->nested++; memcpy(saveBuf, &pParse->nVar, SAVE_SZ); memset(&pParse->nVar, 0, SAVE_SZ); - rc = sqlite3RunParser(pParse, zSql, 0); + sqlite3RunParser(pParse, zSql, 0); sqliteFree(zSql); memcpy(&pParse->nVar, saveBuf, SAVE_SZ); pParse->nested--; @@ -636,7 +635,6 @@ void sqlite3StartTable( int isView /* True if this is a VIEW */ ){ Table *pTable; - Index *pIdx; char *zName = 0; /* The name of the new table */ sqlite3 *db = pParse->db; Vdbe *v; @@ -715,8 +713,7 @@ void sqlite3StartTable( sqlite3ErrorMsg(pParse, "table %T already exists", pName); goto begin_table_error; } - if( (pIdx = sqlite3FindIndex(db, zName, 0))!=0 && - ( iDb==0 || !db->init.busy) ){ + if( sqlite3FindIndex(db, zName, 0)!=0 && (iDb==0 || !db->init.busy) ){ sqlite3ErrorMsg(pParse, "there is already an index named %s", zName); goto begin_table_error; } @@ -2116,14 +2113,12 @@ void sqlite3CreateIndex( goto exit_create_index; } if( !db->init.busy ){ - Index *pISameName; /* Another index with the same name */ - Table *pTSameName; /* A table with same name as the index */ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ) goto exit_create_index; - if( (pISameName = sqlite3FindIndex(db, zName, db->aDb[iDb].zName))!=0 ){ + if( sqlite3FindIndex(db, zName, db->aDb[iDb].zName)!=0 ){ sqlite3ErrorMsg(pParse, "index %s already exists", zName); goto exit_create_index; } - if( (pTSameName = sqlite3FindTable(db, zName, 0))!=0 ){ + if( sqlite3FindTable(db, zName, 0)!=0 ){ sqlite3ErrorMsg(pParse, "there is already a table named %s", zName); goto exit_create_index; } diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 597ca16592..74fb4f73f2 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.411 2005/09/08 02:00:26 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.412 2005/09/08 14:17:20 drh Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ @@ -1600,7 +1600,7 @@ const void *sqlite3ValueText(sqlite3_value*, u8); int sqlite3ValueBytes(sqlite3_value*, u8); void sqlite3ValueSetStr(sqlite3_value*, int, const void *,u8, void(*)(void*)); void sqlite3ValueFree(sqlite3_value*); -sqlite3_value *sqlite3ValueNew(); +sqlite3_value *sqlite3ValueNew(void); sqlite3_value *sqlite3GetTransientValue(sqlite3*db); int sqlite3ValueFromExpr(Expr *, u8, u8, sqlite3_value **); void sqlite3ValueApplyAffinity(sqlite3_value *, u8, u8); diff --git a/src/vdbe.c b/src/vdbe.c index 7d8951db72..c327598781 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -43,7 +43,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.484 2005/09/07 23:05:22 drh Exp $ +** $Id: vdbe.c,v 1.485 2005/09/08 14:17:20 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -3658,13 +3658,12 @@ case OP_IdxLT: /* no-push */ case OP_IdxGT: /* no-push */ case OP_IdxGE: { /* no-push */ int i= pOp->p1; - BtCursor *pCrsr; Cursor *pC; assert( i>=0 && inCursor ); assert( p->apCsr[i]!=0 ); assert( pTos>=p->aStack ); - if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){ + if( (pC = p->apCsr[i])->pCursor!=0 ){ int res, rc; assert( pTos->flags & MEM_Blob ); /* Created using OP_Make*Key */ diff --git a/src/vdbemem.c b/src/vdbemem.c index 085e2aaaa0..05d9c884d8 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -729,7 +729,7 @@ const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){ /* ** Create a new sqlite3_value object. */ -sqlite3_value* sqlite3ValueNew(){ +sqlite3_value* sqlite3ValueNew(void){ Mem *p = sqliteMalloc(sizeof(*p)); if( p ){ p->flags = MEM_Null; diff --git a/src/where.c b/src/where.c index c085f442f5..1c2007b655 100644 --- a/src/where.c +++ b/src/where.c @@ -16,7 +16,7 @@ ** so is applicable. Because this module is responsible for selecting ** indices, you might also think of this module as the "query optimizer". ** -** $Id: where.c,v 1.168 2005/09/01 17:47:51 drh Exp $ +** $Id: where.c,v 1.169 2005/09/08 14:17:20 drh Exp $ */ #include "sqliteInt.h" @@ -537,7 +537,6 @@ static void exprAnalyze( Expr *pExpr = pTerm->pExpr; Bitmask prereqLeft; Bitmask prereqAll; - int idxRight; int nPattern; int isComplete; @@ -548,7 +547,6 @@ static void exprAnalyze( pTerm->leftCursor = -1; pTerm->iParent = -1; pTerm->operator = 0; - idxRight = -1; if( allowedOp(pExpr->op) && (pTerm->prereqRight & prereqLeft)==0 ){ Expr *pLeft = pExpr->pLeft; Expr *pRight = pExpr->pRight;