From 0716c6bd83df14591bdafd41dcd46ef1e78a3a17 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 7 Mar 2022 11:52:05 +0000 Subject: More int -> size_t --- generic/tclCmdMZ.c | 3 ++- generic/tclInt.h | 6 +++--- generic/tclParse.c | 3 ++- generic/tclUtil.c | 7 ++++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 736aadb..c195328 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -3326,7 +3326,7 @@ TclInitStringCmd( int TclSubstOptions( Tcl_Interp *interp, - int numOpts, + size_t numOpts1, Tcl_Obj *const opts[], int *flagPtr) { @@ -3337,6 +3337,7 @@ TclSubstOptions( SUBST_NOBACKSLASHES, SUBST_NOCOMMANDS, SUBST_NOVARS }; int i, flags = TCL_SUBST_ALL; + int numOpts = numOpts1; for (i = 0; i < numOpts; i++) { int optionIndex; diff --git a/generic/tclInt.h b/generic/tclInt.h index c6b7180..66d9245 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2896,7 +2896,7 @@ MODULE_SCOPE Tcl_Command TclCreateEnsembleInNs(Tcl_Interp *interp, MODULE_SCOPE void TclDeleteNamespaceVars(Namespace *nsPtr); MODULE_SCOPE void TclDeleteNamespaceChildren(Namespace *nsPtr); MODULE_SCOPE int TclFindDictElement(Tcl_Interp *interp, - const char *dict, int dictLength, + const char *dict, size_t dictLength, const char **elementPtr, const char **nextPtr, size_t *sizePtr, int *literalPtr); /* TIP #280 - Modified token based evaluation, with line information. */ @@ -3178,13 +3178,13 @@ MODULE_SCOPE int TclStringMatchObj(Tcl_Obj *stringObj, MODULE_SCOPE void TclSubstCompile(Tcl_Interp *interp, const char *bytes, size_t numBytes, int flags, int line, struct CompileEnv *envPtr); -MODULE_SCOPE int TclSubstOptions(Tcl_Interp *interp, int numOpts, +MODULE_SCOPE int TclSubstOptions(Tcl_Interp *interp, size_t numOpts, Tcl_Obj *const opts[], int *flagPtr); MODULE_SCOPE void TclSubstParse(Tcl_Interp *interp, const char *bytes, size_t numBytes, int flags, Tcl_Parse *parsePtr, Tcl_InterpState *statePtr); MODULE_SCOPE int TclSubstTokens(Tcl_Interp *interp, Tcl_Token *tokenPtr, - int count, int *tokensLeftPtr, int line, + size_t count, int *tokensLeftPtr, int line, int *clNextOuter, const char *outerScript); MODULE_SCOPE size_t TclTrim(const char *bytes, size_t numBytes, const char *trim, size_t numTrim, size_t *trimRight); diff --git a/generic/tclParse.c b/generic/tclParse.c index 52c11d4..1462fd7 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -2092,7 +2092,7 @@ TclSubstTokens( * errors. */ Tcl_Token *tokenPtr, /* Pointer to first in an array of tokens to * evaluate and concatenate. */ - int count, /* Number of tokens to consider at tokenPtr. + size_t count1, /* Number of tokens to consider at tokenPtr. * Must be at least 1. */ int *tokensLeftPtr, /* If not NULL, points to memory where an * integer representing the number of tokens @@ -2123,6 +2123,7 @@ TclSubstTokens( int *clPosition = NULL; Interp *iPtr = (Interp *) interp; int inFile = iPtr->evalFlags & TCL_EVAL_FILE; + int count = count1; /* * Each pass through this loop will substitute one token, and its diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 3ca178d..4e2165b 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -107,7 +107,7 @@ static Tcl_HashTable * GetThreadHash(Tcl_ThreadDataKey *keyPtr); static int GetWideForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr, size_t endValue, Tcl_WideInt *widePtr); static int FindElement(Tcl_Interp *interp, const char *string, - int stringLength, const char *typeStr, + size_t stringLength, const char *typeStr, const char *typeCode, const char **elementPtr, const char **nextPtr, size_t *sizePtr, int *literalPtr); @@ -521,7 +521,7 @@ TclFindDictElement( * containing a Tcl dictionary with zero or * more keys and values (possibly in * braces). */ - int dictLength, /* Number of bytes in the dict's string. */ + size_t dictLength, /* Number of bytes in the dict's string. */ const char **elementPtr, /* Where to put address of first significant * character in the first element (i.e., key * or value) of dict. */ @@ -550,7 +550,7 @@ FindElement( * containing a Tcl list or dictionary with * zero or more elements (possibly in * braces). */ - int stringLength, /* Number of bytes in the string. */ + size_t stringLength1, /* Number of bytes in the string. */ const char *typeStr, /* The name of the type of thing we are * parsing, for error messages. */ const char *typeCode, /* The type code for thing we are parsing, for @@ -578,6 +578,7 @@ FindElement( size_t numChars; int literal = 1; const char *p2; + int stringLength = stringLength1; /* * Skim off leading white space and check for an opening brace or quote. -- cgit v0.12