mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Fix some problems in test code detected by cppcheck.
FossilOrigin-Name: c9ff4ca4a0b44bbb8d6676144ddf77b04426e619
This commit is contained in:
@ -1636,6 +1636,7 @@ void sqlite3async_run(void){
|
||||
** Control/configure the asynchronous IO system.
|
||||
*/
|
||||
int sqlite3async_control(int op, ...){
|
||||
int rc = SQLITE_OK;
|
||||
va_list ap;
|
||||
va_start(ap, op);
|
||||
switch( op ){
|
||||
@ -1645,7 +1646,8 @@ int sqlite3async_control(int op, ...){
|
||||
&& eWhen!=SQLITEASYNC_HALT_NOW
|
||||
&& eWhen!=SQLITEASYNC_HALT_IDLE
|
||||
){
|
||||
return SQLITE_MISUSE;
|
||||
rc = SQLITE_MISUSE;
|
||||
break;
|
||||
}
|
||||
async.eHalt = eWhen;
|
||||
async_mutex_enter(ASYNC_MUTEX_QUEUE);
|
||||
@ -1657,7 +1659,8 @@ int sqlite3async_control(int op, ...){
|
||||
case SQLITEASYNC_DELAY: {
|
||||
int iDelay = va_arg(ap, int);
|
||||
if( iDelay<0 ){
|
||||
return SQLITE_MISUSE;
|
||||
rc = SQLITE_MISUSE;
|
||||
break;
|
||||
}
|
||||
async.ioDelay = iDelay;
|
||||
break;
|
||||
@ -1668,7 +1671,8 @@ int sqlite3async_control(int op, ...){
|
||||
async_mutex_enter(ASYNC_MUTEX_QUEUE);
|
||||
if( async.nFile || async.pQueueFirst ){
|
||||
async_mutex_leave(ASYNC_MUTEX_QUEUE);
|
||||
return SQLITE_MISUSE;
|
||||
rc = SQLITE_MISUSE;
|
||||
break;
|
||||
}
|
||||
async.bLockFiles = bLock;
|
||||
async_mutex_leave(ASYNC_MUTEX_QUEUE);
|
||||
@ -1692,9 +1696,11 @@ int sqlite3async_control(int op, ...){
|
||||
}
|
||||
|
||||
default:
|
||||
return SQLITE_ERROR;
|
||||
rc = SQLITE_ERROR;
|
||||
break;
|
||||
}
|
||||
return SQLITE_OK;
|
||||
va_end(ap);
|
||||
return rc;
|
||||
}
|
||||
|
||||
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ASYNCIO) */
|
||||
|
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Remove\sall\sreferences\sto\s"docid"\swithin\sfts5\ssource\scode\sand\scomments.\sReplace\swith\s"rowid".
|
||||
D 2015-08-05T07:43:46.226
|
||||
C Fix\ssome\sproblems\sin\stest\scode\sdetected\sby\scppcheck.
|
||||
D 2015-08-05T08:01:46.351
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in 2fc9ca6bf5949d415801c007ed3004a4bdb7c380
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@ -46,7 +46,7 @@ F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710
|
||||
F doc/vfs-shm.txt e101f27ea02a8387ce46a05be2b1a902a021d37a
|
||||
F ext/README.txt 913a7bd3f4837ab14d7e063304181787658b14e1
|
||||
F ext/async/README.txt e12275968f6fde133a80e04387d0e839b0c51f91
|
||||
F ext/async/sqlite3async.c b5a3e30f538a9ffe81538b3063b4d5963f9bb422
|
||||
F ext/async/sqlite3async.c 0f3070cc3f5ede78f2b9361fb3b629ce200d7d74
|
||||
F ext/async/sqlite3async.h f489b080af7e72aec0e1ee6f1d98ab6cf2e4dcef
|
||||
F ext/fts1/README.txt 20ac73b006a70bcfd80069bdaf59214b6cf1db5e
|
||||
F ext/fts1/ft_hash.c 3927bd880e65329bdc6f506555b228b28924921b
|
||||
@ -341,7 +341,7 @@ F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46
|
||||
F src/status.c f266ad8a2892d659b74f0f50cb6a88b6e7c12179
|
||||
F src/table.c 51b46b2a62d1b3a959633d593b89bab5e2c9155e
|
||||
F src/tclsqlite.c d9439b6a910985b7fff43ba6756bcef00de22649
|
||||
F src/test1.c ab312f4160fdd9c82e65e8b123e35ef17e879c07
|
||||
F src/test1.c d339ae9b9baf9221c657c9628c9061d88bd831f6
|
||||
F src/test2.c 577961fe48961b2f2e5c8b56ee50c3f459d3359d
|
||||
F src/test3.c 64d2afdd68feac1bb5e2ffb8226c8c639f798622
|
||||
F src/test4.c d168f83cc78d02e8d35567bb5630e40dcd85ac1e
|
||||
@ -1042,7 +1042,7 @@ F test/thread1.test df115faa10a4ba1d456e9d4d9ec165016903eae4
|
||||
F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46
|
||||
F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd
|
||||
F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b
|
||||
F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9
|
||||
F test/threadtest2.c a70a8e94bef23339d34226eb9521015ef99f4df8
|
||||
F test/threadtest3.c 9ab4b168681c3a6f70f6c833ba08e0d48dd4af9b
|
||||
F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925
|
||||
F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c
|
||||
@ -1369,7 +1369,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P 4f9520a9dc9c667b7fda5b0822de2bf48184ac99
|
||||
R 153c6052add689f67f7d9f0f8de05617
|
||||
P dffd358f6cbf575d3b1045b1ce53429d15bade2a
|
||||
R 03d664fe9a880098c608c861d0111d6e
|
||||
U dan
|
||||
Z 30ef1732a43193d523357d929916f315
|
||||
Z d772c3ac7a9d41bdcded0f7d87a12476
|
||||
|
@ -1 +1 @@
|
||||
dffd358f6cbf575d3b1045b1ce53429d15bade2a
|
||||
c9ff4ca4a0b44bbb8d6676144ddf77b04426e619
|
@ -338,7 +338,7 @@ static int test_exec_hex(
|
||||
int rc, i, j;
|
||||
char *zErr = 0;
|
||||
char *zHex;
|
||||
char zSql[500];
|
||||
char zSql[501];
|
||||
char zBuf[30];
|
||||
if( argc!=3 ){
|
||||
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
|
||||
@ -347,7 +347,7 @@ static int test_exec_hex(
|
||||
}
|
||||
if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
|
||||
zHex = argv[2];
|
||||
for(i=j=0; i<sizeof(zSql) && zHex[j]; i++, j++){
|
||||
for(i=j=0; i<(sizeof(zSql)-1) && zHex[j]; i++, j++){
|
||||
if( zHex[j]=='%' && zHex[j+2] && zHex[j+2] ){
|
||||
zSql[i] = (testHexToInt(zHex[j+1])<<4) + testHexToInt(zHex[j+2]);
|
||||
j += 2;
|
||||
|
@ -43,7 +43,7 @@ int check_callback(void *pid, int argc, char **argv, char **notUsed2){
|
||||
int id = (int)pid;
|
||||
if( strcmp(argv[0],"ok") ){
|
||||
all_stop = 1;
|
||||
fprintf(stderr,"id: %s\n", id, argv[0]);
|
||||
fprintf(stderr,"%d: %s\n", id, argv[0]);
|
||||
}else{
|
||||
/* fprintf(stderr,"%d: OK\n", id); */
|
||||
}
|
||||
|
Reference in New Issue
Block a user