aboutsummaryrefslogtreecommitdiff
path: root/src/test_vfs.c
diff options
context:
space:
mode:
authordrh <>2024-07-31 22:36:14 +0000
committerdrh <>2024-07-31 22:36:14 +0000
commita1291e79d3d0c8b6aa40b455151b988a92879e17 (patch)
tree7eca588d2e68bb910d8e9a7ce3957997309a2f79 /src/test_vfs.c
parent07f215ad9e3606253d9bc52d59e46a9c7d9a1b63 (diff)
parentb030bc698088aef9789763123de0f6dcd374cba4 (diff)
downloadsqlite-a1291e79d3d0c8b6aa40b455151b988a92879e17.tar.gz
sqlite-a1291e79d3d0c8b6aa40b455151b988a92879e17.zip
Fix the tclsqlite.c TCL interface module so that it works with both Tcl8 and
Tcl9. Make changes across the TCL-based test harness to enable SQLite to be tested with either Tcl8 or Tcl9. Get the --with-tcl= argument on the configure script working. Testing changes only - no changes to the SQLite core. I believe the previous merge attempt didn't work because of errors in the merge itself, not because of faults in the code. Trying again... FossilOrigin-Name: ea9d88f9ca3399bca83bf03893689a927b73e481604b94527e42de43f103eb46
Diffstat (limited to 'src/test_vfs.c')
-rw-r--r--src/test_vfs.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/test_vfs.c b/src/test_vfs.c
index 312e1a1be..9f84b4f80 100644
--- a/src/test_vfs.c
+++ b/src/test_vfs.c
@@ -28,11 +28,7 @@
#include "sqlite3.h"
#include "sqliteInt.h"
-#if defined(INCLUDE_SQLITE_TCL_H)
-# include "sqlite_tcl.h"
-#else
-# include "tcl.h"
-#endif
+#include "tclsqlite.h"
typedef struct Testvfs Testvfs;
typedef struct TestvfsShm TestvfsShm;
@@ -1150,15 +1146,15 @@ static int SQLITE_TCLAPI testvfs_obj_cmd(
return TCL_ERROR;
}
if( objc==4 ){
- int n;
+ Tcl_Size n;
u8 *a = Tcl_GetByteArrayFromObj(objv[3], &n);
int pgsz = pBuffer->pgsz;
if( pgsz==0 ) pgsz = 65536;
- for(i=0; i*pgsz<n; i++){
+ for(i=0; i*pgsz<(int)n; i++){
int nByte = pgsz;
tvfsAllocPage(pBuffer, i, pgsz);
if( n-i*pgsz<pgsz ){
- nByte = n;
+ nByte = (int)n;
}
memcpy(pBuffer->aPage[i], &a[i*pgsz], nByte);
}
@@ -1203,7 +1199,7 @@ static int SQLITE_TCLAPI testvfs_obj_cmd(
{ "xFileControl", TESTVFS_FCNTL_MASK },
};
Tcl_Obj **apElem = 0;
- int nElem = 0;
+ Tcl_Size nElem = 0;
int mask = 0;
if( objc!=3 ){
Tcl_WrongNumArgs(interp, 2, objv, "LIST");
@@ -1213,7 +1209,7 @@ static int SQLITE_TCLAPI testvfs_obj_cmd(
return TCL_ERROR;
}
Tcl_ResetResult(interp);
- for(i=0; i<nElem; i++){
+ for(i=0; i<(int)nElem; i++){
int iMethod;
char *zElem = Tcl_GetString(apElem[i]);
for(iMethod=0; iMethod<ArraySize(vfsmethod); iMethod++){
@@ -1239,7 +1235,7 @@ static int SQLITE_TCLAPI testvfs_obj_cmd(
*/
case CMD_SCRIPT: {
if( objc==3 ){
- int nByte;
+ Tcl_Size nByte;
if( p->pScript ){
Tcl_DecrRefCount(p->pScript);
p->pScript = 0;
@@ -1337,13 +1333,13 @@ static int SQLITE_TCLAPI testvfs_obj_cmd(
int j;
int iNew = 0;
Tcl_Obj **flags = 0;
- int nFlags = 0;
+ Tcl_Size nFlags = 0;
if( Tcl_ListObjGetElements(interp, objv[2], &nFlags, &flags) ){
return TCL_ERROR;
}
- for(j=0; j<nFlags; j++){
+ for(j=0; j<(int)nFlags; j++){
int idx = 0;
if( Tcl_GetIndexFromObjStruct(interp, flags[j], aFlag,
sizeof(aFlag[0]), "flag", 0, &idx)
@@ -1491,7 +1487,7 @@ static int SQLITE_TCLAPI testvfs_cmd(
if( objc<2 || 0!=(objc%2) ) goto bad_args;
for(i=2; i<objc; i += 2){
- int nSwitch;
+ Tcl_Size nSwitch;
char *zSwitch;
zSwitch = Tcl_GetStringFromObj(objv[i], &nSwitch);