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

First attempt at getting the build to work with Tcl 9.0.

FossilOrigin-Name: 6e5bb48a74d63fb8c30528f0005d1763cd2dbb882abf86baf1565721e6bfcf84
This commit is contained in:
drh
2024-07-30 15:49:02 +00:00
parent 07f215ad9e
commit 064b681e9b
56 changed files with 375 additions and 550 deletions

View File

@@ -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);