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

Fixes for compiler warnings. Minor code cleanup.

FossilOrigin-Name: 9604d13001e0a195718c7f03fc0e73e352226caa
This commit is contained in:
drh
2011-03-18 16:47:27 +00:00
parent 2635a3be20
commit 304637c026
9 changed files with 47 additions and 34 deletions

0
install-sh Normal file → Executable file
View File

View File

@@ -1,5 +1,8 @@
C Further\simprovements\sto\sdocumentation\sin\ssqlite3session.h. -----BEGIN PGP SIGNED MESSAGE-----
D 2011-03-18T16:13:53 Hash: SHA1
C Fixes\sfor\scompiler\swarnings.\s\sMinor\scode\scleanup.
D 2011-03-18T16:47:27.202
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 27701a1653595a1f2187dc61c8117e00a6c1d50f F Makefile.in 27701a1653595a1f2187dc61c8117e00a6c1d50f
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -102,7 +105,7 @@ F ext/rtree/viewrtree.tcl eea6224b3553599ae665b239bd827e182b466024
F ext/session/sqlite3session.c 4183792547af5b5d3ec1c8a3f858beb172682503 F ext/session/sqlite3session.c 4183792547af5b5d3ec1c8a3f858beb172682503
F ext/session/sqlite3session.h 9551c002efd5fde07c52994c6b592308e0df2d6a F ext/session/sqlite3session.h 9551c002efd5fde07c52994c6b592308e0df2d6a
F ext/session/test_session.c 2559ef68e421c7fb83e2c19ef08a17343b70d535 F ext/session/test_session.c 2559ef68e421c7fb83e2c19ef08a17343b70d535
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
F main.mk ae0868e05c76eaa8a0ae3d6927a949b1c8e810d7 F main.mk ae0868e05c76eaa8a0ae3d6927a949b1c8e810d7
F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a
@@ -183,11 +186,11 @@ F src/select.c d24406c45dd2442eb2eeaac413439066b149c944
F src/shell.c 4a5e0ad845475c84881f0b25b1abba2ddaab0a72 F src/shell.c 4a5e0ad845475c84881f0b25b1abba2ddaab0a72
F src/sqlite.h.in 208dc372c9b8d89ca962babcb7cb0c1b16d32bc4 F src/sqlite.h.in 208dc372c9b8d89ca962babcb7cb0c1b16d32bc4
F src/sqlite3ext.h c90bd5507099f62043832d73f6425d8d5c5da754 F src/sqlite3ext.h c90bd5507099f62043832d73f6425d8d5c5da754
F src/sqliteInt.h d65b832eb82bd3f04cd27a750698c7f4b3d9273a F src/sqliteInt.h e427f9cff8fcf85ea23f95eb8b70e4b588d24212
F src/sqliteLimit.h a17dcd3fb775d63b64a43a55c54cb282f9726f44 F src/sqliteLimit.h a17dcd3fb775d63b64a43a55c54cb282f9726f44
F src/status.c 4997380fbb915426fef9e500b4872e79c99267fc F src/status.c 4997380fbb915426fef9e500b4872e79c99267fc
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
F src/tclsqlite.c fc0321c62a3c3929b9b0659b94b7d37bac84e769 F src/tclsqlite.c 520e124994e68fd8804ade95b5d3e2e791d0958d
F src/test1.c 9020310c7617234b33fd1c3064f89524db25f290 F src/test1.c 9020310c7617234b33fd1c3064f89524db25f290
F src/test2.c 80d323d11e909cf0eb1b6fbb4ac22276483bcf31 F src/test2.c 80d323d11e909cf0eb1b6fbb4ac22276483bcf31
F src/test3.c 056093cfef69ff4227a6bdb9108564dc7f45e4bc F src/test3.c 056093cfef69ff4227a6bdb9108564dc7f45e4bc
@@ -237,8 +240,8 @@ F src/vacuum.c 924bd1bcee2dfb05376f79845bd3b4cec7b54b2f
F src/vdbe.c 94cd191b1b20b0124e09b056bbce3d09f79821b3 F src/vdbe.c 94cd191b1b20b0124e09b056bbce3d09f79821b3
F src/vdbe.h 4de0efb4b0fdaaa900cf419b35c458933ef1c6d2 F src/vdbe.h 4de0efb4b0fdaaa900cf419b35c458933ef1c6d2
F src/vdbeInt.h 20d13da932eed0667a2e2383a9cb0f80099a5fd3 F src/vdbeInt.h 20d13da932eed0667a2e2383a9cb0f80099a5fd3
F src/vdbeapi.c 988ee9420acf8c130d644e6d7282893efe927bbd F src/vdbeapi.c 0e53620e9a4889257eece201d517163d3093ee41
F src/vdbeaux.c bb194e1250a0e35e3a5e17e51631da858e23930a F src/vdbeaux.c 9807ae2e6974172b1d7b077327f862f6bd4dda2a
F src/vdbeblob.c 18955f0ee6b133cd08e1592010cb9a6b11e9984c F src/vdbeblob.c 18955f0ee6b133cd08e1592010cb9a6b11e9984c
F src/vdbemem.c 0498796b6ffbe45e32960d6a1f5adfb6e419883b F src/vdbemem.c 0498796b6ffbe45e32960d6a1f5adfb6e419883b
F src/vdbetrace.c 3ba13bc32bdf16d2bdea523245fd16736bed67b5 F src/vdbetrace.c 3ba13bc32bdf16d2bdea523245fd16736bed67b5
@@ -605,7 +608,7 @@ F test/permutations.test 5b2a4cb756ffb2407cb4743163668d1d769febb6
F test/pragma.test fdfc09067ea104a0c247a1a79d8093b56656f850 F test/pragma.test fdfc09067ea104a0c247a1a79d8093b56656f850
F test/pragma2.test 5364893491b9231dd170e3459bfc2e2342658b47 F test/pragma2.test 5364893491b9231dd170e3459bfc2e2342658b47
F test/printf.test 05970cde31b1a9f54bd75af60597be75a5c54fea F test/printf.test 05970cde31b1a9f54bd75af60597be75a5c54fea
F test/progress.test 5b075c3c790c7b2a61419bc199db87aaf48b8301 x F test/progress.test 5b075c3c790c7b2a61419bc199db87aaf48b8301
F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc
F test/quick.test 1681febc928d686362d50057c642f77a02c62e57 F test/quick.test 1681febc928d686362d50057c642f77a02c62e57
F test/quota.test ddafe133653093eb9a99ccd6264884ae43f9c9b8 F test/quota.test ddafe133653093eb9a99ccd6264884ae43f9c9b8
@@ -893,7 +896,7 @@ F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
F tool/lemon.c dfd81a51b6e27e469ba21d01a75ddf092d429027 F tool/lemon.c dfd81a51b6e27e469ba21d01a75ddf092d429027
F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc
F tool/mkkeywordhash.c d2e6b4a5965e23afb80fbe74bb54648cd371f309 F tool/mkkeywordhash.c d2e6b4a5965e23afb80fbe74bb54648cd371f309
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e x F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
F tool/mksqlite3c.tcl cf44512a48112b1ba09590548660a5a6877afdb3 F tool/mksqlite3c.tcl cf44512a48112b1ba09590548660a5a6877afdb3
F tool/mksqlite3h.tcl d76c226a5e8e1f3b5f6593bcabe5e98b3b1ec9ff F tool/mksqlite3h.tcl d76c226a5e8e1f3b5f6593bcabe5e98b3b1ec9ff
@@ -918,7 +921,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P bd94f4c8b1c4590c437030f0122015f1a37e2582 P 07019bb9e8d8f2445d1e0342f74ab520e9804cb5
R fb83d41281a4d5ba8505f15c6f6b6372 R e362c18925cab750a71fcf91528dddfb
U dan U drh
Z ff00d37e3af9047c8539a141cf64a629 Z 33df56341351167813c56b1a83010bf4
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFNg4yioxKgR168RlERAsv6AJ9WZ1HLGm+YuNBznpVVZgVxxs49RwCdFrGC
OY796dAcZJ0MQ5I3+TprmmI=
=87W+
-----END PGP SIGNATURE-----

