From 064b681e9bb2a0230c312c5a48f0797f821b3074 Mon Sep 17 00:00:00 2001 From: drh <> Date: Tue, 30 Jul 2024 15:49:02 +0000 Subject: [PATCH] First attempt at getting the build to work with Tcl 9.0. FossilOrigin-Name: 6e5bb48a74d63fb8c30528f0005d1763cd2dbb882abf86baf1565721e6bfcf84 --- autoconf/tea/tclconfig/tcl.m4 | 2 +- autoconf/tea/win/rules.vc | 1 - ext/expert/test_expert.c | 10 +-- ext/fts3/fts3_test.c | 30 ++++----- ext/fts3/fts3_tokenizer.c | 6 +- ext/fts5/fts5_tcl.c | 43 ++++++------ ext/intck/test_intck.c | 8 +-- ext/rbu/test_rbu.c | 15 +---- ext/recover/test_recover.c | 4 +- ext/rtree/test_rtreedoc.c | 10 +-- ext/session/test_session.c | 73 +++++++++++---------- manifest | 120 ++++++++++++++++++---------------- manifest.uuid | 2 +- src/tclsqlite.c | 69 +++++++++---------- src/tclsqlite.h | 37 +++++++++++ src/test1.c | 33 +++++----- src/test2.c | 6 +- src/test3.c | 14 ++-- src/test4.c | 6 +- src/test5.c | 12 ++-- src/test6.c | 15 ++--- src/test8.c | 6 +- src/test9.c | 6 +- src/test_async.c | 11 +--- src/test_autoext.c | 9 +-- src/test_backup.c | 9 +-- src/test_bestindex.c | 14 ++-- src/test_blob.c | 20 +++--- src/test_btree.c | 6 +- src/test_config.c | 6 +- src/test_demovfs.c | 9 +-- src/test_fs.c | 7 +- src/test_func.c | 6 +- src/test_hexio.c | 42 ++++++------ src/test_init.c | 6 +- src/test_intarray.c | 9 +-- src/test_malloc.c | 13 ++-- src/test_md5.c | 9 +-- src/test_multiplex.c | 9 +-- src/test_mutex.c | 7 +- src/test_osinst.c | 9 +-- src/test_quota.c | 11 +--- src/test_rtree.c | 12 +--- src/test_schema.c | 6 +- src/test_superlock.c | 9 +-- src/test_syscall.c | 14 ++-- src/test_tclsh.c | 9 +-- src/test_tclvar.c | 14 ++-- src/test_thread.c | 14 ++-- src/test_vdbecov.c | 6 +- src/test_vfs.c | 24 +++---- src/test_window.c | 2 +- tool/mkmsvcmin.tcl | 4 +- tool/mkvsix.tcl | 4 +- tool/replace.tcl | 4 +- tool/restore_jrnl.tcl | 63 +++++++++--------- 56 files changed, 375 insertions(+), 550 deletions(-) create mode 100644 src/tclsqlite.h diff --git a/autoconf/tea/tclconfig/tcl.m4 b/autoconf/tea/tclconfig/tcl.m4 index c83d660e18..455a7964d1 100644 --- a/autoconf/tea/tclconfig/tcl.m4 +++ b/autoconf/tea/tclconfig/tcl.m4 @@ -4064,4 +4064,4 @@ AC_DEFUN([TEA_ZIPFS_SUPPORT], [ # Local Variables: # mode: autoconf -# End: \ No newline at end of file +# End: diff --git a/autoconf/tea/win/rules.vc b/autoconf/tea/win/rules.vc index 99471053c8..f09e2ea48e 100644 --- a/autoconf/tea/win/rules.vc +++ b/autoconf/tea/win/rules.vc @@ -708,4 +708,3 @@ TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" !message *** Link options '$(LINKERFLAGS)' !endif - diff --git a/ext/expert/test_expert.c b/ext/expert/test_expert.c index 064c1908a9..cae5d0f258 100644 --- a/ext/expert/test_expert.c +++ b/ext/expert/test_expert.c @@ -16,15 +16,7 @@ #include "sqlite3expert.h" #include #include - -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" #ifndef SQLITE_OMIT_VIRTUALTABLE diff --git a/ext/fts3/fts3_test.c b/ext/fts3/fts3_test.c index 49a8476bf3..09adbc06ce 100644 --- a/ext/fts3/fts3_test.c +++ b/ext/fts3/fts3_test.c @@ -18,14 +18,7 @@ ** that the sqlite3_tokenizer_module.xLanguage() method is invoked correctly. */ -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" #include #include @@ -167,7 +160,8 @@ static int SQLITE_TCLAPI fts3_near_match_cmd( Tcl_Obj *pPhrasecount = 0; Tcl_Obj **apExprToken; - int nExprToken; + Tcl_Size nExprToken; + Tcl_Size nn; UNUSED_PARAMETER(clientData); @@ -201,23 +195,25 @@ static int SQLITE_TCLAPI fts3_near_match_cmd( } } - rc = Tcl_ListObjGetElements(interp, objv[1], &doc.nToken, &apDocToken); + rc = Tcl_ListObjGetElements(interp, objv[1], &nn, &apDocToken); + doc.nToken = (int)nn; if( rc!=TCL_OK ) goto near_match_out; doc.aToken = (NearToken *)ckalloc(doc.nToken*sizeof(NearToken)); for(ii=0; iiz = Tcl_GetStringFromObj(apToken[jj], &pT->n); + Tcl_Size nn; + pT->z = Tcl_GetStringFromObj(apToken[jj], &nn); + pT->n = (int)nn; } - aPhrase[ii].nToken = nToken; + aPhrase[ii].nToken = (int)nToken; } for(ii=1; ii /* diff --git a/ext/fts5/fts5_tcl.c b/ext/fts5/fts5_tcl.c index c5b5f41f83..b67b037c45 100644 --- a/ext/fts5/fts5_tcl.c +++ b/ext/fts5/fts5_tcl.c @@ -14,14 +14,7 @@ #ifdef SQLITE_TEST -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" #ifdef SQLITE_ENABLE_FTS5 @@ -297,12 +290,12 @@ static int SQLITE_TCLAPI xF5tApi( break; } CASE(3, "xTokenize") { - int nText; + Tcl_Size nText; char *zText = Tcl_GetStringFromObj(objv[2], &nText); F5tFunction ctx; ctx.interp = interp; ctx.pScript = objv[3]; - rc = p->pApi->xTokenize(p->pFts, zText, nText, &ctx, xTokenizeCb); + rc = p->pApi->xTokenize(p->pFts, zText, (int)nText, &ctx, xTokenizeCb); if( rc==SQLITE_OK ){ Tcl_ResetResult(interp); } @@ -605,15 +598,16 @@ static void xF5tFunction( sqlite3_result_error(pCtx, Tcl_GetStringResult(p->interp), -1); }else{ Tcl_Obj *pVar = Tcl_GetObjResult(p->interp); - int n; const char *zType = (pVar->typePtr ? pVar->typePtr->name : ""); char c = zType[0]; if( c=='b' && strcmp(zType,"bytearray")==0 && pVar->bytes==0 ){ /* Only return a BLOB type if the Tcl variable is a bytearray and ** has no string representation. */ - unsigned char *data = Tcl_GetByteArrayFromObj(pVar, &n); - sqlite3_result_blob(pCtx, data, n, SQLITE_TRANSIENT); + Tcl_Size nn; + unsigned char *data = Tcl_GetByteArrayFromObj(pVar, &nn); + sqlite3_result_blob(pCtx, data, (int)nn, SQLITE_TRANSIENT); }else if( c=='b' && strcmp(zType,"boolean")==0 ){ + int n; Tcl_GetIntFromObj(0, pVar, &n); sqlite3_result_int(pCtx, n); }else if( c=='d' && strcmp(zType,"double")==0 ){ @@ -626,8 +620,9 @@ static void xF5tFunction( Tcl_GetWideIntFromObj(0, pVar, &v); sqlite3_result_int64(pCtx, v); }else{ - unsigned char *data = (unsigned char *)Tcl_GetStringFromObj(pVar, &n); - sqlite3_result_text(pCtx, (char *)data, n, SQLITE_TRANSIENT); + Tcl_Size nn; + unsigned char *data = (unsigned char *)Tcl_GetStringFromObj(pVar, &nn); + sqlite3_result_text(pCtx, (char*)data, (int)nn, SQLITE_TRANSIENT); } } } @@ -720,7 +715,7 @@ static int SQLITE_TCLAPI f5tTokenize( Tcl_Obj *CONST objv[] ){ char *zText; - int nText; + Tcl_Size nText; sqlite3 *db = 0; fts5_api *pApi = 0; Fts5Tokenizer *pTok = 0; @@ -729,7 +724,7 @@ static int SQLITE_TCLAPI f5tTokenize( void *pUserdata; int rc; - int nArg; + Tcl_Size nArg; const char **azArg; F5tTokenizeCtx ctx; @@ -761,7 +756,7 @@ static int SQLITE_TCLAPI f5tTokenize( return TCL_ERROR; } - rc = tokenizer.xCreate(pUserdata, &azArg[1], nArg-1, &pTok); + rc = tokenizer.xCreate(pUserdata, &azArg[1], (int)(nArg-1), &pTok); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, "error in tokenizer.xCreate()", 0); return TCL_ERROR; @@ -773,7 +768,7 @@ static int SQLITE_TCLAPI f5tTokenize( ctx.pRet = pRet; ctx.zInput = zText; rc = tokenizer.xTokenize( - pTok, (void*)&ctx, FTS5_TOKENIZE_DOCUMENT, zText, nText, xTokenizeCb2 + pTok, (void*)&ctx, FTS5_TOKENIZE_DOCUMENT, zText,(int)nText, xTokenizeCb2 ); tokenizer.xDelete(pTok); if( rc!=SQLITE_OK ){ @@ -928,13 +923,13 @@ static int SQLITE_TCLAPI f5tTokenizerReturn( F5tTokenizerContext *p = (F5tTokenizerContext*)clientData; int iStart; int iEnd; - int nToken; + Tcl_Size nToken; int tflags = 0; char *zToken; int rc; if( objc==5 ){ - int nArg; + Tcl_Size nArg; char *zArg = Tcl_GetStringFromObj(objv[1], &nArg); if( nArg<=10 && nArg>=2 && memcmp("-colocated", zArg, nArg)==0 ){ tflags |= FTS5_TOKEN_COLOCATED; @@ -959,7 +954,7 @@ static int SQLITE_TCLAPI f5tTokenizerReturn( return TCL_ERROR; } - rc = p->xToken(p->pCtx, tflags, zToken, nToken, iStart, iEnd); + rc = p->xToken(p->pCtx, tflags, zToken, (int)nToken, iStart, iEnd); Tcl_SetResult(interp, (char*)sqlite3ErrName(rc), TCL_VOLATILE); return rc==SQLITE_OK ? TCL_OK : TCL_ERROR; @@ -1083,7 +1078,7 @@ static int SQLITE_TCLAPI f5tTokenHash( Tcl_Obj *CONST objv[] ){ char *z; - int n; + Tcl_Size n; unsigned int iVal; int nSlot; @@ -1096,7 +1091,7 @@ static int SQLITE_TCLAPI f5tTokenHash( } z = Tcl_GetStringFromObj(objv[2], &n); - iVal = f5t_fts5HashKey(nSlot, z, n); + iVal = f5t_fts5HashKey(nSlot, z, (int)n); Tcl_SetObjResult(interp, Tcl_NewIntObj(iVal)); return TCL_OK; } diff --git a/ext/intck/test_intck.c b/ext/intck/test_intck.c index 412c9f201c..d3a619b503 100644 --- a/ext/intck/test_intck.c +++ b/ext/intck/test_intck.c @@ -15,13 +15,7 @@ #include "sqlite3.h" #include "sqlite3intck.h" - -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif - +#include "tclsqlite.h" #include #include diff --git a/ext/rbu/test_rbu.c b/ext/rbu/test_rbu.c index af794d80f8..969d6208d8 100644 --- a/ext/rbu/test_rbu.c +++ b/ext/rbu/test_rbu.c @@ -17,14 +17,7 @@ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU) #include "sqlite3rbu.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" #include #include @@ -432,11 +425,7 @@ int SqliteRbu_Init(Tcl_Interp *interp){ } #else -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" int SqliteRbu_Init(Tcl_Interp *interp){ return TCL_OK; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU) */ #endif /* defined(SQLITE_TEST) */ diff --git a/ext/recover/test_recover.c b/ext/recover/test_recover.c index ba8ef6da11..c1c0d88386 100644 --- a/ext/recover/test_recover.c +++ b/ext/recover/test_recover.c @@ -14,8 +14,7 @@ #include "sqlite3recover.h" #include "sqliteInt.h" - -#include +#include "tclsqlite.h" #include #ifndef SQLITE_OMIT_VIRTUALTABLE @@ -308,4 +307,3 @@ int TestRecover_Init(Tcl_Interp *interp){ #endif return TCL_OK; } - diff --git a/ext/rtree/test_rtreedoc.c b/ext/rtree/test_rtreedoc.c index cdbcb2e8dc..0c042d05a9 100644 --- a/ext/rtree/test_rtreedoc.c +++ b/ext/rtree/test_rtreedoc.c @@ -14,11 +14,7 @@ */ #include "sqlite3.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" /* Solely for the UNUSED_PARAMETER() macro. */ #include "sqliteInt.h" @@ -90,7 +86,7 @@ static int invokeTclGeomCb( if( rc!=TCL_OK ){ rc = SQLITE_ERROR; }else{ - int nObj = 0; + Tcl_Size nObj = 0; Tcl_Obj **aObj = 0; pRes = Tcl_GetObjResult(interp); @@ -279,7 +275,7 @@ static int box_query(sqlite3_rtree_query_info *pInfo){ if( rc==SQLITE_OK ){ double rScore = 0.0; - int nObj = 0; + Tcl_Size nObj = 0; int eP = 0; Tcl_Obj **aObj = 0; Tcl_Obj *pRes = Tcl_GetObjResult(interp); diff --git a/ext/session/test_session.c b/ext/session/test_session.c index 00c3c25068..79ad000e18 100644 --- a/ext/session/test_session.c +++ b/ext/session/test_session.c @@ -5,14 +5,7 @@ #include "sqlite3session.h" #include #include -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" #ifndef SQLITE_AMALGAMATION typedef unsigned char u8; @@ -517,11 +510,11 @@ struct TestConflictHandler { }; static int test_obj_eq_string(Tcl_Obj *p, const char *z){ - int n; - int nObj; + Tcl_Size n; + Tcl_Size nObj; char *zObj; - n = (int)strlen(z); + n = (Tcl_Size)strlen(z); zObj = Tcl_GetStringFromObj(p, &nObj); return (nObj==n && (n==0 || 0==memcmp(zObj, z, n))); @@ -796,7 +789,7 @@ static int SQLITE_TCLAPI testSqlite3changesetApply( Tcl_CmdInfo info; /* Database Tcl command (objv[1]) info */ int rc; /* Return code from changeset_invert() */ void *pChangeset; /* Buffer containing changeset */ - int nChangeset; /* Size of buffer aChangeset in bytes */ + Tcl_Size nChangeset; /* Size of buffer aChangeset in bytes */ TestConflictHandler ctx; TestStreamInput sStr; void *pRebase = 0; @@ -853,18 +846,18 @@ static int SQLITE_TCLAPI testSqlite3changesetApply( if( sStr.nStream==0 ){ if( bV2==0 ){ - rc = sqlite3changeset_apply(db, nChangeset, pChangeset, + rc = sqlite3changeset_apply(db, (int)nChangeset, pChangeset, (objc==5)?test_filter_handler:0, test_conflict_handler, (void *)&ctx ); }else{ - rc = sqlite3changeset_apply_v2(db, nChangeset, pChangeset, + rc = sqlite3changeset_apply_v2(db, (int)nChangeset, pChangeset, (objc==5)?test_filter_handler:0, test_conflict_handler, (void *)&ctx, &pRebase, &nRebase, flags ); } }else{ sStr.aData = (unsigned char*)pChangeset; - sStr.nData = nChangeset; + sStr.nData = (int)nChangeset; if( bV2==0 ){ rc = sqlite3changeset_apply_strm(db, testStreamInput, (void*)&sStr, (objc==5) ? test_filter_handler : 0, @@ -927,7 +920,7 @@ static int SQLITE_TCLAPI test_sqlite3changeset_apply_replace_all( Tcl_CmdInfo info; /* Database Tcl command (objv[1]) info */ int rc; /* Return code from changeset_invert() */ void *pChangeset; /* Buffer containing changeset */ - int nChangeset; /* Size of buffer aChangeset in bytes */ + Tcl_Size nChangeset; /* Size of buffer aChangeset in bytes */ if( objc!=3 ){ Tcl_WrongNumArgs(interp, 1, objv, "DB CHANGESET"); @@ -940,7 +933,8 @@ static int SQLITE_TCLAPI test_sqlite3changeset_apply_replace_all( db = *(sqlite3 **)info.objClientData; pChangeset = (void *)Tcl_GetByteArrayFromObj(objv[2], &nChangeset); - rc = sqlite3changeset_apply(db, nChangeset, pChangeset, 0, replace_handler,0); + rc = sqlite3changeset_apply(db, (int)nChangeset, pChangeset, + 0, replace_handler,0); if( rc!=SQLITE_OK ){ return test_session_error(interp, rc, 0); } @@ -959,6 +953,7 @@ static int SQLITE_TCLAPI test_sqlite3changeset_invert( Tcl_Obj *CONST objv[] ){ int rc; /* Return code from changeset_invert() */ + Tcl_Size nn; TestStreamInput sIn; /* Input stream */ TestSessionsBlob sOut; /* Output blob */ @@ -970,7 +965,8 @@ static int SQLITE_TCLAPI test_sqlite3changeset_invert( memset(&sIn, 0, sizeof(sIn)); memset(&sOut, 0, sizeof(sOut)); sIn.nStream = test_tcl_integer(interp, SESSION_STREAM_TCL_VAR); - sIn.aData = Tcl_GetByteArrayFromObj(objv[1], &sIn.nData); + sIn.aData = Tcl_GetByteArrayFromObj(objv[1], &nn); + sIn.nData = (int)nn; if( sIn.nStream ){ rc = sqlite3changeset_invert_strm( @@ -999,6 +995,7 @@ static int SQLITE_TCLAPI test_sqlite3changeset_concat( Tcl_Obj *CONST objv[] ){ int rc; /* Return code from changeset_invert() */ + Tcl_Size nn; TestStreamInput sLeft; /* Input stream */ TestStreamInput sRight; /* Input stream */ @@ -1011,8 +1008,10 @@ static int SQLITE_TCLAPI test_sqlite3changeset_concat( memset(&sLeft, 0, sizeof(sLeft)); memset(&sRight, 0, sizeof(sRight)); - sLeft.aData = Tcl_GetByteArrayFromObj(objv[1], &sLeft.nData); - sRight.aData = Tcl_GetByteArrayFromObj(objv[2], &sRight.nData); + sLeft.aData = Tcl_GetByteArrayFromObj(objv[1], &nn); + sLeft.nData = (int)nn; + sRight.aData = Tcl_GetByteArrayFromObj(objv[2], &nn); + sRight.nData = (int)nn; sLeft.nStream = test_tcl_integer(interp, SESSION_STREAM_TCL_VAR); sRight.nStream = sLeft.nStream; @@ -1106,7 +1105,7 @@ static int SQLITE_TCLAPI test_sqlite3session_foreach( Tcl_Obj *CONST objv[] ){ void *pChangeset; - int nChangeset; + Tcl_Size nChangeset; sqlite3_changeset_iter *pIter; int rc; Tcl_Obj *pVarname; @@ -1148,19 +1147,19 @@ static int SQLITE_TCLAPI test_sqlite3session_foreach( if( isInvert ){ int f = SQLITE_CHANGESETSTART_INVERT; if( sStr.nStream==0 ){ - rc = sqlite3changeset_start_v2(&pIter, nChangeset, pChangeset, f); + rc = sqlite3changeset_start_v2(&pIter, (int)nChangeset, pChangeset, f); }else{ void *pCtx = (void*)&sStr; sStr.aData = (unsigned char*)pChangeset; - sStr.nData = nChangeset; + sStr.nData = (int)nChangeset; rc = sqlite3changeset_start_v2_strm(&pIter, testStreamInput, pCtx, f); } }else{ if( sStr.nStream==0 ){ - rc = sqlite3changeset_start(&pIter, nChangeset, pChangeset); + rc = sqlite3changeset_start(&pIter, (int)nChangeset, pChangeset); }else{ sStr.aData = (unsigned char*)pChangeset; - sStr.nData = nChangeset; + sStr.nData = (int)nChangeset; rc = sqlite3changeset_start_strm(&pIter, testStreamInput, (void*)&sStr); } } @@ -1237,9 +1236,9 @@ static int SQLITE_TCLAPI test_rebaser_cmd( assert( rc==SQLITE_OK ); switch( iSub ){ case 0: { /* configure */ - int nRebase = 0; + Tcl_Size nRebase = 0; unsigned char *pRebase = Tcl_GetByteArrayFromObj(objv[2], &nRebase); - rc = sqlite3rebaser_configure(p, nRebase, pRebase); + rc = sqlite3rebaser_configure(p, (int)nRebase, pRebase); break; } @@ -1250,10 +1249,12 @@ static int SQLITE_TCLAPI test_rebaser_cmd( default: { /* rebase */ TestStreamInput sStr; /* Input stream */ TestSessionsBlob sOut; /* Output blob */ + Tcl_Size nn; memset(&sStr, 0, sizeof(sStr)); memset(&sOut, 0, sizeof(sOut)); - sStr.aData = Tcl_GetByteArrayFromObj(objv[2], &sStr.nData); + sStr.aData = Tcl_GetByteArrayFromObj(objv[2], &nn); + sStr.nData = nn; sStr.nStream = test_tcl_integer(interp, SESSION_STREAM_TCL_VAR); if( sStr.nStream ){ @@ -1392,7 +1393,7 @@ static int SQLITE_TCLAPI test_changeset( Tcl_Obj *CONST objv[] ){ void *pChangeset = 0; /* Buffer containing changeset */ - int nChangeset = 0; /* Size of buffer aChangeset in bytes */ + Tcl_Size nChangeset = 0; /* Size of buffer aChangeset in bytes */ int rc = SQLITE_OK; char *z = 0; @@ -1403,7 +1404,7 @@ static int SQLITE_TCLAPI test_changeset( pChangeset = (void *)Tcl_GetByteArrayFromObj(objv[1], &nChangeset); Tcl_ResetResult(interp); - rc = sqlite3_test_changeset(nChangeset, pChangeset, &z); + rc = sqlite3_test_changeset((int)nChangeset, pChangeset, &z); if( rc!=SQLITE_OK ){ char *zErr = sqlite3_mprintf("(%d) - \"%s\"", rc, z); Tcl_SetObjResult(interp, Tcl_NewStringObj(zErr, -1)); @@ -1528,9 +1529,9 @@ static int SQLITE_TCLAPI test_changegroup_cmd( }; case 1: { /* add */ - int nByte = 0; + Tcl_Size nByte = 0; const u8 *aByte = Tcl_GetByteArrayFromObj(objv[2], &nByte); - rc = sqlite3changegroup_add(p->pGrp, nByte, (void*)aByte); + rc = sqlite3changegroup_add(p->pGrp, (int)nByte, (void*)aByte); if( rc!=SQLITE_OK ) rc = test_session_error(interp, rc, 0); break; }; @@ -1678,7 +1679,7 @@ static int SQLITE_TCLAPI test_sqlite3changeset_start( ){ int isInvert = 0; void *pChangeset = 0; /* Buffer containing changeset */ - int nChangeset = 0; /* Size of buffer aChangeset in bytes */ + Tcl_Size nChangeset = 0; /* Size of buffer aChangeset in bytes */ TestChangeIter *pNew = 0; sqlite3_changeset_iter *pIter = 0; int flags = 0; @@ -1688,9 +1689,9 @@ static int SQLITE_TCLAPI test_sqlite3changeset_start( char zCmd[64]; if( objc==3 ){ - int n = 0; + Tcl_Size n = 0; const char *z = Tcl_GetStringFromObj(objv[1], &n); - isInvert = (n>=2 && sqlite3_strnicmp(z, "-invert", n)==0); + isInvert = (n>=2 && sqlite3_strnicmp(z, "-invert", (int)n)==0); } if( objc!=2 && (objc!=3 || !isInvert) ){ @@ -1700,7 +1701,7 @@ static int SQLITE_TCLAPI test_sqlite3changeset_start( flags = isInvert ? SQLITE_CHANGESETSTART_INVERT : 0; pChangeset = (void *)Tcl_GetByteArrayFromObj(objv[objc-1], &nChangeset); - rc = sqlite3changeset_start_v2(&pIter, nChangeset, pChangeset, flags); + rc = sqlite3changeset_start_v2(&pIter, (int)nChangeset, pChangeset, flags); if( rc!=SQLITE_OK ){ char *zErr = sqlite3_mprintf( "error in sqlite3changeset_start_v2() - %d", rc diff --git a/manifest b/manifest index 3fab5b62af..7821b9bd42 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sdocumentation\stypo.\s\n[forum:/forumpost/993cb82402|Forum\spost\s993cb82402] -D 2024-07-27T20:28:13.014 +C First\sattempt\sat\sgetting\sthe\sbuild\sto\swork\swith\sTcl\s9.0. +D 2024-07-30T15:49:02.043 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -29,10 +29,10 @@ F autoconf/tea/doc/sqlite3.n e1fe45d4f5286ee3d0ccc877aca2a0def488e9bb F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523 F autoconf/tea/pkgIndex.tcl.in b9eb6dd37f64e08e637d576b3c83259814b9cddd78bec4af2e5abfc6c5c750ce F autoconf/tea/tclconfig/install-sh bdd5e293591621ae60d9824d86a4b1c5f22c3d00 -F autoconf/tea/tclconfig/tcl.m4 debe13280bd5a9d76dc34e7919cd9ed3a1408c7320400900357128c2d1abb723 +F autoconf/tea/tclconfig/tcl.m4 c6e5f2fc7178f40d087403daa044ef3b86a8e30793f3b121bdcbdf152c6a776a F autoconf/tea/win/makefile.vc 2c478a9a962e48b2bf9062734e04d7c63c556e217095419173f9d7938d7d78f7 F autoconf/tea/win/nmakehlp.c b01f822eabbe1ed2b64e70882d97d48402b42d2689a1ea00342d1a1a7eaa19cb -F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63 +F autoconf/tea/win/rules.vc 7b3bb2ef32ade0f3f14d951231811678722725e3bca240dd9727ae0dfe10f6a5 F config.guess 883205ddf25b46f10c181818bf42c09da9888884af96f79e1719264345053bd6 F config.sub c2d0260f17f3e4bc0b6808fccf1b291cb5e9126c14fc5890efc77b9fd0175559 F configure 27d144c2edfa993ac155a2ad5e6b431e4ec811159598ef55a59f345bc2e5e533 x @@ -60,7 +60,7 @@ F ext/expert/expert.c d548d603a4cc9e61f446cc179c120c6713511c413f82a4a32b1e1e69d3 F ext/expert/expert1.test 53a749de08939e3bc14f804e97410927d46fa772cbce0247d7e8fa6fc2523b0c F ext/expert/sqlite3expert.c c8cea5ff15fbe792cccc4992a9b40b706411c41d32611f617897fecac6ff06a4 F ext/expert/sqlite3expert.h ca81efc2679a92373a13a3e76a6138d0310e32be53d6c3bfaedabd158ea8969b -F ext/expert/test_expert.c d56c194b769bdc90cf829a14c9ecbc1edca9c850b837a4d0b13be14095c32a72 +F ext/expert/test_expert.c b767b2039a0df707eb3147e86bcf68b252d8455d9a41774b1a836cd052ceca70 F ext/fts3/README.content b9078d0843a094d86af0d48dffbff13c906702b4c3558012e67b9c7cc3bf59ee F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a F ext/fts3/README.tokenizers b92bdeb8b46503f0dd301d364efc5ef59ef9fa8e2758b8e742f39fa93a2e422d @@ -76,9 +76,9 @@ F ext/fts3/fts3_icu.c 305ce7fb6036484085b5556a9c8e62acdc7763f0f4cdf5fd538212a9f3 F ext/fts3/fts3_porter.c e19807ce0ae31c1c6e9898e89ecc93183d7ec224ea101af039722a4f49e5f2b8 F ext/fts3/fts3_snippet.c 610328fe128c047c6b0eba77768982ccf3933daae095d497949a75c9dfd47409 F ext/fts3/fts3_term.c 6a96027ad364001432545fe43322b6af04ed28bb5619ec51af1f59d0710d6d69 -F ext/fts3/fts3_test.c d8d7b2734f894e8a489987447658e374cdd3a3bc8575c401decf1911cb7c6454 +F ext/fts3/fts3_test.c a17e6c6249a58279617f9f57220ad85f3f343d9f002d721967939a1624f55b4a F ext/fts3/fts3_tokenize_vtab.c 7fd9ef364f257b97218b9c331f2378e307375c592f70fd541f714e747d944962 -F ext/fts3/fts3_tokenizer.c 6d8fc150c48238955d5182bf661498db0dd473c8a2a80e00c16994a646fa96e7 +F ext/fts3/fts3_tokenizer.c defede96b5dd5d658edfae77355b9c31ea65236eedc7bbe1adbc50d645cca5bc F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3 F ext/fts3/fts3_tokenizer1.c c1de4ae28356ad98ccb8b2e3388a7fdcce7607b5523738c9afb6275dab765154 F ext/fts3/fts3_unicode.c de426ff05c1c2e7bce161cf6b706638419c3a1d9c2667de9cb9dc0458c18e226 @@ -102,7 +102,7 @@ F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a F ext/fts5/fts5_index.c eb9a0dda3bc6ef969a6be8d2746af56856e67251810ddba08622b45be8477abe F ext/fts5/fts5_main.c 77fefb37e7931095a5ff271a28fbe4f73ec46d5492ef1f35d405d98e137ad8ed F ext/fts5/fts5_storage.c 1d7e08d4331da2f3f7e78e70eef2ed6a013d91ba16175c651adbc5ad672235aa -F ext/fts5/fts5_tcl.c fdf7e2bb9a9186cfcaf2d2ce11d338309342b7a7593c2812bc54455db53da5d2 +F ext/fts5/fts5_tcl.c 5ca3e3e35010d326f5b821a563e4fcde3913e052935f5c2c72c264122a26b48f F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee F ext/fts5/fts5_test_tok.c 3cb0a9b508b30d17ef025ccddd26ae3dc8ddffbe76c057616e59a9aa85d36f3b F ext/fts5/fts5_tokenize.c fa5493075101540270f572038fc1723d44fcc97bfbf237c8530013b8a27860be @@ -259,7 +259,7 @@ F ext/intck/intckcorrupt.test f6c302792326fb3db9dcfc70b554c55369bc4b52882eaaf039 F ext/intck/intckfault.test cff3f75dff74abb3edfcb13f6aa53f6436746ab64b09fe5e2028f051e985efab F ext/intck/sqlite3intck.c 0d10df36e2b7b438aa80ecd3f5e584d41b747586b038258fe6b407f66b81e7c5 F ext/intck/sqlite3intck.h 2b40c38e7063ab822c974c0bd4aed97dabb579ccfe2e180a4639bb3bbef0f1c9 -F ext/intck/test_intck.c 6050ed1f3e11eb58c66ed20f75af43dec0e37c88c9089b98b8a0a26022735dc3 +F ext/intck/test_intck.c 4f9eaadaedccb9df1d26ba41116a0a8e5b0c5556dc3098c8ff68633adcccdea8 F ext/jni/GNUmakefile 59eb05f2a363bdfac8d15d66bed624bfe1ff289229184f3861b95f98a19cf4b2 F ext/jni/README.md d899789a9082a07b99bf30b1bbb6204ae57c060efcaa634536fa669323918f42 F ext/jni/jar-dist.make 030aaa4ae71dd86e4ec5e7c1e6cd86f9dfa47c4592c070d2e35157e42498e1fa @@ -479,7 +479,7 @@ F ext/rbu/rbuvacuum3.test 3ce42695fdf21aaa3499e857d7d4253bc499ad759bcd6c9362042c F ext/rbu/rbuvacuum4.test ffccd22f67e2d0b380d2889685742159dfe0d19a3880ca3d2d1d69eefaebb205 F ext/rbu/sqlite3rbu.c 4a3376c0fb9a844a799ac529fb81260523f6b13c9f629bc270c632dbae5fc1f8 F ext/rbu/sqlite3rbu.h 9d923eb135c5d04aa6afd7c39ca47b0d1d0707c100e02f19fdde6a494e414304 -F ext/rbu/test_rbu.c ee6ede75147bc081fe9bc3931e6b206277418d14d3fbceea6fdc6216d9b47055 +F ext/rbu/test_rbu.c b9727c3394307d058e806c1da0f8bb7b24daf3c6bb94cb10cca88ea4d5c806c0 F ext/recover/dbdata.c a22ecd689f00ff2ad33b5633c4ef84c8f088c65faeac18d4eb73c128395c7aec F ext/recover/recover1.test e16d78e94183562abff569967b18b7c77451d7044365516cd0fe14713a284851 F ext/recover/recover_common.tcl a61306c1eb45c0c3fc45652c35b2d4ec19729e340bdf65a272ce4c229cefd85a @@ -498,7 +498,7 @@ F ext/recover/recoverslowidx.test 5205a9742dd9490ee99950dabb622307355ef1662dea6a F ext/recover/recoversql.test e66d01f95302a223bcd3fd42b5ee58dc2b53d70afa90b0d00e41e4b8eab20486 F ext/recover/sqlite3recover.c 65ef0f56301a16c0536c9839fb7e23540c9c4f75da0afe3b7b4d163c8f624404 F ext/recover/sqlite3recover.h 011c799f02deb70ab685916f6f538e6bb32c4e0025e79bfd0e24ff9c74820959 -F ext/recover/test_recover.c fd871a40f2238022bedcbdf3cb493b91225edaa94d6ae8892af97a10e7ccc4ba +F ext/recover/test_recover.c 072260d7452a3b81aba995b2b3269e7ec2aa7f06725544ba4c25b1b0a1dbc61a F ext/repair/README.md 92f5e8aae749a4dae14f02eea8e1bb42d4db2b6ce5e83dbcdd6b1446997e0c15 F ext/repair/checkfreelist.c e21f06995ff4efdc1622dcceaea4dcba2caa83ca2f31a1607b98a8509168a996 F ext/repair/checkindex.c af5c66463f51462d8a6f796b2c44ef8cfa1116bbdc35a15da07c67a705388bfd @@ -541,7 +541,7 @@ F ext/rtree/rtreedoc2.test 194ebb7d561452dcdc10bf03f44e30c082c2f0c14efeb07f5e02c F ext/rtree/rtreedoc3.test 555a878c4d79c4e37fa439a1c3b02ee65d3ebaf75d9e8d96a9c55d66db3efbf8 F ext/rtree/rtreefuzz001.test 44f680a23dbe00d1061dbde381d711119099846d166580c4381e402b9d62cb74 F ext/rtree/sqlite3rtree.h 03c8db3261e435fbddcfc961471795cbf12b24e03001d0015b2636b0f3881373 -F ext/rtree/test_rtreedoc.c de76b3472bc74b788d079342fdede22ff598796dd3d97acffe46e09228af83a3 +F ext/rtree/test_rtreedoc.c d20f51d1ad69c72947a4ac72194e5a12e70b3464e7492538fcef66fa871c5081 F ext/rtree/tkt3363.test 142ab96eded44a3615ec79fba98c7bde7d0f96de F ext/rtree/util/randomshape.tcl 54ee03d0d4a1c621806f7f44d5b78d2db8fac26e0e8687c36c4bd0203b27dbff F ext/rtree/viewrtree.tcl eea6224b3553599ae665b239bd827e182b466024 @@ -588,7 +588,7 @@ F ext/session/sessionstat1.test 5e718d5888c0c49bbb33a7a4f816366db85f59f6a4f97544 F ext/session/sessionwor.test 6fd9a2256442cebde5b2284936ae9e0d54bde692d0f5fd009ecef8511f4cf3fc F ext/session/sqlite3session.c c7473aafbd88f796391a8c25aa90975a8f3729ab7f4f8cf74ab9d3b014e10abe F ext/session/sqlite3session.h 683ccbf16e2c2521661fc4c1cf918ce57002039efbcabcd8097fa4bca569104b -F ext/session/test_session.c 8bcc857125372e640f75ab63b4188080f9bbab92b65f86dfd160721c574b2044 +F ext/session/test_session.c 6acbe67db80ab0806147eb62a12f9e3a44930f4a740b68b0a4340dddda2c10d7 F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3 F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb @@ -768,57 +768,58 @@ F src/sqliteInt.h b77218c425891c7c90506c77fd2eb13bae03628d065b44fffeb37401cd955a F src/sqliteLimit.h 6878ab64bdeb8c24a1d762d45635e34b96da21132179023338c93f820eee6728 F src/status.c cb11f8589a6912af2da3bb1ec509a94dd8ef27df4d4c1a97e0bcf2309ece972b F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 -F src/tclsqlite.c ecbc3c99c0d0c3ed122a913f143026c26d38d57f33e06bb71185dd5c1efe37cd -F src/test1.c 6bd203421934f2af4d4a4b673f609879f1e0c35164f7e21d0d6cdc0da2eeee8f -F src/test2.c 54520d0565ef2b9bf0f8f1dcac43dc4d06baf4ffe13d10905f8d8c3ad3e4b9ab -F src/test3.c e5178558c41ff53236ae0271e9acb3d6885a94981d2eb939536ee6474598840e -F src/test4.c 4533b76419e7feb41b40582554663ed3cd77aaa54e135cf76b3205098cd6e664 -F src/test5.c 328aae2c010c57a9829d255dc099d6899311672d -F src/test6.c e53bc69dc3cb3815fb74df74f38159ec05ba6dd5273216062e26bc797f925530 -F src/test8.c 303c2e3bcf7795e888810a7ef03809602b851f0ebec8d6e06a429ed85cafd9a2 -F src/test9.c 12e5ba554d2d1cbe0158f6ab3f7ffcd7a86ee4e5 -F src/test_async.c 195ab49da082053fdb0f949c114b806a49ca770a -F src/test_autoext.c 915d245e736652a219a907909bb6710f0d587871 -F src/test_backup.c bf5da90c9926df0a4b941f2d92825a01bbe090a0 -F src/test_bestindex.c 1b5a1407b66c5caa67cfe1d93d96de5ec5d9d516bc69eb512482f85c037858c3 -F src/test_blob.c ae4a0620b478548afb67963095a7417cd06a4ec0a56adb453542203bfdcb31ce -F src/test_btree.c 8b2dc8b8848cf3a4db93f11578f075e82252a274 -F src/test_config.c 5fa77ee6064ba546e144c4fea870c5ede2c54314616f81485c6a9c4192100c75 +F src/tclsqlite.c f4753c1c90964a89f2c094f62bcb413fdefe0215c73c2d4fca4e8c50ace7a1f6 +F src/tclsqlite.h f3dc9ed1464a7cc775a47da70ac6f23e95d0fb939dd7eaf48639778f94d5aaad w src/tclinterface.h +F src/test1.c 9f01a43b5d9d0c08c31617f3ab4e924bb30cd47db784527dbf6a309456a4db3b +F src/test2.c 7ebc518e6735939d8979273a6f7b1d9b5702babf059f6ad62499f7f60a9eb9a3 +F src/test3.c e7573aa0f78ee4e070a4bc8c3493941c1aa64d5c66d4825c74c0f055451f432b +F src/test4.c 13e57ae7ec7a959ee180970aef09deed141252fe9bb07c61054f0dfa4f1dfd5d +F src/test5.c bb87279ed12e199486894e6c83e58dc8cd1de9524ace171d59219d3ab696a0c1 +F src/test6.c 763b92489f11f4a77b773f0d3b8369ab0edd5292ac794043062c337019f12d8a +F src/test8.c 206d8f3cc73950d252906656e2646b5de0d580b07187b635fcb3edd8c2c5fbc0 +F src/test9.c 7a708ad27f8fda79113e5e15de66632710958c401e64c2f22bc04e2f5a7a1b62 +F src/test_async.c 0101173cf8137ba5473a84a695281fa9dedc2a1d155998c68623f2978017ad98 +F src/test_autoext.c 14d4bbd3d0bd1eec0f6d16b29e28cf1e2d0b020d454835f0721a5f68121ac10f +F src/test_backup.c bd901e3c116c7f3b3bbbd4aae4ce87d99b400c9cbb0a9e7b4610af451d9719a7 +F src/test_bestindex.c 3401bee51665cbf7f9ed2552b5795452a8b86365e4c9ece745b54155a55670c6 +F src/test_blob.c bcdf6a6c22d0bcc13c41479d63692ef413add2a4d30e1e26b9f74ab85b9fb4d5 +F src/test_btree.c 28283787d32b8fa953eb77412ad0de2c9895260e4e5bd5a94b3c7411664f90d5 +F src/test_config.c 46eaf39842cace9d540aeefb50fe24dd3204a622893a97952cbb49c20b2f8b21 F src/test_delete.c e2fe07646dff6300b48d49b2fee2fe192ed389e834dd635e3b3bac0ce0bf9f8f -F src/test_demovfs.c 38a459d1c78fd9afa770445b224c485e079018d6ac07332ff9bd07b54d2b8ce9 +F src/test_demovfs.c 3efa2adf4f21e10d95521721687d5ca047aea91fa62dd8cc22ac9e5a9c942383 F src/test_devsym.c 649434ed34d0b03fbd5a6b42df80f0f9a7e53f94dd1710aad5dd8831e91c4e86 -F src/test_fs.c 56cc17e4fdc57efa61695026e2ba96e910b17060d7ee01d775ec048791522e2f -F src/test_func.c 4d2dc7e3e0946e55091784ddaf0302294f2ee300614f6f3e19a4b38df77d5167 -F src/test_hexio.c 9478e56a0f08e07841a014a93b20e4ba2709ab56d039d1ca8020e26846aa19bd -F src/test_init.c f2cc4774b7c9140f76e45ecbb2ae219f68e3acbbe248c0179db666a70eae9f08 -F src/test_intarray.c 26ffba666beb658d73cd925d9b4fb56913a3ca9aaeac122b3691436abb192b92 +F src/test_fs.c c411c40baba679536fc34e2679349f59d8225570aed3488b5b3ef1908525a3d5 +F src/test_func.c 8c0e89192f70fac307822d1ac2911ee51751288780b3db0c5ab5ca75fa0fe851 +F src/test_hexio.c af6db9300edd2d7b786a2d40d64177cad4b8ee22085e8ca5fe812cdeffdb6502 +F src/test_init.c 17313332d58e90defc527129d5eda4a08bd6b6e8de7207a231523c8d98fb445e +F src/test_intarray.c e4216aadee9df2de7d1aee7e70f6b22c80ee79ece72a63d57105db74217639e5 F src/test_intarray.h 6c3534641108cd1bea517a8e117dcba237081310a29a4c35bd2190caa8972293 F src/test_journal.c a0b9709b2f12b1ec819eea8a1176f283bca6d688a6d4a502bd6fd79786f4e287 F src/test_loadext.c 337056bae59f80b9eb00ba82088b39d0f4fe6dfd -F src/test_malloc.c 21121ea85b49ec0bdb69995847cef9036ef9beca3ce63bbb776e4ea2ecc44b97 -F src/test_md5.c 0472c86d561f7f9e4ff94080100c2783196f50e583bb83375b759450c5b81802 -F src/test_multiplex.c 70479161239d65af2a231550b270e9d11ece717ad7bf0e13ef42206586e9dd7f +F src/test_malloc.c a0295e022103b14a1bc5e0660cc2af7fbec05e0d029098782e326e50612e69d9 +F src/test_md5.c 811a45330c9391933360f998156a8907ee29909c828ab83ac05d329942cbea8f +F src/test_multiplex.c b99d7f43ec859e6b93a40aaa5455420b3ad133053cce3db739498d29ea30735f F src/test_multiplex.h f0ff5b6f4462bfd46dac165d6375b9530d08089b7bcbe75e88e0926110db5363 -F src/test_mutex.c cd5bac43f2fd168f43c4326b1febe0966439217fac52afb270a6b8215f94cb40 +F src/test_mutex.c f10fcbc2086b19c7b0ddf2752caf2095e42be74d8d7f6093619445b43b1f777b F src/test_onefile.c f31e52e891c5fef6709b9fcef54ce660648a34172423a9cbdf4cbce3ba0049f4 -F src/test_osinst.c 8e11faf10f5d4df10d3450ecee0b8f4cfa2b62e0f341fafbeb480a08cefeaec4 +F src/test_osinst.c 7aa3feaa3a1da1b5f75bde2ce958dbfe14ec484f065bb2b5b9727d8851fa089b F src/test_pcache.c 496da3f7e2ca66aefbc36bbf22138b1eff43ba0dff175c228b760fa020a37bd0 -F src/test_quota.c ea44c05f29b995bdb71c55eb0c602604884e55681d59b7736e604bbcc68b0464 +F src/test_quota.c 07369655d24c3f3fbdbd8fd8f42e856a054a7497846ca1c83ed4be68152a251f F src/test_quota.h 2a8ad1952d1d2ca9af0ce0465e56e6c023b5e15d -F src/test_rtree.c 671f3fae50ff116ef2e32a3bf1fe21b5615b4b7b -F src/test_schema.c cbfd7a9a9b6b40d4377d0c76a6c5b2a58387385977f26edab4e77eb5f90a14ce +F src/test_rtree.c d844d746a3cc027247318b970025a927f14772339c991f40e7911583ea5ed0d9 +F src/test_schema.c b06d3ddc3edc173c143878f3edb869dd200d57d918ae2f38820534f9a5e3d7d9 F src/test_sqllog.c 540feaea7280cd5f926168aee9deb1065ae136d0bbbe7361e2ef3541783e187a -F src/test_superlock.c 4839644b9201da822f181c5bc406c0b2385f672e -F src/test_syscall.c 9fdb13b1df05e639808d44fcb8f6064aaded32b6565c00b215cfd05a060d1aca -F src/test_tclsh.c aaf0d1de4a518a8db5ad38e5262be3e48b4a74ad1909f2dba753cecb30979d5d -F src/test_tclvar.c 3273f9d59395b336e381b53cfc68ec6ebdaada4e93106a2e976ffb0550504e1c -F src/test_thread.c 7ddcf0c8b79fa3c1d172f82f322302c963d923cdb503c6171f3c8081586d0b01 -F src/test_vdbecov.c f60c6f135ec42c0de013a1d5136777aa328a776d33277f92abac648930453d43 -F src/test_vfs.c 193c18da3dbf62a0e33ae7a240bbef938a50846672ee947664512b77d853fe81 +F src/test_superlock.c 18355ca274746aa6909e3744163e5deb1196a85d5bc64b9cd377273cef626da7 +F src/test_syscall.c 9ad7ab39910c16d29411678d91b0d27a7a996a718df5ee93dcd635e846d0275c +F src/test_tclsh.c 6077f2bdc6b4ea2bace2a0cd6ea48e0a4651007ae7382c13efc0c495eb0c6956 +F src/test_tclvar.c 2c42fe9a74af0f3c8f87a339f66d9d3bd3a967fb5db1ed2500348055b954e391 +F src/test_thread.c d7a8bcea7445f37cc2a1f7f81dd6059634f45e0c61bfe80182b02872fb0328bb +F src/test_vdbecov.c 5c426d9cd2b351f5f9ceb30cabf8c64a63bfcad644c507e0bd9ce2f6ae1a3bf3 +F src/test_vfs.c f298475e468c7e14945b20af885917181090c265aa3c4ade897849c9fbd396f2 F src/test_vfstrace.c a2ea82df2ed8927e9eba49bdba1aa1aeb1dcb13dbf6558cff036da813031de9a F src/test_windirent.c a895e2c068a06644eef91a7f0a32182445a893b9a0f33d0cdb4283dca2486ac1 F src/test_windirent.h da2e5b73c32d09905fbdd00f27cd802212a32a58ead882736fe4f5eb775ebc50 -F src/test_window.c cdae419fdcea5bad6dcd9368c685abdad6deb59e9fc8b84b153de513d394ba3f +F src/test_window.c 6d80e11fba89a1796525e6f0048ff0c7789aa2c6b0b11c80827dc1437bd8ea72 F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9 F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c F src/tokenize.c 3f703cacdab728d7741e5a6ac242006d74fe1c2754d4f03ed889d7253259bd68 @@ -2121,7 +2122,7 @@ F tool/mkautoconfamal.sh cbdcf993fa83dccbef7fb77b39cdeb31ef9f77d9d88c9e343b58d35 F tool/mkccode.tcl 86463e68ce9c15d3041610fedd285ce32a5cf7a58fc88b3202b8b76837650dbe x F tool/mkctimec.tcl 060e9785e9503bf51f8b1b11b542bdeef90fd0ceb0738154f6762acec0c61e5f x F tool/mkkeywordhash.c b9faa0ae7e14e4dbbcd951cddd786bf46b8a65bb07b129ba8c0cfade723aaffd -F tool/mkmsvcmin.tcl 8897d515ef7f94772322db95a3b6fce6c614d84fe0bdd06ba5a1c786351d5a1d +F tool/mkmsvcmin.tcl d76c45efda1cce2d4005bcea7b8a22bb752e3256009f331120fb4fecb14ebb7a F tool/mkopcodec.tcl 33d20791e191df43209b77d37f0ff0904620b28465cca6990cf8d60da61a07ef F tool/mkopcodeh.tcl 2b4e6967a670ef21bf53a164964c35c6163277d002a4c6f56fa231d68c88d023 F tool/mkopts.tcl 680f785fdb09729fd9ac50632413da4eadbdf9071535e3f26d03795828ab07fa @@ -2134,14 +2135,14 @@ F tool/mksqlite3c.tcl c6acfdf4e4ef93478ff3ce3cd593e17abb03f446036ce710c3156bcfa1 F tool/mksqlite3h.tcl d391cff7cad0a372ee1406faee9ccc7dad9cb80a0c95cae0f73d10dd26e06762 F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b F tool/mktoolzip.tcl c7a9b685f5131d755e7d941cec50cee7f34178b9e34c9a89811eeb08617f8423 -F tool/mkvsix.tcl b9e0777a213c23156b6542842c238479e496ebf5 +F tool/mkvsix.tcl 67b40996a50f985a573278eea32fc5a5eb6110bdf14d33f1d8086e48c69e540a F tool/offsets.c 8ed2b344d33f06e71366a9b93ccedaa38c096cc1dbd4c3c26ad08c6115285845 F tool/omittest-msvc.tcl d6b8f501ac1d7798c4126065030f89812379012cad98a1735d6d7221492abc08 F tool/omittest.tcl e99c9fecc3f7a8ca2fa75d8ec8bdbb5acce33dc69f0c280aae53064693387f65 F tool/opcodesum.tcl 740ed206ba8c5040018988129abbf3089a0ccf4a F tool/pagesig.c ff0ca355fd3c2398e933da5e22439bbff89b803b -F tool/replace.tcl 937c931ad560688e85bdd6258bdc754371bb1e2732e1fb28ef441e44c9228fce -F tool/restore_jrnl.tcl 6957a34f8f1f0f8285e07536225ec3b292a9024a +F tool/replace.tcl 511c61acfe563dfb58675efb4628bb158a13d48ff8322123ac447e9d25a82d9a +F tool/restore_jrnl.tcl 1079ecba47cc82fa82115b81c1f68097ab1f956f357ee8da5fc4b2589af6bd98 F tool/rollback-test.c 9fc98427d1e23e84429d7e6d07d9094fbdec65a5 F tool/run-speed-test.sh f95d19fd669b68c4c38b6b475242841d47c66076 F tool/showdb.c 0f74b54cc67076c76cba9b2b7f54d3e05b78d130c70ffc394eb84c5b41bab017 @@ -2199,8 +2200,11 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P eb64d106551718467e0f6c6b53695410bf4c566901008e4cda8580d0f7efa7b0 -R ad51bbdd14781776f7624246eec357e7 +P 86de4e755e37dc1cbcbd59018927aa87ff49fc15f706a36187631d8f14075c12 +R f26b0d5f665cd9e5cd8b699e9fa3852a +T *branch * tcl9 +T *sym-tcl9 * +T -sym-trunk * U drh -Z 102d909571cd81f9b00d601f888788db +Z 6096f47dfe122296507e83030fc2948d # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index da015916e3..9daced7f7e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -86de4e755e37dc1cbcbd59018927aa87ff49fc15f706a36187631d8f14075c12 +6e5bb48a74d63fb8c30528f0005d1763cd2dbb882abf86baf1565721e6bfcf84 diff --git a/src/tclsqlite.c b/src/tclsqlite.c index d91b2fa3f1..ae3b61c6c3 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -35,14 +35,7 @@ # include "msvc.h" #endif -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" #include /* @@ -388,7 +381,7 @@ static int SQLITE_TCLAPI incrblobHandle( static Tcl_ChannelType IncrblobChannelType = { "incrblob", /* typeName */ - TCL_CHANNEL_VERSION_2, /* version */ + TCL_CHANNEL_VERSION_5, /* version */ incrblobClose, /* closeProc */ incrblobInput, /* inputProc */ incrblobOutput, /* outputProc */ @@ -474,7 +467,7 @@ static int safeToUseEvalObjv(Tcl_Interp *interp, Tcl_Obj *pCmd){ ** characters appear in pCmd, we will report the string as unsafe. */ const char *z; - int n; + Tcl_Size n; z = Tcl_GetStringFromObj(pCmd, &n); while( n-- > 0 ){ int c = *(z++); @@ -981,7 +974,7 @@ static void tclSqlFunc(sqlite3_context *context, int argc, sqlite3_value**argv){ ** be preserved and reused on the next invocation. */ Tcl_Obj **aArg; - int nArg; + Tcl_Size nArg; if( Tcl_ListObjGetElements(p->interp, p->pScript, &nArg, &aArg) ){ sqlite3_result_error(context, Tcl_GetStringResult(p->interp), -1); return; @@ -1044,7 +1037,7 @@ static void tclSqlFunc(sqlite3_context *context, int argc, sqlite3_value**argv){ sqlite3_result_error(context, Tcl_GetStringResult(p->interp), -1); }else{ Tcl_Obj *pVar = Tcl_GetObjResult(p->interp); - int n; + Tcl_Size n; u8 *data; const char *zType = (pVar->typePtr ? pVar->typePtr->name : ""); char c = zType[0]; @@ -1455,7 +1448,7 @@ static int dbPrepareAndBind( } } if( pVar ){ - int n; + Tcl_Size n; u8 *data; const char *zType = (pVar->typePtr ? pVar->typePtr->name : ""); c = zType[0]; @@ -1469,8 +1462,9 @@ static int dbPrepareAndBind( Tcl_IncrRefCount(pVar); pPreStmt->apParm[iParm++] = pVar; }else if( c=='b' && strcmp(zType,"boolean")==0 ){ - Tcl_GetIntFromObj(interp, pVar, &n); - sqlite3_bind_int(pStmt, i, n); + int nn; + Tcl_GetIntFromObj(interp, pVar, &nn); + sqlite3_bind_int(pStmt, i, nn); }else if( c=='d' && strcmp(zType,"double")==0 ){ double r; Tcl_GetDoubleFromObj(interp, pVar, &r); @@ -2034,7 +2028,7 @@ static int SQLITE_TCLAPI DbObjCmd( } }else{ char *zAuth; - int len; + Tcl_Size len; if( pDb->zAuth ){ Tcl_Free(pDb->zAuth); } @@ -2137,7 +2131,7 @@ static int SQLITE_TCLAPI DbObjCmd( } }else{ char *zCallback; - int len; + Tcl_Size len; if( pDb->zBindFallback ){ Tcl_Free(pDb->zBindFallback); } @@ -2167,7 +2161,7 @@ static int SQLITE_TCLAPI DbObjCmd( } }else{ char *zBusy; - int len; + Tcl_Size len; if( pDb->zBusy ){ Tcl_Free(pDb->zBusy); } @@ -2274,7 +2268,7 @@ static int SQLITE_TCLAPI DbObjCmd( SqlCollate *pCollate; char *zName; char *zScript; - int nScript; + Tcl_Size nScript; if( objc!=4 ){ Tcl_WrongNumArgs(interp, 2, objv, "NAME SCRIPT"); return TCL_ERROR; @@ -2333,7 +2327,7 @@ static int SQLITE_TCLAPI DbObjCmd( } }else{ const char *zCommit; - int len; + Tcl_Size len; if( pDb->zCommit ){ Tcl_Free(pDb->zCommit); } @@ -2653,7 +2647,8 @@ static int SQLITE_TCLAPI DbObjCmd( Tcl_Obj *pValue = 0; unsigned char *pBA; unsigned char *pData; - int len, xrc; + Tcl_Size len; + int xrc; sqlite3_int64 mxSize = 0; int i; int isReadonly = 0; @@ -3024,7 +3019,7 @@ deserialize_error: return TCL_ERROR; } if( objc==3 ){ - int len; + Tcl_Size len; char *zNull = Tcl_GetStringFromObj(objv[2], &len); if( pDb->zNull ){ Tcl_Free(pDb->zNull); @@ -3078,7 +3073,7 @@ deserialize_error: #endif }else if( objc==4 ){ char *zProgress; - int len; + Tcl_Size len; int N; if( TCL_OK!=Tcl_GetIntFromObj(interp, objv[2], &N) ){ return TCL_ERROR; @@ -3124,7 +3119,7 @@ deserialize_error: } }else{ char *zProfile; - int len; + Tcl_Size len; if( pDb->zProfile ){ Tcl_Free(pDb->zProfile); } @@ -3335,7 +3330,7 @@ deserialize_error: } }else{ char *zTrace; - int len; + Tcl_Size len; if( pDb->zTrace ){ Tcl_Free(pDb->zTrace); } @@ -3375,7 +3370,7 @@ deserialize_error: } }else{ char *zTraceV2; - int len; + Tcl_Size len; Tcl_WideInt wMask = 0; if( objc==4 ){ static const char *TTYPE_strs[] = { @@ -3961,14 +3956,20 @@ EXTERN int Tclsqlite3_Unload(Tcl_Interp *interp, int flags){ return TCL_OK; } EXTERN int Sqlite3_SafeInit(Tcl_Interp *interp){ return TCL_ERROR; } EXTERN int Sqlite3_SafeUnload(Tcl_Interp *interp, int flags){return TCL_ERROR;} - - -#ifndef SQLITE_3_SUFFIX_ONLY -int Sqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); } -int Tclsqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); } -int Sqlite_Unload(Tcl_Interp *interp, int flags){ return TCL_OK; } -int Tclsqlite_Unload(Tcl_Interp *interp, int flags){ return TCL_OK; } -#endif +/* +** Versions of all of the above entry points that omit the "3" at the end +** of the name. Years ago (circa 2004) the "3" was necessary to distinguish +** SQLite version 3 from Sqlite version 2. But two decades have elapsed. +** SQLite2 is not longer a conflict. So it is ok to omit the "3". +** +** Omitting the "3" helps TCL find the entry point. +*/ +EXTERN int Sqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp);} +EXTERN int Tclsqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); } +EXTERN int Sqlite_Unload(Tcl_Interp *interp, int flags){ return TCL_OK; } +EXTERN int Tclsqlite_Unload(Tcl_Interp *interp, int flags){ return TCL_OK; } +EXTERN int Sqlite_SafeInit(Tcl_Interp *interp){ return TCL_ERROR; } +EXTERN int Sqlite_SafeUnload(Tcl_Interp *interp, int flags){return TCL_ERROR;} /* ** If the TCLSH macro is defined, add code to make a stand-alone program. diff --git a/src/tclsqlite.h b/src/tclsqlite.h new file mode 100644 index 0000000000..217b9a05b6 --- /dev/null +++ b/src/tclsqlite.h @@ -0,0 +1,37 @@ +/* +** 2024-07-30 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** This header file defines the interface to TCL as used by SQLite. +** SQLite subcomponents that use TCL (the libsqlite3.c interface library +** and various test*.c pieces) should #include this file rather than +** including tcl.h directly. +*/ + +/* When compiling for Windows using STDCALL instead of CDECL calling +** conventions, the MSVC makefile has to build a customized version of +** the "tcl.h" header that specifies the calling conventions for each +** interface. That customized "tcl.h" is named "sqlite_tcl.h". +*/ +#if defined(INCLUDE_SQLITE_TCL_H) +# include "sqlite_tcl.h" /* Special case for Windows using STDCALL */ +#else +# include "tcl.h" /* All normal cases */ +# ifndef SQLITE_TCLAPI +# define SQLITE_TCLAPI +# endif +#endif + +/* Compatability between Tcl8.6 and Tcl9.0 */ +#if TCL_MAJOR_VERSION==9 +# define CONST const +#else + typedef int Tcl_Size; +#endif diff --git a/src/test1.c b/src/test1.c index 975758131e..90035151e4 100644 --- a/src/test1.c +++ b/src/test1.c @@ -26,11 +26,7 @@ #endif #include "vdbeInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #include #include @@ -1772,7 +1768,7 @@ static int SQLITE_TCLAPI blobHandleFromObj( sqlite3_blob **ppBlob ){ char *z; - int n; + Tcl_Size n; z = Tcl_GetStringFromObj(pObj, &n); if( n==0 ){ @@ -4102,7 +4098,7 @@ static int SQLITE_TCLAPI test_bind_text( ){ sqlite3_stmt *pStmt; int idx; - int trueLength = 0; + Tcl_Size trueLength = 0; int bytes; char *value; int rc; @@ -4160,7 +4156,7 @@ static int SQLITE_TCLAPI test_bind_text16( char *value; char *toFree = 0; int rc; - int trueLength = 0; + Tcl_Size trueLength = 0; void (*xDel)(void*) = (objc==6?SQLITE_STATIC:SQLITE_TRANSIENT); Tcl_Obj *oStmt = objv[objc-4]; @@ -4214,7 +4210,8 @@ static int SQLITE_TCLAPI test_bind_blob( Tcl_Obj *CONST objv[] ){ sqlite3_stmt *pStmt; - int len, idx; + Tcl_Size len; + int idx; int bytes; char *value; int rc; @@ -4240,7 +4237,7 @@ static int SQLITE_TCLAPI test_bind_blob( if( bytes>len ){ char zBuf[200]; sqlite3_snprintf(sizeof(zBuf), zBuf, - "cannot use %d blob bytes, have %d", bytes, len); + "cannot use %d blob bytes, have %d", bytes, (int)len); Tcl_AppendResult(interp, zBuf, (char*)0); return TCL_ERROR; } @@ -4538,9 +4535,9 @@ static int SQLITE_TCLAPI test_carray_bind( struct iovec *a = sqlite3_malloc( sizeof(struct iovec)*nData ); if( a==0 ){ rc = SQLITE_NOMEM; goto carray_bind_done; } for(j=0; jpMethods->xWrite(pFile, aData, nData, iOff); + rc = pFile->pMethods->xWrite(pFile, aData, (int)(nData&0x7fffffff), iOff); Tcl_SetResult(interp, (char *)sqlite3ErrName(rc), TCL_VOLATILE); return TCL_OK; diff --git a/src/test2.c b/src/test2.c index c75fa2ebab..a9549aa7f5 100644 --- a/src/test2.c +++ b/src/test2.c @@ -14,11 +14,7 @@ ** testing of the SQLite library. */ #include "sqliteInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #include #include #include diff --git a/src/test3.c b/src/test3.c index 7fd7662479..f1b2b01680 100644 --- a/src/test3.c +++ b/src/test3.c @@ -15,11 +15,7 @@ */ #include "sqliteInt.h" #include "btreeInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #include #include @@ -623,6 +619,7 @@ static int SQLITE_TCLAPI btree_insert( BtCursor *pCur; int rc; BtreePayload x; + Tcl_Size n; if( objc!=4 && objc!=3 ){ Tcl_WrongNumArgs(interp, 1, objv, "?-intkey? CSR KEY VALUE"); @@ -633,10 +630,11 @@ static int SQLITE_TCLAPI btree_insert( if( objc==4 ){ if( Tcl_GetIntFromObj(interp, objv[2], &rc) ) return TCL_ERROR; x.nKey = rc; - x.pData = (void*)Tcl_GetByteArrayFromObj(objv[3], &x.nData); + x.pData = (void*)Tcl_GetByteArrayFromObj(objv[3], &n); + x.nData = (int)n; }else{ - x.pKey = (void*)Tcl_GetByteArrayFromObj(objv[2], &rc); - x.nKey = rc; + x.pKey = (void*)Tcl_GetByteArrayFromObj(objv[2], &n); + x.nKey = (int)n; } pCur = (BtCursor*)sqlite3TestTextToPtr(Tcl_GetString(objv[1])); diff --git a/src/test4.c b/src/test4.c index 2043a33830..8a68f7d3e4 100644 --- a/src/test4.c +++ b/src/test4.c @@ -12,11 +12,7 @@ ** Code for testing the SQLite library in a multithreaded environment. */ #include "sqliteInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #if SQLITE_OS_UNIX && SQLITE_THREADSAFE #include #include diff --git a/src/test5.c b/src/test5.c index 0d9242862b..334b5d07fe 100644 --- a/src/test5.c +++ b/src/test5.c @@ -17,11 +17,7 @@ */ #include "sqliteInt.h" #include "vdbeInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #include #include @@ -36,7 +32,7 @@ static int SQLITE_TCLAPI binarize( int objc, Tcl_Obj *CONST objv[] ){ - int len; + Tcl_Size len; char *bytes; Tcl_Obj *pRet; assert(objc==2); @@ -133,7 +129,7 @@ static int SQLITE_TCLAPI test_translate( sqlite3_value *pVal; char *z; - int len; + Tcl_Size len; void (*xDel)(void *p) = SQLITE_STATIC; if( objc!=4 && objc!=5 ){ @@ -164,7 +160,7 @@ static int SQLITE_TCLAPI test_translate( z = (char*)Tcl_GetByteArrayFromObj(objv[1], &len); if( objc==5 ){ char *zTmp = z; - z = sqlite3_malloc(len); + z = sqlite3_malloc64(len); memcpy(z, zTmp, len); } sqlite3ValueSetStr(pVal, -1, z, enc_from, xDel); diff --git a/src/test6.c b/src/test6.c index 5d8e6b9be6..76db640c4d 100644 --- a/src/test6.c +++ b/src/test6.c @@ -16,11 +16,7 @@ */ #if SQLITE_TEST /* This file is used for testing only */ #include "sqliteInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #ifndef SQLITE_OMIT_DISKIO /* This file is a no-op if disk I/O is disabled */ @@ -751,7 +747,7 @@ static int processDevSymArgs( int setDeviceChar = 0; for(i=0; i11 || nOpt<2 || strncmp("-sectorsize", zOpt, nOpt)) @@ -776,11 +772,11 @@ static int processDevSymArgs( }else{ int j; Tcl_Obj **apObj; - int nObj; + Tcl_Size nObj; if( Tcl_ListObjGetElements(interp, objv[i+1], &nObj, &apObj) ){ return TCL_ERROR; } - for(j=0; j #include diff --git a/src/test9.c b/src/test9.c index 5b139e8a56..b5362adb7f 100644 --- a/src/test9.c +++ b/src/test9.c @@ -15,11 +15,7 @@ ** as there is not much point in binding to Tcl. */ #include "sqliteInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #include #include diff --git a/src/test_async.c b/src/test_async.c index c32c74c660..afe401ac69 100644 --- a/src/test_async.c +++ b/src/test_async.c @@ -14,15 +14,8 @@ ** (defined in ext/async/sqlite3async.h) to Tcl. */ -#define TCL_THREADS -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#define TCL_THREADS +#include "tclsqlite.h" #ifdef SQLITE_ENABLE_ASYNCIO diff --git a/src/test_autoext.c b/src/test_autoext.c index e23e41a08a..74ca55879f 100644 --- a/src/test_autoext.c +++ b/src/test_autoext.c @@ -11,14 +11,7 @@ ************************************************************************* ** Test extension for testing the sqlite3_auto_extension() function. */ -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" #include "sqlite3ext.h" #ifndef SQLITE_OMIT_LOAD_EXTENSION diff --git a/src/test_backup.c b/src/test_backup.c index 9b684a28f6..8051888ee6 100644 --- a/src/test_backup.c +++ b/src/test_backup.c @@ -13,14 +13,7 @@ ** */ -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" #include "sqlite3.h" #include diff --git a/src/test_bestindex.c b/src/test_bestindex.c index c89cab2e39..2f9203d85e 100644 --- a/src/test_bestindex.c +++ b/src/test_bestindex.c @@ -93,11 +93,7 @@ #include "sqliteInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #ifndef SQLITE_OMIT_VIRTUALTABLE @@ -352,14 +348,14 @@ static int tclFilter( */ Tcl_Obj *pRes = Tcl_GetObjResult(interp); Tcl_Obj **apElem = 0; - int nElem; + Tcl_Size nElem; rc = Tcl_ListObjGetElements(interp, pRes, &nElem, &apElem); if( rc!=TCL_OK ){ const char *zErr = Tcl_GetStringResult(interp); rc = SQLITE_ERROR; pTab->base.zErrMsg = sqlite3_mprintf("%s", zErr); }else{ - for(ii=0; rc==SQLITE_OK && ii #include #include @@ -58,7 +54,7 @@ static int blobHandleFromObj( sqlite3_blob **ppBlob ){ char *z; - int n; + Tcl_Size n; z = Tcl_GetStringFromObj(pObj, &n); if( n==0 ){ @@ -88,7 +84,7 @@ static int blobHandleFromObj( ** NULL Pointer is returned. */ static char *blobStringFromObj(Tcl_Obj *pObj){ - int n; + Tcl_Size n; char *z; z = Tcl_GetStringFromObj(pObj, &n); return (n ? z : 0); @@ -112,7 +108,7 @@ static int SQLITE_TCLAPI test_blob_open( Tcl_WideInt iRowid; int flags; const char *zVarname; - int nVarname; + Tcl_Size nVarname; sqlite3_blob *pBlob = (sqlite3_blob*)&flags; /* Non-zero initialization */ int rc; @@ -281,7 +277,8 @@ static int SQLITE_TCLAPI test_blob_write( int rc; unsigned char *zBuf; - int nBuf; + Tcl_Size nBuf; + int n; if( objc!=4 && objc!=5 ){ Tcl_WrongNumArgs(interp, 1, objv, "HANDLE OFFSET DATA ?NDATA?"); @@ -294,10 +291,11 @@ static int SQLITE_TCLAPI test_blob_write( } zBuf = Tcl_GetByteArrayFromObj(objv[3], &nBuf); - if( objc==5 && Tcl_GetIntFromObj(interp, objv[4], &nBuf) ){ + n = (int)(nBuf & 0x7fffffff); + if( objc==5 && Tcl_GetIntFromObj(interp, objv[4], &n) ){ return TCL_ERROR; } - rc = sqlite3_blob_write(pBlob, zBuf, nBuf, iOffset); + rc = sqlite3_blob_write(pBlob, zBuf, n, iOffset); if( rc!=SQLITE_OK ){ Tcl_SetResult(interp, (char *)sqlite3ErrName(rc), TCL_VOLATILE); } diff --git a/src/test_btree.c b/src/test_btree.c index 03b8b207c9..168a10f1f3 100644 --- a/src/test_btree.c +++ b/src/test_btree.c @@ -14,11 +14,7 @@ ** testing of the SQLite library. */ #include "btreeInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" /* ** Usage: sqlite3_shared_cache_report diff --git a/src/test_config.c b/src/test_config.c index 76904e5bf2..58de5a4625 100644 --- a/src/test_config.c +++ b/src/test_config.c @@ -24,11 +24,7 @@ # include "os_win.h" #endif -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #include #include diff --git a/src/test_demovfs.c b/src/test_demovfs.c index e990e98f29..e92fd56138 100644 --- a/src/test_demovfs.c +++ b/src/test_demovfs.c @@ -645,14 +645,7 @@ sqlite3_vfs *sqlite3_demovfs(void){ #ifdef SQLITE_TEST -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" #if SQLITE_OS_UNIX static int SQLITE_TCLAPI register_demovfs( diff --git a/src/test_fs.c b/src/test_fs.c index f88f3a9425..d821a83b9d 100644 --- a/src/test_fs.c +++ b/src/test_fs.c @@ -62,12 +62,7 @@ ** SELECT * FROM fstree WHERE path LIKE '/home/dan/sqlite/%' */ #include "sqliteInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif - +#include "tclsqlite.h" #include #include #include diff --git a/src/test_func.c b/src/test_func.c index 80df488282..8c06705ae4 100644 --- a/src/test_func.c +++ b/src/test_func.c @@ -13,11 +13,7 @@ ** implements new SQL functions used by the test scripts. */ #include "sqlite3.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #include #include #include diff --git a/src/test_hexio.c b/src/test_hexio.c index 61a41d5b1c..8999d84d27 100644 --- a/src/test_hexio.c +++ b/src/test_hexio.c @@ -18,11 +18,7 @@ ** easier and safer to build our own mechanism. */ #include "sqliteInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #include #include #include @@ -155,7 +151,8 @@ static int SQLITE_TCLAPI hexio_write( Tcl_Obj *CONST objv[] ){ int offset; - int nIn, nOut, written; + Tcl_Size nIn; + int nOut, written; const char *zFile; const unsigned char *zIn; unsigned char *aOut; @@ -168,11 +165,11 @@ static int SQLITE_TCLAPI hexio_write( if( Tcl_GetIntFromObj(interp, objv[2], &offset) ) return TCL_ERROR; zFile = Tcl_GetString(objv[1]); zIn = (const unsigned char *)Tcl_GetStringFromObj(objv[3], &nIn); - aOut = sqlite3_malloc( 1 + nIn/2 ); + aOut = sqlite3_malloc64( 1 + nIn/2 ); if( aOut==0 ){ return TCL_ERROR; } - nOut = sqlite3TestHexToBin(zIn, nIn, aOut); + nOut = sqlite3TestHexToBin(zIn, (int)nIn, aOut); out = fopen(zFile, "r+b"); if( out==0 ){ out = fopen(zFile, "r+"); @@ -203,7 +200,8 @@ static int SQLITE_TCLAPI hexio_get_int( Tcl_Obj *CONST objv[] ){ int val; - int nIn, nOut; + Tcl_Size nIn; + int nOut; const unsigned char *zIn; unsigned char *aOut; unsigned char aNum[4]; @@ -213,11 +211,11 @@ static int SQLITE_TCLAPI hexio_get_int( return TCL_ERROR; } zIn = (const unsigned char *)Tcl_GetStringFromObj(objv[1], &nIn); - aOut = sqlite3_malloc( 1 + nIn/2 ); + aOut = sqlite3_malloc64( 1 + nIn/2 ); if( aOut==0 ){ return TCL_ERROR; } - nOut = sqlite3TestHexToBin(zIn, nIn, aOut); + nOut = sqlite3TestHexToBin(zIn, (int)nIn, aOut); if( nOut>=4 ){ memcpy(aNum, aOut, 4); }else{ @@ -300,7 +298,7 @@ static int SQLITE_TCLAPI utf8_to_utf8( Tcl_Obj *CONST objv[] ){ #ifdef SQLITE_DEBUG - int n; + Tcl_Size n; int nOut; const unsigned char *zOrig; unsigned char *z; @@ -309,8 +307,8 @@ static int SQLITE_TCLAPI utf8_to_utf8( return TCL_ERROR; } zOrig = (unsigned char *)Tcl_GetStringFromObj(objv[1], &n); - z = sqlite3_malloc( n+4 ); - n = sqlite3TestHexToBin(zOrig, n, z); + z = sqlite3_malloc64( n+4 ); + n = sqlite3TestHexToBin(zOrig, (int)n, z); z[n] = 0; nOut = sqlite3Utf8To8(z); sqlite3TestBinToHex(z,nOut); @@ -361,7 +359,7 @@ static int SQLITE_TCLAPI read_fts3varint( int objc, Tcl_Obj *CONST objv[] ){ - int nBlob; + Tcl_Size nBlob; unsigned char *zBlob; sqlite3_int64 iVal; int nVal; @@ -388,10 +386,10 @@ static int SQLITE_TCLAPI make_fts3record( Tcl_Obj *CONST objv[] ){ Tcl_Obj **aArg = 0; - int nArg = 0; + Tcl_Size nArg = 0; unsigned char *aOut = 0; - int nOut = 0; - int nAlloc = 0; + sqlite3_int64 nOut = 0; + sqlite3_int64 nAlloc = 0; int i; if( objc!=2 ){ @@ -402,7 +400,7 @@ static int SQLITE_TCLAPI make_fts3record( return TCL_ERROR; } - for(i=0; inAlloc ){ @@ -417,11 +415,11 @@ static int SQLITE_TCLAPI make_fts3record( } nOut += putFts3Varint((char*)&aOut[nOut], iVal); }else{ - int nVal = 0; + Tcl_Size nVal = 0; char *zVal = Tcl_GetStringFromObj(aArg[i], &nVal); while( (nOut + nVal)>nAlloc ){ - int nNew = nAlloc?nAlloc*2:128; - unsigned char *aNew = sqlite3_realloc(aOut, nNew); + sqlite3_int64 nNew = nAlloc?nAlloc*2:128; + unsigned char *aNew = sqlite3_realloc64(aOut, nNew); if( aNew==0 ){ sqlite3_free(aOut); return TCL_ERROR; diff --git a/src/test_init.c b/src/test_init.c index 400ab9a2bf..f7b85875b0 100644 --- a/src/test_init.c +++ b/src/test_init.c @@ -27,11 +27,7 @@ #include "sqliteInt.h" #include -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" static struct Wrapped { sqlite3_pcache_methods2 pcache; diff --git a/src/test_intarray.c b/src/test_intarray.c index a978ed585d..16c1df2e9c 100644 --- a/src/test_intarray.c +++ b/src/test_intarray.c @@ -279,14 +279,7 @@ SQLITE_API int sqlite3_intarray_bind( ** Everything below is interface for testing this module. */ #ifdef SQLITE_TEST -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" /* ** Routines to encode and decode pointers diff --git a/src/test_malloc.c b/src/test_malloc.c index 8146501c9c..21faa0d291 100644 --- a/src/test_malloc.c +++ b/src/test_malloc.c @@ -14,11 +14,7 @@ ** memory allocation subsystem. */ #include "sqliteInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #include #include #include @@ -387,7 +383,8 @@ static int SQLITE_TCLAPI test_memset( Tcl_Obj *CONST objv[] ){ void *p; - int size, n, i; + int size, i; + Tcl_Size n; char *zHex; char *zOut; char zBin[100]; @@ -409,7 +406,7 @@ static int SQLITE_TCLAPI test_memset( } zHex = Tcl_GetStringFromObj(objv[3], &n); if( n>sizeof(zBin)*2 ) n = sizeof(zBin)*2; - n = sqlite3TestHexToBin(zHex, n, zBin); + n = sqlite3TestHexToBin(zHex, (int)n, zBin); if( n==0 ){ Tcl_AppendResult(interp, "no data", (char*)0); return TCL_ERROR; @@ -624,7 +621,7 @@ static int SQLITE_TCLAPI test_memdebug_fail( if( Tcl_GetIntFromObj(interp, objv[1], &iFail) ) return TCL_ERROR; for(ii=2; ii #include #include "sqlite3.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" /* * This code implements the MD5 message-digest algorithm. diff --git a/src/test_multiplex.c b/src/test_multiplex.c index d06ed2f793..e5b43f4cc1 100644 --- a/src/test_multiplex.c +++ b/src/test_multiplex.c @@ -1219,14 +1219,7 @@ int sqlite3_multiplex_shutdown(int eForce){ /***************************** Test Code ***********************************/ #ifdef SQLITE_TEST -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" extern const char *sqlite3ErrName(int); diff --git a/src/test_mutex.c b/src/test_mutex.c index a203208abe..e60a06df32 100644 --- a/src/test_mutex.c +++ b/src/test_mutex.c @@ -11,12 +11,7 @@ ************************************************************************* ** This file contains test logic for the sqlite3_mutex interfaces. */ - -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #include "sqlite3.h" #include "sqliteInt.h" #include diff --git a/src/test_osinst.c b/src/test_osinst.c index 062e83159b..2d03d2bbcd 100644 --- a/src/test_osinst.c +++ b/src/test_osinst.c @@ -1109,14 +1109,7 @@ int sqlite3_vfslog_register(sqlite3 *db){ #if defined(SQLITE_TEST) || defined(TCLSH) -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" static int SQLITE_TCLAPI test_vfslog( void *clientData, diff --git a/src/test_quota.c b/src/test_quota.c index b436de4667..1bfc5ce11c 100644 --- a/src/test_quota.c +++ b/src/test_quota.c @@ -1278,14 +1278,7 @@ int sqlite3_quota_remove(const char *zFilename){ /***************************** Test Code ***********************************/ #ifdef SQLITE_TEST -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" /* ** Argument passed to a TCL quota-over-limit callback. @@ -1420,7 +1413,7 @@ static int SQLITE_TCLAPI test_quota_set( Tcl_Obj *pScript; /* Tcl script to invoke to increase quota */ int rc; /* Value returned by quota_set() */ TclQuotaCallback *p; /* Callback object */ - int nScript; /* Length of callback script */ + Tcl_Size nScript; /* Length of callback script */ void (*xDestroy)(void*); /* Optional destructor for pArg */ void (*xCallback)(const char *, sqlite3_int64 *, sqlite3_int64, void *); diff --git a/src/test_rtree.c b/src/test_rtree.c index 0c6dbf3cd7..53af6e5cfe 100644 --- a/src/test_rtree.c +++ b/src/test_rtree.c @@ -14,11 +14,7 @@ */ #include "sqlite3.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" /* Solely for the UNUSED_PARAMETER() macro. */ #include "sqliteInt.h" @@ -357,11 +353,7 @@ static int bfs_query_func(sqlite3_rtree_query_info *p){ *************************************************************************/ #include -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" typedef struct Cube Cube; struct Cube { diff --git a/src/test_schema.c b/src/test_schema.c index 2cbc18e2b2..660d21ea4e 100644 --- a/src/test_schema.c +++ b/src/test_schema.c @@ -36,11 +36,7 @@ */ #ifdef SQLITE_TEST # include "sqliteInt.h" -# if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -# else -# include "tcl.h" -# endif +# include "tclsqlite.h" #else # include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 diff --git a/src/test_superlock.c b/src/test_superlock.c index 45d0d623a0..7f3bf163a5 100644 --- a/src/test_superlock.c +++ b/src/test_superlock.c @@ -256,14 +256,7 @@ int sqlite3demo_superlock( #ifdef SQLITE_TEST -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" struct InterpAndScript { Tcl_Interp *interp; diff --git a/src/test_syscall.c b/src/test_syscall.c index 3cd1034d3f..af2ae10015 100644 --- a/src/test_syscall.c +++ b/src/test_syscall.c @@ -76,11 +76,7 @@ #include "sqliteInt.h" #include "sqlite3.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #include #include #include @@ -197,7 +193,7 @@ static int tsIsFail(void){ */ static int tsErrno(const char *zFunc){ int i; - int nFunc = strlen(zFunc); + size_t nFunc = strlen(zFunc); for(i=0; aSyscall[i].zName; i++){ if( strlen(aSyscall[i].zName)!=nFunc ) continue; if( memcmp(aSyscall[i].zName, zFunc, nFunc) ) continue; @@ -429,7 +425,7 @@ static int SQLITE_TCLAPI test_syscall_install( Tcl_Obj *CONST objv[] ){ sqlite3_vfs *pVfs; - int nElem; + Tcl_Size nElem; int i; Tcl_Obj **apElem; @@ -442,7 +438,7 @@ static int SQLITE_TCLAPI test_syscall_install( } pVfs = sqlite3_vfs_find(0); - for(i=0; ixSetSystemCall(pVfs, 0, 0); for(i=0; aSyscall[i].zName; i++) aSyscall[i].xOrig = 0; }else{ - int nFunc; + Tcl_Size nFunc; char *zFunc = Tcl_GetStringFromObj(objv[2], &nFunc); rc = pVfs->xSetSystemCall(pVfs, Tcl_GetString(objv[2]), 0); for(i=0; rc==SQLITE_OK && aSyscall[i].zName; i++){ diff --git a/src/test_tclsh.c b/src/test_tclsh.c index 4697c3b856..db362049e7 100644 --- a/src/test_tclsh.c +++ b/src/test_tclsh.c @@ -20,14 +20,7 @@ ** in an effort to keep the tclsqlite.c file pure. */ #include "sqlite3.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -# ifndef SQLITE_TCLAPI -# define SQLITE_TCLAPI -# endif -#endif +#include "tclsqlite.h" /* Needed for the setrlimit() system call on unix */ #if defined(unix) diff --git a/src/test_tclvar.c b/src/test_tclvar.c index 36165bc27d..9be8774491 100644 --- a/src/test_tclvar.c +++ b/src/test_tclvar.c @@ -36,11 +36,7 @@ ** according to "fullname" and "value" only. */ #include "sqliteInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #include #include @@ -150,10 +146,10 @@ static int next2(Tcl_Interp *interp, tclvar_cursor *pCur, Tcl_Obj *pObj){ Tcl_IncrRefCount(pCur->pList2); assert( pCur->i2==0 ); }else{ - int n = 0; + Tcl_Size n = 0; pCur->i2++; Tcl_ListObjLength(0, pCur->pList2, &n); - if( pCur->i2>=n ){ + if( pCur->i2>=(int)n ){ Tcl_DecrRefCount(pCur->pList2); pCur->pList2 = 0; pCur->i2 = 0; @@ -167,14 +163,14 @@ static int next2(Tcl_Interp *interp, tclvar_cursor *pCur, Tcl_Obj *pObj){ static int tclvarNext(sqlite3_vtab_cursor *cur){ Tcl_Obj *pObj; - int n = 0; + Tcl_Size n = 0; int ok = 0; tclvar_cursor *pCur = (tclvar_cursor *)cur; Tcl_Interp *interp = ((tclvar_vtab *)(cur->pVtab))->interp; Tcl_ListObjLength(0, pCur->pList1, &n); - while( !ok && pCur->i1i1<(int)n ){ Tcl_ListObjIndex(0, pCur->pList1, pCur->i1, &pObj); ok = next2(interp, pCur, pObj); if( !ok ){ diff --git a/src/test_thread.c b/src/test_thread.c index 126fd98369..7c06d110ac 100644 --- a/src/test_thread.c +++ b/src/test_thread.c @@ -16,11 +16,7 @@ */ #include "sqliteInt.h" -#if defined(INCLUDE_SQLITE_TCL_H) -# include "sqlite_tcl.h" -#else -# include "tcl.h" -#endif +#include "tclsqlite.h" #if SQLITE_THREADSAFE @@ -94,7 +90,7 @@ static int SQLITE_TCLAPI tclScriptEvent(Tcl_Event *evPtr, int flags){ static void postToParent(SqlThread *p, Tcl_Obj *pScript){ EvalEvent *pEvent; char *zMsg; - int nMsg; + Tcl_Size nMsg; zMsg = Tcl_GetStringFromObj(pScript, &nMsg); pEvent = (EvalEvent *)ckalloc(sizeof(EvalEvent)+nMsg+1); @@ -181,8 +177,8 @@ static int SQLITE_TCLAPI sqlthread_spawn( SqlThread *pNew; int rc; - int nVarname; char *zVarname; - int nScript; char *zScript; + Tcl_Size nVarname; char *zVarname; + Tcl_Size nScript; char *zScript; /* Parameters for thread creation */ const int nStack = TCL_THREAD_STACK_DEFAULT; @@ -232,7 +228,7 @@ static int SQLITE_TCLAPI sqlthread_parent( ){ EvalEvent *pEvent; char *zMsg; - int nMsg; + Tcl_Size nMsg; SqlThread *p = (SqlThread *)clientData; assert(objc==3); diff --git a/src/test_vdbecov.c b/src/test_vdbecov.c index a001b1df0a..283936aeb7 100644 --- a/src/test_vdbecov.c +++ b/src/test_vdbecov.c @@ -15,11 +15,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" #ifdef SQLITE_VDBE_COVERAGE diff --git a/src/test_vfs.c b/src/test_vfs.c index 312e1a1be6..9f84b4f801 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*pgszaPage[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; ipScript ){ 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 +#include "tclsqlite.h" extern int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb); extern const char *sqlite3ErrName(int); diff --git a/tool/mkmsvcmin.tcl b/tool/mkmsvcmin.tcl index 6cb145db85..7926952554 100644 --- a/tool/mkmsvcmin.tcl +++ b/tool/mkmsvcmin.tcl @@ -23,7 +23,7 @@ if {$argc==0} { proc readFile { fileName } { set file_id [open $fileName RDONLY] - fconfigure $file_id -encoding binary -translation binary + fconfigure $file_id -translation binary set result [read $file_id] close $file_id return $result @@ -31,7 +31,7 @@ proc readFile { fileName } { proc writeFile { fileName data } { set file_id [open $fileName {WRONLY CREAT TRUNC}] - fconfigure $file_id -encoding binary -translation binary + fconfigure $file_id -translation binary puts -nonewline $file_id $data close $file_id return "" diff --git a/tool/mkvsix.tcl b/tool/mkvsix.tcl index c874d538fb..0663213639 100644 --- a/tool/mkvsix.tcl +++ b/tool/mkvsix.tcl @@ -156,7 +156,7 @@ proc readFile { fileName } { # may contain binary data. # set file_id [open $fileName RDONLY] - fconfigure $file_id -encoding binary -translation binary + fconfigure $file_id -translation binary set result [read $file_id] close $file_id return $result @@ -168,7 +168,7 @@ proc writeFile { fileName data } { # binary data. # set file_id [open $fileName {WRONLY CREAT TRUNC}] - fconfigure $file_id -encoding binary -translation binary + fconfigure $file_id -translation binary puts -nonewline $file_id $data close $file_id return "" diff --git a/tool/replace.tcl b/tool/replace.tcl index e87cb922f2..6a462d95ff 100644 --- a/tool/replace.tcl +++ b/tool/replace.tcl @@ -4,8 +4,8 @@ # only lines successfully modified with a regular # expression. # -fconfigure stdout -translation binary -encoding binary -fconfigure stderr -translation binary -encoding binary +fconfigure stdout -translation binary +fconfigure stderr -translation binary set mode [string tolower [lindex $argv 0]] set from [lindex $argv 1] set to [lindex $argv 2] diff --git a/tool/restore_jrnl.tcl b/tool/restore_jrnl.tcl index 05af4f9a2a..200f9b1d29 100644 --- a/tool/restore_jrnl.tcl +++ b/tool/restore_jrnl.tcl @@ -114,40 +114,40 @@ proc dump_jrnl_page {jrnl_pgno} { set db_pgno [hexio_get_int [hexio_read $jrnl_name [expr $jrnl_pg_offset] 4]] set chksum [hexio_get_int [hexio_read $jrnl_name [expr $jrnl_pg_offset+4+$db_pgsz] 4]] set nonce [calc_nonce $jrnl_pgno] - puts [ format {jrnl_pg_offset: %08x (%d) jrnl_pgno: %d db_pgno: %d} \ - $jrnl_pg_offset $jrnl_pg_offset \ - $jrnl_pgno $db_pgno] - puts [ format {nonce: %08x chksum: %08x} \ - $nonce $chksum] + puts [ format {jrnl_pg_offset: %08x (%d) jrnl_pgno: %d db_pgno: %d} \ + $jrnl_pg_offset $jrnl_pg_offset \ + $jrnl_pgno $db_pgno] + puts [ format {nonce: %08x chksum: %08x} \ + $nonce $chksum] # now hex dump the data - # This is derived from the Tcler's WIKI - set fid [open $jrnl_name r] - fconfigure $fid -translation binary -encoding binary - seek $fid [expr $jrnl_pg_offset+4] - set data [read $fid $db_pgsz] - close $fid + # This is derived from the Tcler's WIKI + set fid [open $jrnl_name r] + fconfigure $fid -translation binary + seek $fid [expr $jrnl_pg_offset+4] + set data [read $fid $db_pgsz] + close $fid for {set addr 0} {$addr<$db_pgsz} {set addr [expr $addr+16]} { - # get 16 bytes of data - set s [string range $data $addr [expr $addr+16]] - - # Convert the data to hex and to characters. - binary scan $s H*@0a* hex ascii - - # Replace non-printing characters in the data. - regsub -all -- {[^[:graph:] ]} $ascii {.} ascii - - # Split the 16 bytes into two 8-byte chunks - regexp -- {(.{16})(.{0,16})} $hex -> hex1 hex2 - - # Convert the hex to pairs of hex digits - regsub -all -- {..} $hex1 {& } hex1 - regsub -all -- {..} $hex2 {& } hex2 - - # Print the hex and ascii data - puts [ format {%08x %-24s %-24s %-16s} \ - $addr $hex1 $hex2 $ascii ] - } + # get 16 bytes of data + set s [string range $data $addr [expr $addr+16]] + + # Convert the data to hex and to characters. + binary scan $s H*@0a* hex ascii + + # Replace non-printing characters in the data. + regsub -all -- {[^[:graph:] ]} $ascii {.} ascii + + # Split the 16 bytes into two 8-byte chunks + regexp -- {(.{16})(.{0,16})} $hex -> hex1 hex2 + + # Convert the hex to pairs of hex digits + regsub -all -- {..} $hex1 {& } hex1 + regsub -all -- {..} $hex2 {& } hex2 + + # Print the hex and ascii data + puts [ format {%08x %-24s %-24s %-16s} \ + $addr $hex1 $hex2 $ascii ] + } } # Setup for the tests. Make a backup copy of the files. @@ -230,4 +230,3 @@ do_test restore_jrnl-1.0 { catchsql {PRAGMA integrity_check} } {0 ok} db close -