diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/test1.c | 19 | ||||
-rw-r--r-- | src/test5.c | 3 | ||||
-rw-r--r-- | src/test_malloc.c | 10 | ||||
-rw-r--r-- | src/test_thread.c | 4 |
4 files changed, 14 insertions, 22 deletions
diff --git a/src/test1.c b/src/test1.c index 9cc5d6347..281823d5a 100644 --- a/src/test1.c +++ b/src/test1.c @@ -668,6 +668,7 @@ static int test_key( int argc, /* Number of arguments */ char **argv /* Text of each argument */ ){ +#ifdef SQLITE_HAS_CODEC sqlite3 *db; const char *zKey; int nKey; @@ -679,7 +680,6 @@ static int test_key( if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; zKey = argv[2]; nKey = strlen(zKey); -#ifdef SQLITE_HAS_CODEC sqlite3_key(db, zKey, nKey); #endif return TCL_OK; @@ -696,6 +696,7 @@ static int test_rekey( int argc, /* Number of arguments */ char **argv /* Text of each argument */ ){ +#ifdef SQLITE_HAS_CODEC sqlite3 *db; const char *zKey; int nKey; @@ -707,7 +708,6 @@ static int test_rekey( if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; zKey = argv[2]; nKey = strlen(zKey); -#ifdef SQLITE_HAS_CODEC sqlite3_rekey(db, zKey, nKey); #endif return TCL_OK; @@ -2369,7 +2369,6 @@ static int uses_stmt_journal( Tcl_Obj *CONST objv[] ){ sqlite3_stmt *pStmt; - int rc; if( objc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", @@ -2378,7 +2377,7 @@ static int uses_stmt_journal( } if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - rc = sqlite3_stmt_readonly(pStmt); + sqlite3_stmt_readonly(pStmt); Tcl_SetObjResult(interp, Tcl_NewBooleanObj(((Vdbe *)pStmt)->usesStmtJournal)); return TCL_OK; } @@ -3858,7 +3857,6 @@ static int test_open( ){ const char *zFilename; sqlite3 *db; - int rc; char zBuf[100]; if( objc!=3 && objc!=2 && objc!=1 ){ @@ -3868,7 +3866,7 @@ static int test_open( } zFilename = objc>1 ? Tcl_GetString(objv[1]) : 0; - rc = sqlite3_open(zFilename, &db); + sqlite3_open(zFilename, &db); if( sqlite3TestMakePointerStr(interp, zBuf, db) ) return TCL_ERROR; Tcl_AppendResult(interp, zBuf, 0); @@ -3957,7 +3955,6 @@ static int test_open16( #ifndef SQLITE_OMIT_UTF16 const void *zFilename; sqlite3 *db; - int rc; char zBuf[100]; if( objc!=3 ){ @@ -3967,7 +3964,7 @@ static int test_open16( } zFilename = Tcl_GetByteArrayFromObj(objv[1], 0); - rc = sqlite3_open16(zFilename, &db); + sqlite3_open16(zFilename, &db); if( sqlite3TestMakePointerStr(interp, zBuf, db) ) return TCL_ERROR; Tcl_AppendResult(interp, zBuf, 0); @@ -5114,8 +5111,6 @@ static int file_control_lockproxy_test( Tcl_Obj *CONST objv[] /* Command arguments */ ){ sqlite3 *db; - const char *zPwd; - int nPwd; if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", @@ -5125,7 +5120,6 @@ static int file_control_lockproxy_test( if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ return TCL_ERROR; } - zPwd = Tcl_GetStringFromObj(objv[2], &nPwd); #if !defined(SQLITE_ENABLE_LOCKING_STYLE) # if defined(__APPLE__) @@ -5138,8 +5132,11 @@ static int file_control_lockproxy_test( { char *testPath; int rc; + int nPwd; + const char *zPwd; char proxyPath[400]; + zPwd = Tcl_GetStringFromObj(objv[2], &nPwd); if( sizeof(proxyPath)<nPwd+20 ){ Tcl_AppendResult(interp, "PWD too big", (void*)0); return TCL_ERROR; diff --git a/src/test5.c b/src/test5.c index 504fdb8a9..303d1205b 100644 --- a/src/test5.c +++ b/src/test5.c @@ -64,7 +64,6 @@ static int test_value_overhead( int repeat_count; int i; Mem val; - const char *zVal; if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", @@ -82,7 +81,7 @@ static int test_value_overhead( for(i=0; i<repeat_count; i++){ if( do_calls ){ - zVal = (char*)sqlite3_value_text(&val); + sqlite3_value_text(&val); } } diff --git a/src/test_malloc.c b/src/test_malloc.c index e955d5790..037dfd140 100644 --- a/src/test_malloc.c +++ b/src/test_malloc.c @@ -713,14 +713,14 @@ static int test_memdebug_settitle( int objc, Tcl_Obj *CONST objv[] ){ - const char *zTitle; if( objc!=2 ){ Tcl_WrongNumArgs(interp, 1, objv, "TITLE"); return TCL_ERROR; } - zTitle = Tcl_GetString(objv[1]); #ifdef SQLITE_MEMDEBUG { + const char *zTitle; + zTitle = Tcl_GetString(objv[1]); extern int sqlite3MemdebugSettitle(const char*); sqlite3MemdebugSettitle(zTitle); } @@ -1033,7 +1033,6 @@ static int test_config_lookaside( int objc, Tcl_Obj *CONST objv[] ){ - int rc; int sz, cnt; Tcl_Obj *pRet; if( objc!=3 ){ @@ -1049,7 +1048,7 @@ static int test_config_lookaside( Tcl_ListObjAppendElement( interp, pRet, Tcl_NewIntObj(sqlite3GlobalConfig.nLookaside) ); - rc = sqlite3_config(SQLITE_CONFIG_LOOKASIDE, sz, cnt); + sqlite3_config(SQLITE_CONFIG_LOOKASIDE, sz, cnt); Tcl_SetObjResult(interp, pRet); return TCL_OK; } @@ -1106,7 +1105,6 @@ static int test_config_heap( Tcl_Obj *CONST objv[] ){ static char *zBuf; /* Use this memory */ - static int szBuf; /* Bytes allocated for zBuf */ int nByte; /* Size of buffer to pass to sqlite3_config() */ int nMinAlloc; /* Size of minimum allocation */ int rc; /* Return code of sqlite3_config() */ @@ -1124,11 +1122,9 @@ static int test_config_heap( if( nByte==0 ){ free( zBuf ); zBuf = 0; - szBuf = 0; rc = sqlite3_config(SQLITE_CONFIG_HEAP, (void*)0, 0, 0); }else{ zBuf = realloc(zBuf, nByte); - szBuf = nByte; rc = sqlite3_config(SQLITE_CONFIG_HEAP, zBuf, nByte, nMinAlloc); } diff --git a/src/test_thread.c b/src/test_thread.c index aa8946707..ae62de826 100644 --- a/src/test_thread.c +++ b/src/test_thread.c @@ -273,7 +273,6 @@ static int sqlthread_open( const char *zFilename; sqlite3 *db; - int rc; char zBuf[100]; extern void Md5_Register(sqlite3*); @@ -281,11 +280,12 @@ static int sqlthread_open( UNUSED_PARAMETER(objc); zFilename = Tcl_GetString(objv[2]); - rc = sqlite3_open(zFilename, &db); + sqlite3_open(zFilename, &db); #ifdef SQLITE_HAS_CODEC if( db && objc>=4 ){ const char *zKey; int nKey; + int rc; zKey = Tcl_GetStringFromObj(objv[3], &nKey); rc = sqlite3_key(db, zKey, nKey); if( rc!=SQLITE_OK ){ |