View File

@@ -1 +1 @@
07019bb9e8d8f2445d1e0342f74ab520e9804cb5 9604d13001e0a195718c7f03fc0e73e352226caa

View File

@@ -2748,7 +2748,6 @@ void sqlite3PrngSaveState(void);
void sqlite3PrngRestoreState(void); void sqlite3PrngRestoreState(void);
void sqlite3PrngResetState(void); void sqlite3PrngResetState(void);
void sqlite3RollbackAll(sqlite3*); void sqlite3RollbackAll(sqlite3*);
void sqlite3TransactionHook(sqlite3 *, int, int);
void sqlite3CodeVerifySchema(Parse*, int); void sqlite3CodeVerifySchema(Parse*, int);
void sqlite3BeginTransaction(Parse*, int); void sqlite3BeginTransaction(Parse*, int);
void sqlite3CommitTransaction(Parse*); void sqlite3CommitTransaction(Parse*);

View File

@@ -1655,12 +1655,12 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
"errorcode", "eval", "exists", "errorcode", "eval", "exists",
"function", "incrblob", "interrupt", "function", "incrblob", "interrupt",
"last_insert_rowid", "nullvalue", "onecolumn", "last_insert_rowid", "nullvalue", "onecolumn",
"preupdate", "preupdate", "profile", "progress",
"profile", "progress", "rekey", "rekey", "restore", "rollback_hook",
"restore", "rollback_hook", "status", "status", "timeout", "total_changes",
"timeout", "total_changes", "trace", "trace", "transaction", "unlock_notify",
"transaction", "unlock_notify", "update_hook", "update_hook", "version", "wal_hook",
"version", "wal_hook", 0 0
}; };
enum DB_enum { enum DB_enum {
DB_AUTHORIZER, DB_BACKUP, DB_BUSY, DB_AUTHORIZER, DB_BACKUP, DB_BUSY,
@@ -1670,12 +1670,11 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
DB_ERRORCODE, DB_EVAL, DB_EXISTS, DB_ERRORCODE, DB_EVAL, DB_EXISTS,
DB_FUNCTION, DB_INCRBLOB, DB_INTERRUPT, DB_FUNCTION, DB_INCRBLOB, DB_INTERRUPT,
DB_LAST_INSERT_ROWID, DB_NULLVALUE, DB_ONECOLUMN, DB_LAST_INSERT_ROWID, DB_NULLVALUE, DB_ONECOLUMN,
DB_PREUPDATE, DB_PREUPDATE, DB_PROFILE, DB_PROGRESS,
DB_PROFILE, DB_PROGRESS, DB_REKEY, DB_REKEY, DB_RESTORE, DB_ROLLBACK_HOOK,
DB_RESTORE, DB_ROLLBACK_HOOK, DB_STATUS, DB_STATUS, DB_TIMEOUT, DB_TOTAL_CHANGES,
DB_TIMEOUT, DB_TOTAL_CHANGES, DB_TRACE, DB_TRACE, DB_TRANSACTION, DB_UNLOCK_NOTIFY,
DB_TRANSACTION, DB_UNLOCK_NOTIFY, DB_UPDATE_HOOK, DB_UPDATE_HOOK, DB_VERSION, DB_WAL_HOOK,
DB_VERSION, DB_WAL_HOOK
}; };
/* don't leave trailing commas on DB_enum, it confuses the AIX xlc compiler */ /* don't leave trailing commas on DB_enum, it confuses the AIX xlc compiler */
@@ -2845,6 +2844,12 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
break; break;
} }
/*
** $db preupdate_hook count
** $db preupdate_hook hook ?SCRIPT?
** $db preupdate_hook new INDEX
** $db preupdate_hook old INDEX
*/
case DB_PREUPDATE: { case DB_PREUPDATE: {
static const char *azSub[] = {"count", "hook", "new", "old", 0}; static const char *azSub[] = {"count", "hook", "new", "old", 0};
enum DbPreupdateSubCmd { enum DbPreupdateSubCmd {
@@ -2895,7 +2900,8 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
} }
if( rc==SQLITE_OK ){ if( rc==SQLITE_OK ){
Tcl_Obj *pObj = Tcl_NewStringObj(sqlite3_value_text(pValue), -1); Tcl_Obj *pObj;
pObj = Tcl_NewStringObj((char*)sqlite3_value_text(pValue), -1);
Tcl_SetObjResult(interp, pObj); Tcl_SetObjResult(interp, pObj);
}else{ }else{
Tcl_AppendResult(interp, sqlite3_errmsg(pDb->db), 0); Tcl_AppendResult(interp, sqlite3_errmsg(pDb->db), 0);
@@ -2915,8 +2921,6 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
case DB_WAL_HOOK: case DB_WAL_HOOK:
case DB_UPDATE_HOOK: case DB_UPDATE_HOOK:
case DB_ROLLBACK_HOOK: { case DB_ROLLBACK_HOOK: {
sqlite3 *db = pDb->db;
/* set ppHook to point at pUpdateHook or pRollbackHook, depending on /* set ppHook to point at pUpdateHook or pRollbackHook, depending on
** whether [$db update_hook] or [$db rollback_hook] was invoked. ** whether [$db update_hook] or [$db rollback_hook] was invoked.
*/ */

View File

@@ -1439,6 +1439,7 @@ int sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
goto preupdate_new_out; goto preupdate_new_out;
} }
} }
assert( iIdx>=0 && iIdx<p->pCsr->nField );
pMem = &p->aNew[iIdx]; pMem = &p->aNew[iIdx];
if( pMem->flags==0 ){ if( pMem->flags==0 ){
rc = sqlite3VdbeMemCopy(pMem, &p->v->aMem[p->iNewReg+1+iIdx]); rc = sqlite3VdbeMemCopy(pMem, &p->v->aMem[p->iNewReg+1+iIdx]);
@@ -1452,5 +1453,3 @@ int sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){
sqlite3Error(db, rc, 0); sqlite3Error(db, rc, 0);
return sqlite3ApiExit(db, rc); return sqlite3ApiExit(db, rc);
} }

View File

@@ -2813,6 +2813,7 @@ UnpackedRecord *sqlite3VdbeRecordUnpack(
pMem->db = pKeyInfo->db; pMem->db = pKeyInfo->db;
pMem->flags = 0; pMem->flags = 0;
pMem->zMalloc = pMem->z = 0; pMem->zMalloc = pMem->z = 0;
pMem->z = 0;
d += sqlite3VdbeSerialGet(&aKey[d], serial_type, pMem); d += sqlite3VdbeSerialGet(&aKey[d], serial_type, pMem);
pMem++; pMem++;
u++; u++;
@@ -3187,10 +3188,10 @@ void sqlite3VdbePreUpdateHook(
){ ){
sqlite3 *db = v->db; sqlite3 *db = v->db;
i64 iKey2; i64 iKey2;
PreUpdate preupdate; PreUpdate preupdate;
memset(&preupdate, 0, sizeof(PreUpdate));
assert( db->pPreUpdate==0 );
memset(&preupdate, 0, sizeof(PreUpdate));
if( op==SQLITE_UPDATE ){ if( op==SQLITE_UPDATE ){
iKey2 = v->aMem[iReg].u.i; iKey2 = v->aMem[iReg].u.i;
}else{ }else{

0
test/progress.test Executable file → Normal file
View File

0
tool/mkopts.tcl Executable file → Normal file
View File