From: drh Date: Thu, 20 Oct 2005 07:28:17 +0000 (+0000) Subject: Changes to prevent various compiler warnings. (CVS 2750) X-Git-Tag: version-3.6.10~3410 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9cb6ac02f783873152877b77b0ac67f9c327008;p=thirdparty%2Fsqlite.git Changes to prevent various compiler warnings. (CVS 2750) FossilOrigin-Name: e261b8b09a529a3e67dc27c3b83b660bcb32e195 --- diff --git a/manifest b/manifest index f00d36ce50..f821d04f3f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Attempt\sto\sfix\sthe\sSQLite\score\sso\sthat\sno\sfloating\spoint\soperations\sare\sused\nanywhere\sif\sSQLITE_OMIT_FLOATING_POINT\sis\sdefined\sat\scompile-time.\s\sThis\nis\suseful\sto\speople\swho\suse\sSQLite\son\sembedded\sprocessors\sthat\slack\nfloating\spoint\ssupport.\s(CVS\s2749) -D 2005-10-13T02:09:50 +C Changes\sto\sprevent\svarious\scompiler\swarnings.\s(CVS\s2750) +D 2005-10-20T07:28:18 F Makefile.in 12784cdce5ffc8dfb707300c34e4f1eb3b8a14f1 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -29,14 +29,14 @@ F sqlite.pc.in 30552343140c53304c2a658c080fbe810cd09ca2 F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc F sqlite3.def c413e514217736884254739a105c8c942fdf0c2f F sqlite3.pc.in 985b9bf34192a549d7d370e0f0b6b34a4f61369a -F src/alter.c 26d755f2143719dd3f5b8aaf6cbe3c7f95332528 +F src/alter.c 149e871e1ad6648da9b72e69feb1bd1407bf5226 F src/analyze.c 21a4cd125bedd3cb15857595c45c2a49c0556d26 F src/attach.c 4b21689700a72ae281fa85dbaff06b2a62bd49ee F src/auth.c 31e2304bef67f44d635655f44234387ea7d21454 -F src/btree.c 236126155d5607da945d33514218cbec762d887e +F src/btree.c 1ccc3b3931774a68ee0d6a8e2c8ea83f27b853fb F src/btree.h 1ed561263ca0e335bc3e81d761c9d5ff8c22f61e F src/build.c aa9591839c00731370c1ba53a9c0045f70d764c4 -F src/callback.c 9a1162c8f9dae9fad6d548339669aacb5f6cf76b +F src/callback.c 90ab4f235a2603c4cb8e6a2497091a71fb732bfa F src/complete.c 4de937dfdd4c79a501772ab2035b26082f337a79 F src/date.c 7444b0900a28da77e57e3337a636873cff0ae940 F src/delete.c 29dac493f4d83b05f91233b116827c133bcdab72 @@ -47,13 +47,13 @@ F src/hash.c 8747cf51d12de46512880dfcf1b68b4e24072863 F src/hash.h 1b0c445e1c89ff2aaad9b4605ba61375af001e84 F src/insert.c 1f51566d7cf4b243a2792f5fda37343d6e9377fa F src/legacy.c d58ea507bce885298a2c8c3cbb0f4bff5d47830b -F src/main.c 422014201f22aa17b96c76650163178a91a825af +F src/main.c 97bb830cdbd378d1f87469618471f52d9d263d09 F src/md5.c 7ae1c39044b95de2f62e066f47bb1deb880a1070 F src/os.h c51f2747f7bd1840447e2c7d26db749604626814 F src/os_common.h 1ff88c7e7e6bd3e5f85443106c91cc26a4f8600b F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 -F src/os_unix.c 23d6c04d08dbf712447e490c1451e3acd2d4ea2a +F src/os_unix.c 2af2d2cea9cc6282c02b48aacf2995193440cf00 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_win.c fbccc85e7011174068c27d54256746321a1f0059 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b @@ -66,7 +66,7 @@ F src/printf.c 3ea3a17d25d7ac498efc18007c70371a42c968f8 F src/random.c 90adff4e73a3b249eb4f1fc2a6ff9cf78c7233a4 F src/select.c 80c95f3cebd6f7096cdcad1968316e4bb96b18b2 F src/shell.c 3596c1e559b82663057940d19ba533ad421c7dd3 -F src/sqlite.h.in a9c3e9797c6f2657f2096630af6240a602ff8622 +F src/sqlite.h.in 8e648e1f386e4509f2f96c09ded7c07b0df0c9a2 F src/sqliteInt.h 403552a7770a5c5a376af9bdc956f0c78e524b9c F src/table.c e03b60eaabaeb54a00d7e931566d77302dfc19b0 F src/tclsqlite.c 4f274fae3d4a1863451a553dd8e5015747a5d91d @@ -79,9 +79,9 @@ F src/tokenize.c e1faf5637f3f4f90933785a0ecf64595f3ac3530 F src/trigger.c f51dec15921629591cb98bf2e350018e268b109a F src/update.c ac506fb7400158f826ec6c3a0dbe65e7ed3928d5 F src/utf.c bda5eb85039ef16f2d17004c1e18c96e1ab0a80c -F src/util.c e10e28d410aa49ea9c318cf7f285ab8c8a567154 +F src/util.c 48fecbbef4391d102a23096d32f0d74173428406 F src/vacuum.c 829d9e1a6d7c094b80e0899686670932eafd768c -F src/vdbe.c c9aca7cc6dc381c4ce5a59c97ac148ed0659fb3c +F src/vdbe.c 2a660920b059d66571d5965e9c9114faca1831af F src/vdbe.h 8729a4ee16ff9aeab2af9667df3cf300ff978e13 F src/vdbeInt.h 7bedbb9553a10e86b53f75d99e197f3f00a732bf F src/vdbeapi.c 85bbe1d0243a89655433d60711b4bd71979b59cd @@ -315,7 +315,7 @@ F www/tclsqlite.tcl ddcf912ea48695603c8ed7efb29f0812ef8d1b49 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 9753af53494a14f7300f92f3d94e4ceb55619529 -R a6df4c45cb7278a0ea91b4f127858f77 +P a0bdb584680ce6400d9e8c57db9d91197cc7b776 +R 40487867c272173d14c55dbe54659f26 U drh -Z 0352737aa28a9b0c5a1c2ec1286f6536 +Z 62b590d490d04c1d0b2fecf0198039da diff --git a/manifest.uuid b/manifest.uuid index 8407bf9dbd..0d56daa957 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a0bdb584680ce6400d9e8c57db9d91197cc7b776 \ No newline at end of file +e261b8b09a529a3e67dc27c3b83b660bcb32e195 \ No newline at end of file diff --git a/src/alter.c b/src/alter.c index eba01e2960..ff02c5dfcf 100644 --- a/src/alter.c +++ b/src/alter.c @@ -12,7 +12,7 @@ ** This file contains C code routines that used to generate VDBE code ** that implements the ALTER TABLE command. ** -** $Id: alter.c,v 1.8 2005/08/19 19:14:13 drh Exp $ +** $Id: alter.c,v 1.9 2005/10/20 07:28:18 drh Exp $ */ #include "sqliteInt.h" #include @@ -233,7 +233,7 @@ static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){ /* Now, if the table is not stored in the temp database, reload any temp ** triggers. Don't use IN(...) in case SQLITE_OMIT_SUBQUERY is defined. */ - if( (zWhere=whereTempTriggers(pParse, pTab)) ){ + if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){ sqlite3VdbeOp3(v, OP_ParseSchema, 1, 0, zWhere, P3_DYNAMIC); } #endif @@ -349,7 +349,7 @@ void sqlite3AlterRenameTable( ** table. Don't do this if the table being ALTERed is itself located in ** the temp database. */ - if( (zWhere=whereTempTriggers(pParse, pTab)) ){ + if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){ sqlite3NestedParse(pParse, "UPDATE sqlite_temp_master SET " "sql = sqlite_rename_trigger(sql, %Q), " @@ -462,7 +462,7 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ ** format to 2. If the default value of the new column is not NULL, ** the file format becomes 3. */ - if( (v=sqlite3GetVdbe(pParse)) ){ + if( (v=sqlite3GetVdbe(pParse))!=0 ){ int f = (pDflt?3:2); /* Only set the file format to $f if it is currently less than $f. */ diff --git a/src/btree.c b/src/btree.c index 7b9cde7cf4..02a641b43b 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.269 2005/09/17 15:20:27 drh Exp $ +** $Id: btree.c,v 1.270 2005/10/20 07:28:18 drh Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** For a detailed discussion of BTrees, refer to @@ -3796,7 +3796,6 @@ static int balance_nonroot(MemPage *pPage){ MemPage *apCopy[NB]; /* Private copies of apOld[] pages */ MemPage *apNew[NB+2]; /* pPage and up to NB siblings after balancing */ Pgno pgnoNew[NB+2]; /* Page numbers for each page in apNew[] */ - int idxDiv[NB]; /* Indices of divider cells in pParent */ u8 *apDiv[NB]; /* Divider cells in pParent */ int cntNew[NB+2]; /* Index in aCell[] of cell after i-th page */ int szNew[NB+2]; /* Combined size of cells place on i-th page */ @@ -3888,7 +3887,6 @@ static int balance_nonroot(MemPage *pPage){ nDiv = 0; for(i=0, k=nxDiv; inCell ){ - idxDiv[i] = k; apDiv[i] = findCell(pParent, k); nDiv++; assert( !pParent->leaf ); @@ -5474,7 +5472,6 @@ static int checkTreePage( int hdr, cellStart; int nCell; u8 *data; - BtCursor cur; Btree *pBt; int usableSize; char zContext[100]; @@ -5484,7 +5481,7 @@ static int checkTreePage( /* Check that the page exists */ - cur.pBt = pBt = pCheck->pBt; + pBt = pCheck->pBt; usableSize = pBt->usableSize; if( iPage==0 ) return 0; if( checkRef(pCheck, iPage, zParentContext) ) return 0; @@ -5502,7 +5499,6 @@ static int checkTreePage( /* Check out all the cells. */ depth = 0; - cur.pPage = pPage; for(i=0; inCell; i++){ u8 *pCell; int sz; diff --git a/src/callback.c b/src/callback.c index 8b585a11fa..7884a81673 100644 --- a/src/callback.c +++ b/src/callback.c @@ -13,7 +13,7 @@ ** This file contains functions used to access the internal hash tables ** of user defined functions and collation sequences. ** -** $Id: callback.c,v 1.3 2005/08/14 01:20:38 drh Exp $ +** $Id: callback.c,v 1.4 2005/10/20 07:28:18 drh Exp $ */ #include "sqliteInt.h" @@ -286,7 +286,7 @@ FuncDef *sqlite3FindFunction( ** new entry to the hash table and return it. */ if( createFlag && bestmatch<6 && - (pBest = sqliteMalloc(sizeof(*pBest)+nName)) ){ + (pBest = sqliteMalloc(sizeof(*pBest)+nName))!=0 ){ pBest->nArg = nArg; pBest->pNext = pFirst; pBest->iPrefEnc = enc; diff --git a/src/main.c b/src/main.c index d3928fd4f7..192b5e200c 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.302 2005/09/17 15:20:27 drh Exp $ +** $Id: main.c,v 1.303 2005/10/20 07:28:18 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -741,7 +741,7 @@ static int openDatabase( */ if( sqlite3_create_collation(db, "BINARY", SQLITE_UTF8, 0,binCollFunc) || sqlite3_create_collation(db, "BINARY", SQLITE_UTF16, 0,binCollFunc) || - !(db->pDfltColl = sqlite3FindCollSeq(db, db->enc, "BINARY", 6, 0)) ){ + (db->pDfltColl = sqlite3FindCollSeq(db, db->enc, "BINARY", 6, 0))==0 ){ rc = db->errCode; assert( rc!=SQLITE_OK ); db->magic = SQLITE_MAGIC_CLOSED; @@ -1020,7 +1020,7 @@ int sqlite3_global_recover(){ sqlite3ExpirePreparedStatements(db); for(i=0; inDb; i++){ Btree *pBt = db->aDb[i].pBt; - if( pBt && (rc=sqlite3BtreeReset(pBt)) ){ + if( pBt && (rc=sqlite3BtreeReset(pBt))!=0 ){ goto recover_out; } } diff --git a/src/os_unix.c b/src/os_unix.c index 3e7a7b1539..270d39888e 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -202,7 +202,7 @@ struct lockKey { dev_t dev; /* Device number */ ino_t ino; /* Inode number */ #ifdef SQLITE_UNIX_THREADS - pthread_t tid; /* Thread ID or zero if threads cannot override each other */ + pthread_t tid; /* Thread ID or zero if threads can override each other */ #endif }; diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 5b0ead4be6..c07876ce7e 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -12,7 +12,7 @@ ** This header file defines the interface that the SQLite library ** presents to client programs. ** -** @(#) $Id: sqlite.h.in,v 1.142 2005/10/13 02:09:50 drh Exp $ +** @(#) $Id: sqlite.h.in,v 1.143 2005/10/20 07:28:19 drh Exp $ */ #ifndef _SQLITE3_H_ #define _SQLITE3_H_ @@ -1258,7 +1258,7 @@ extern char *sqlite3_temp_directory; ** This functionality can be omitted from a build by defining the ** SQLITE_OMIT_GLOBALRECOVER at compile time. */ -int sqlite3_global_recover(); +int sqlite3_global_recover(void); /* ** Test to see whether or not the database connection is in autocommit diff --git a/src/util.c b/src/util.c index 1601234447..53b9773844 100644 --- a/src/util.c +++ b/src/util.c @@ -14,7 +14,7 @@ ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** -** $Id: util.c,v 1.147 2005/10/13 02:09:50 drh Exp $ +** $Id: util.c,v 1.148 2005/10/20 07:28:19 drh Exp $ */ #include "sqliteInt.h" #include @@ -440,7 +440,7 @@ void sqlite3SetString(char **pz, ...){ ** to NULL. */ void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){ - if( db && (db->pErr || (db->pErr = sqlite3ValueNew())) ){ + if( db && (db->pErr || (db->pErr = sqlite3ValueNew()))!=0 ){ db->errCode = err_code; if( zFormat ){ char *z; diff --git a/src/vdbe.c b/src/vdbe.c index a10f1a2485..2bb56e4af3 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.492 2005/10/06 16:53:16 drh Exp $ +** $Id: vdbe.c,v 1.493 2005/10/20 07:28:19 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -2248,7 +2248,7 @@ case OP_MakeRecord: { case OP_Statement: { /* no-push */ int i = pOp->p1; Btree *pBt; - if( i>=0 && inDb && (pBt = db->aDb[i].pBt) && !(db->autoCommit) ){ + if( i>=0 && inDb && (pBt = db->aDb[i].pBt)!=0 && !(db->autoCommit) ){ assert( sqlite3BtreeIsInTrans(pBt) ); if( !sqlite3BtreeIsInStmt(pBt) ){ rc = sqlite3BtreeBeginStmt(pBt);