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

Fix additional compiler warnings. Tickets #1615, #1616, #1627 (CVS 2994)

FossilOrigin-Name: 6385628edd79187dff1687815d0101c31248e54f
This commit is contained in:
drh
2006-01-23 13:00:35 +00:00
parent a1686c9a3b
commit d116739351
7 changed files with 43 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
C Fixes\sfor\sOMIT_UTF16\sand\sOMIT_COMPOUND\s(CVS\s2993) C Fix\sadditional\scompiler\swarnings.\s\sTickets\s#1615,\s#1616,\s#1627\s(CVS\s2994)
D 2006-01-23T07:52:38 D 2006-01-23T13:00:36
F Makefile.in ab3ffd8d469cef4477257169b82810030a6bb967 F Makefile.in ab3ffd8d469cef4477257169b82810030a6bb967
F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -34,7 +34,7 @@ F src/alter.c 90b779cf00489535cab6490df6dc050f40e4e874
F src/analyze.c 7d2b7ab9a9c2fd6e55700f69064dfdd3e36d7a8a F src/analyze.c 7d2b7ab9a9c2fd6e55700f69064dfdd3e36d7a8a
F src/attach.c 0081040e9a5d13669b6712e947688c10f030bfc1 F src/attach.c 0081040e9a5d13669b6712e947688c10f030bfc1
F src/auth.c 9ae84d2d94eb96195e04515715e08e85963e96c2 F src/auth.c 9ae84d2d94eb96195e04515715e08e85963e96c2
F src/btree.c 9de685a11ede765542a644441340cbed32380c3d F src/btree.c ab0f6813b32e0db14883a71bd228470989dea609
F src/btree.h 5663c4f43e8521546ccebc8fc95acb013b8f3184 F src/btree.h 5663c4f43e8521546ccebc8fc95acb013b8f3184
F src/build.c 15224e2fd348ad32b9044aaa5bdc912e4067da15 F src/build.c 15224e2fd348ad32b9044aaa5bdc912e4067da15
F src/callback.c 1bf497306c32229114f826707054df7ebe10abf2 F src/callback.c 1bf497306c32229114f826707054df7ebe10abf2
@@ -70,9 +70,9 @@ F src/select.c 11ad28afb33bb83b655074c87557d4686c67f92f
F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
F src/shell.c 66b073375efbdee19045e7e0cd38b85f9aff71da F src/shell.c 66b073375efbdee19045e7e0cd38b85f9aff71da
F src/sqlite.h.in 492580f7e3ff71eb43193eb7bb98e2d549889ce3 F src/sqlite.h.in 492580f7e3ff71eb43193eb7bb98e2d549889ce3
F src/sqliteInt.h 8cbeb4346a70ca47a2ec5935ec26b5c7f0b1948f F src/sqliteInt.h fba26ce93a090aed928bcb1edcc58c0c1717c5b0
F src/table.c 486dcfce532685b53b5a2b5da8bba0ded6fb2316 F src/table.c 486dcfce532685b53b5a2b5da8bba0ded6fb2316
F src/tclsqlite.c d650bea0248fc0a310ddc2cb94273a3a5021fddf F src/tclsqlite.c 7764ab34df617b3d3cfd5f0fdf3444ed219c11d6
F src/test1.c 846b3731af01ac90bad583f55e7969c8fb232172 F src/test1.c 846b3731af01ac90bad583f55e7969c8fb232172
F src/test2.c ca74a1d8aeb7d9606e8f6b762c5daf85c1a3f92b F src/test2.c ca74a1d8aeb7d9606e8f6b762c5daf85c1a3f92b
F src/test3.c 86e99724ee898b119ed575ef9f98618afe7e5e5d F src/test3.c 86e99724ee898b119ed575ef9f98618afe7e5e5d
@@ -85,7 +85,7 @@ F src/tokenize.c 9ae9a59238eb97fbc61baea280563b91100518fb
F src/trigger.c 4d3644cbd16959b568c95ae73493402be8021b08 F src/trigger.c 4d3644cbd16959b568c95ae73493402be8021b08
F src/update.c 14be4ba2f438919b4217085c02feff569e6cf1f2 F src/update.c 14be4ba2f438919b4217085c02feff569e6cf1f2
F src/utf.c 5ab8ca05d4e9ec81174b010f01ab12a232f0087d F src/utf.c 5ab8ca05d4e9ec81174b010f01ab12a232f0087d
F src/util.c 2510e040166cb07b7e8ed0c1ccaec22350d57df4 F src/util.c 8c2e824e0bab3e5d1673213235e5dc0bdec441d4
F src/vacuum.c 3865673cc66acd0717ecd517f6b8fdb2a5e7924b F src/vacuum.c 3865673cc66acd0717ecd517f6b8fdb2a5e7924b
F src/vdbe.c e04bf3035a7dc547e80ba1130a716a7e8c9f7c93 F src/vdbe.c e04bf3035a7dc547e80ba1130a716a7e8c9f7c93
F src/vdbe.h 8729a4ee16ff9aeab2af9667df3cf300ff978e13 F src/vdbe.h 8729a4ee16ff9aeab2af9667df3cf300ff978e13
@@ -94,7 +94,7 @@ F src/vdbeapi.c dcb2636f49b4807e34960d52a2fc257b3a751140
F src/vdbeaux.c 1dce6e5f51d6119220e12ecbceccccf97ca8b8be F src/vdbeaux.c 1dce6e5f51d6119220e12ecbceccccf97ca8b8be
F src/vdbefifo.c 9efb94c8c3f4c979ebd0028219483f88e57584f5 F src/vdbefifo.c 9efb94c8c3f4c979ebd0028219483f88e57584f5
F src/vdbemem.c 2034e93b32c14bda6e306bb54e3a8e930b963027 F src/vdbemem.c 2034e93b32c14bda6e306bb54e3a8e930b963027
F src/where.c 7ce7a52fdc696d26cd9f9c939dc972585d3dd72d F src/where.c 4c77a9dc132095a73021186a90fe44ba086f67ce
F tclinstaller.tcl 046e3624671962dc50f0481d7c25b38ef803eb42 F tclinstaller.tcl 046e3624671962dc50f0481d7c25b38ef803eb42
F test/aggerror.test b854de90f530ae37be68fbfe6de40e111358cbb2 F test/aggerror.test b854de90f530ae37be68fbfe6de40e111358cbb2
F test/all.test 5df90d015ca63fcef2a4b62c24f7316b66c4bfd4 F test/all.test 5df90d015ca63fcef2a4b62c24f7316b66c4bfd4
@@ -344,7 +344,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P cc2e8e87cfd474b4dc6833ee0c38e2cd2dd3a494 P f58bbdc0ac6e618686c598aaafb3a41b972e078e
R e7686387c0d32f2c77df0a39b8385c89 R 0db26160e071e13e253b47ccdbdc4fe3
U danielk1977 U drh
Z de4e011a442de96ed72224d63af9baef Z bfce48ac39b5c5b64554076983aa10ce

