$OpenBSD: patch-src_test3_c,v 1.1 2005/12/21 07:58:32 jolan Exp $ --- src/test3.c.orig Sat Apr 23 17:43:22 2005 +++ src/test3.c Wed Dec 21 01:47:37 2005 @@ -19,9 +19,11 @@ #include "pager.h" #include "btree.h" #include "tcl.h" +#include "test-util.h" #include #include + /* ** Interpret an SQLite error number */ @@ -98,7 +100,7 @@ static int btree_close( " ID\"", 0); return TCL_ERROR; } - if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR; + pBt = sqliteTextToPtr(argv[1]); rc = sqliteBtreeClose(pBt); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, errorName(rc), 0); @@ -125,7 +127,7 @@ static int btree_begin_transaction( " ID\"", 0); return TCL_ERROR; } - if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR; + pBt = sqliteTextToPtr(argv[1]); rc = sqliteBtreeBeginTrans(pBt); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, errorName(rc), 0); @@ -152,7 +154,7 @@ static int btree_rollback( " ID\"", 0); return TCL_ERROR; } - if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR; + pBt = sqliteTextToPtr(argv[1]); rc = sqliteBtreeRollback(pBt); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, errorName(rc), 0); @@ -179,7 +181,7 @@ static int btree_commit( " ID\"", 0); return TCL_ERROR; } - if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR; + pBt = sqliteTextToPtr(argv[1]); rc = sqliteBtreeCommit(pBt); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, errorName(rc), 0); @@ -207,7 +209,7 @@ static int btree_create_table( " ID\"", 0); return TCL_ERROR; } - if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR; + pBt = sqliteTextToPtr(argv[1]); rc = sqliteBtreeCreateTable(pBt, &iTable); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, errorName(rc), 0); @@ -237,7 +239,7 @@ static int btree_drop_table( " ID TABLENUM\"", 0); return TCL_ERROR; } - if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR; + pBt = sqliteTextToPtr(argv[1]); if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR; rc = sqliteBtreeDropTable(pBt, iTable); if( rc!=SQLITE_OK ){ @@ -266,7 +268,7 @@ static int btree_clear_table( " ID TABLENUM\"", 0); return TCL_ERROR; } - if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR; + pBt = sqliteTextToPtr(argv[1]); if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR; rc = sqliteBtreeClearTable(pBt, iTable); if( rc!=SQLITE_OK ){ @@ -296,7 +298,7 @@ static int btree_get_meta( " ID\"", 0); return TCL_ERROR; } - if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR; + pBt = sqliteTextToPtr(argv[1]); rc = sqliteBtreeGetMeta(pBt, aMeta); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, errorName(rc), 0); @@ -333,7 +335,7 @@ static int btree_update_meta( " ID METADATA...\" (METADATA is ", zBuf, " integers)", 0); return TCL_ERROR; } - if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR; + pBt = sqliteTextToPtr(argv[1]); for(i=0; i