View File

@@ -1 +1 @@
f58bbdc0ac6e618686c598aaafb3a41b972e078e 6385628edd79187dff1687815d0101c31248e54f

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give. ** May you share freely, never taking more than you give.
** **
************************************************************************* *************************************************************************
** $Id: btree.c,v 1.307 2006/01/22 21:52:57 drh Exp $ ** $Id: btree.c,v 1.308 2006/01/23 13:00:36 drh Exp $
** **
** This file implements a external (disk-based) database using BTrees. ** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to ** For a detailed discussion of BTrees, refer to
@@ -5282,9 +5282,9 @@ int sqlite3BtreeDelete(BtCursor *pCur){
** that the entry will be deleted from. ** that the entry will be deleted from.
*/ */
if( if(
(rc = restoreOrClearCursorPosition(pCur, 1)) || (rc = restoreOrClearCursorPosition(pCur, 1))!=0 ||
(rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur)) || (rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur))!=0 ||
(rc = sqlite3pager_write(pPage->aData)) (rc = sqlite3pager_write(pPage->aData))!=0
){ ){
return rc; return rc;
} }

View File

@@ -11,7 +11,7 @@
************************************************************************* *************************************************************************
** Internal interface definitions for SQLite. ** Internal interface definitions for SQLite.
** **
** @(#) $Id: sqliteInt.h,v 1.476 2006/01/23 00:04:55 drh Exp $ ** @(#) $Id: sqliteInt.h,v 1.477 2006/01/23 13:00:38 drh Exp $
*/ */
#ifndef _SQLITEINT_H_ #ifndef _SQLITEINT_H_
#define _SQLITEINT_H_ #define _SQLITEINT_H_
@@ -73,10 +73,15 @@
#ifdef SQLITE_OMIT_FLOATING_POINT #ifdef SQLITE_OMIT_FLOATING_POINT
# define double sqlite_int64 # define double sqlite_int64
# define LONGDOUBLE_TYPE sqlite_int64 # define LONGDOUBLE_TYPE sqlite_int64
# ifndef SQLITE_BIG_DBL
# define SQLITE_BIG_DBL (0x7fffffffffffffff) # define SQLITE_BIG_DBL (0x7fffffffffffffff)
# endif
# define SQLITE_OMIT_DATETIME_FUNCS 1 # define SQLITE_OMIT_DATETIME_FUNCS 1
# define SQLITE_OMIT_TRACE 1 # define SQLITE_OMIT_TRACE 1
#endif #endif
#ifndef SQLITE_BIG_DBL
# define SQLITE_BIG_DBL (1e99)
#endif
/* /*
** The maximum number of in-memory pages to use for the main database ** The maximum number of in-memory pages to use for the main database
@@ -693,7 +698,6 @@ struct Table {
int tnum; /* Root BTree node for this table (see note above) */ int tnum; /* Root BTree node for this table (see note above) */
Select *pSelect; /* NULL for tables. Points to definition if a view. */ Select *pSelect; /* NULL for tables. Points to definition if a view. */
u8 readOnly; /* True if this table should not be written by the user */ u8 readOnly; /* True if this table should not be written by the user */
// u8 iDb; /* Index into sqlite.aDb[] of the backend for this table */
u8 isTransient; /* True if automatically deleted when VDBE finishes */ u8 isTransient; /* True if automatically deleted when VDBE finishes */
u8 hasPrimKey; /* True if there exists a primary key */ u8 hasPrimKey; /* True if there exists a primary key */
u8 keyConf; /* What to do in case of uniqueness conflict on iPKey */ u8 keyConf; /* What to do in case of uniqueness conflict on iPKey */
@@ -957,7 +961,6 @@ struct AggInfo {
struct Expr { struct Expr {
u8 op; /* Operation performed by this node */ u8 op; /* Operation performed by this node */
char affinity; /* The affinity of the column or 0 if not a column */ char affinity; /* The affinity of the column or 0 if not a column */
//u8 iDb; /* Database referenced by this expression */
u8 flags; /* Various flags. See below */ u8 flags; /* Various flags. See below */
CollSeq *pColl; /* The collation type of the column or 0 */ CollSeq *pColl; /* The collation type of the column or 0 */
Expr *pLeft, *pRight; /* Left and right subnodes */ Expr *pLeft, *pRight; /* Left and right subnodes */
@@ -1742,8 +1745,8 @@ int sqlite3CreateFunc(sqlite3 *, const char *, int, int, void *,
void (*)(sqlite3_context*,int,sqlite3_value **), void (*)(sqlite3_context*,int,sqlite3_value **),
void (*)(sqlite3_context*,int,sqlite3_value **), void (*)(sqlite3_context*)); void (*)(sqlite3_context*,int,sqlite3_value **), void (*)(sqlite3_context*));
int sqlite3ApiExit(sqlite3 *db, int); int sqlite3ApiExit(sqlite3 *db, int);
int sqlite3MallocFailed(); int sqlite3MallocFailed(void);
void sqlite3FailedMalloc(); void sqlite3FailedMalloc(void);
#ifndef SQLITE_OMIT_SHARED_CACHE #ifndef SQLITE_OMIT_SHARED_CACHE
void sqlite3TableLock(Parse *, int, int, u8, const char *); void sqlite3TableLock(Parse *, int, int, u8, const char *);
@@ -1752,13 +1755,13 @@ void sqlite3FailedMalloc();
#endif #endif
#ifdef SQLITE_MEMDEBUG #ifdef SQLITE_MEMDEBUG
void sqlite3MallocDisallow(); void sqlite3MallocDisallow(void);
void sqlite3MallocAllow(); void sqlite3MallocAllow(void);
int sqlite3TestMallocFail(); int sqlite3TestMallocFail(void);
#else #else
#define sqlite3TestMallocFail() 0 #define sqlite3TestMallocFail(void) 0
#define sqlite3MallocDisallow() #define sqlite3MallocDisallow(void)
#define sqlite3MallocAllow() #define sqlite3MallocAllow(void)
#endif #endif
#ifdef SQLITE_SSE #ifdef SQLITE_SSE

View File

@@ -11,7 +11,7 @@
************************************************************************* *************************************************************************
** A TCL Interface to SQLite ** A TCL Interface to SQLite
** **
** $Id: tclsqlite.c,v 1.149 2006/01/09 23:40:25 drh Exp $ ** $Id: tclsqlite.c,v 1.150 2006/01/23 13:00:38 drh Exp $
*/ */
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ #ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@@ -256,6 +256,7 @@ static int DbProgressHandler(void *cd){
return 0; return 0;
} }
#ifndef SQLITE_OMIT_TRACE
/* /*
** This routine is called by the SQLite trace handler whenever a new ** This routine is called by the SQLite trace handler whenever a new
** block of SQL is executed. The TCL script in pDb->zTrace is executed. ** block of SQL is executed. The TCL script in pDb->zTrace is executed.
@@ -271,7 +272,9 @@ static void DbTraceHandler(void *cd, const char *zSql){
Tcl_DStringFree(&str); Tcl_DStringFree(&str);
Tcl_ResetResult(pDb->interp); Tcl_ResetResult(pDb->interp);
} }
#endif
#ifndef SQLITE_OMIT_TRACE
/* /*
** This routine is called by the SQLite profile handler after a statement ** This routine is called by the SQLite profile handler after a statement
** SQL has executed. The TCL script in pDb->zProfile is evaluated. ** SQL has executed. The TCL script in pDb->zProfile is evaluated.
@@ -290,6 +293,7 @@ static void DbProfileHandler(void *cd, const char *zSql, sqlite_uint64 tm){
Tcl_DStringFree(&str); Tcl_DStringFree(&str);
Tcl_ResetResult(pDb->interp); Tcl_ResetResult(pDb->interp);
} }
#endif
/* /*
** This routine is called when a transaction is committed. The ** This routine is called when a transaction is committed. The

View File

@@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing ** This file contains functions for allocating memory, comparing
** strings, and stuff like that. ** strings, and stuff like that.
** **
** $Id: util.c,v 1.180 2006/01/20 17:56:33 drh Exp $ ** $Id: util.c,v 1.181 2006/01/23 13:00:38 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "os.h" #include "os.h"
@@ -559,7 +559,7 @@ static int handleSoftLimit(int n){
void *sqlite3MallocRaw(int n){ void *sqlite3MallocRaw(int n){
void *p = 0; void *p = 0;
if( n>0 && !sqlite3MallocFailed() && !handleSoftLimit(n) ){ if( n>0 && !sqlite3MallocFailed() && !handleSoftLimit(n) ){
while( !(p = OSMALLOC(n)) && sqlite3_release_memory(n) ); while( (p = OSMALLOC(n))==0 && sqlite3_release_memory(n) );
if( !p ){ if( !p ){
/* If the allocation failed, call handleSoftLimit() again, this time /* If the allocation failed, call handleSoftLimit() again, this time
** with the additive inverse of the argument passed to ** with the additive inverse of the argument passed to
@@ -589,7 +589,7 @@ void *sqlite3Realloc(void *p, int n){
}else{ }else{
void *np = 0; void *np = 0;
if( !handleSoftLimit(n - OSSIZEOF(p)) ){ if( !handleSoftLimit(n - OSSIZEOF(p)) ){
while( !(np = OSREALLOC(p, n)) && sqlite3_release_memory(n) ); while( (np = OSREALLOC(p, n))==0 && sqlite3_release_memory(n) );
if( !np ){ if( !np ){
/* If the allocation failed, call handleSoftLimit() again, this time /* If the allocation failed, call handleSoftLimit() again, this time
** with the additive inverse of the argument passed to ** with the additive inverse of the argument passed to
@@ -743,7 +743,7 @@ void sqlite3SetString(char **pz, ...){
** to NULL. ** to NULL.
*/ */
void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){ void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){
if( db && (db->pErr || (db->pErr = sqlite3ValueNew()))!=0 ){ if( db && (db->pErr || (db->pErr = sqlite3ValueNew())!=0) ){
db->errCode = err_code; db->errCode = err_code;
if( zFormat ){ if( zFormat ){
char *z; char *z;
@@ -1337,7 +1337,8 @@ ThreadData *sqlite3ThreadData(){
** to a substitute ThreadData structure that is all zeros. ** to a substitute ThreadData structure that is all zeros.
*/ */
const ThreadData *sqlite3ThreadDataReadOnly(){ const ThreadData *sqlite3ThreadDataReadOnly(){
static const ThreadData zeroData; static const ThreadData zeroData = {0}; /* Initializer to silence warnings
** from broken compilers */
const ThreadData *pTd = sqlite3OsThreadSpecificData(0); const ThreadData *pTd = sqlite3OsThreadSpecificData(0);
return pTd ? pTd : &zeroData; return pTd ? pTd : &zeroData;
} }

View File

@@ -16,7 +16,7 @@
** so is applicable. Because this module is responsible for selecting ** so is applicable. Because this module is responsible for selecting
** indices, you might also think of this module as the "query optimizer". ** indices, you might also think of this module as the "query optimizer".
** **
** $Id: where.c,v 1.200 2006/01/20 18:10:57 drh Exp $ ** $Id: where.c,v 1.201 2006/01/23 13:00:38 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -40,16 +40,6 @@ int sqlite3_where_trace = 0;
# define TRACE(X) # define TRACE(X)
#endif #endif
/*
** A large value which is the maximum cost of using an index.
** By default this is a large floating point value. When compiling
** SQLite for a processor that lacks floating point support, simply
** redefine this constant to a large integer.
*/
#ifndef SQLITE_BIG_DBL
# define SQLITE_BIG_DBL (1.0e+99)
#endif
/* Forward reference /* Forward reference
*/ */
typedef struct WhereClause WhereClause; typedef struct WhereClause WhereClause;