summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-01-26 08:37:09 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-01-26 08:37:09 (GMT)
commit789ce0b97106ca8a3f91ab68ddaaf1fa904dcace (patch)
treedbfc9faeb241149d5f694a03985a4510813adf89
parentbf32d5a0ab8f0030ffed9ba63186dbb3cdb02bdd (diff)
downloadtcl-789ce0b97106ca8a3f91ab68ddaaf1fa904dcace.zip
tcl-789ce0b97106ca8a3f91ab68ddaaf1fa904dcace.tar.gz
tcl-789ce0b97106ca8a3f91ab68ddaaf1fa904dcace.tar.bz2
More WIP
-rw-r--r--doc/StringObj.32
-rw-r--r--generic/tcl.decls4
-rw-r--r--generic/tclAssembly.c6
-rw-r--r--generic/tclBinary.c10
-rw-r--r--generic/tclCompCmds.c5
-rw-r--r--generic/tclDecls.h8
-rw-r--r--generic/tclIO.c5
-rw-r--r--generic/tclIOUtil.c9
-rw-r--r--generic/tclLink.c9
-rw-r--r--generic/tclNamesp.c20
-rw-r--r--generic/tclOOMethod.c22
-rw-r--r--generic/tclPathObj.c4
-rw-r--r--generic/tclPkg.c9
-rw-r--r--generic/tclProc.c24
-rw-r--r--generic/tclProcess.c13
-rw-r--r--generic/tclResult.c5
-rw-r--r--generic/tclStringObj.c13
-rw-r--r--generic/tclTrace.c18
-rw-r--r--generic/tclUtil.c6
-rw-r--r--win/tclWinSerial.c3
20 files changed, 99 insertions, 96 deletions
diff --git a/doc/StringObj.3 b/doc/StringObj.3
index 156618b..859e27a 100644
--- a/doc/StringObj.3
+++ b/doc/StringObj.3
@@ -135,7 +135,7 @@ If NULL is passed then the suffix
is used.
.AP "const char" *format in
Format control string including % conversion specifiers.
-.AP int objc in
+.AP size_t objc in
The number of elements to format or concatenate.
.AP Tcl_Obj *objv[] in
The array of values to format or concatenate.
diff --git a/generic/tcl.decls b/generic/tcl.decls
index a231b04..022fe1d 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -89,7 +89,7 @@ declare 16 {
void Tcl_AppendToObj(Tcl_Obj *objPtr, const char *bytes, size_t length)
}
declare 17 {
- Tcl_Obj *Tcl_ConcatObj(int objc, Tcl_Obj *const objv[])
+ Tcl_Obj *Tcl_ConcatObj(size_t objc, Tcl_Obj *const objv[])
}
declare 18 {
int Tcl_ConvertToType(Tcl_Interp *interp, Tcl_Obj *objPtr,
@@ -2160,7 +2160,7 @@ declare 576 {
}
declare 577 {
int Tcl_AppendFormatToObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- const char *format, int objc, Tcl_Obj *const objv[])
+ const char *format, size_t objc, Tcl_Obj *const objv[])
}
declare 578 {
Tcl_Obj *Tcl_ObjPrintf(const char *format, ...)
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c
index 8061f92..da55cea 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -1968,7 +1968,7 @@ CreateMirrorJumpTable(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
Tcl_Obj* jumps) /* List of alternating keywords and labels */
{
- int objc; /* Number of elements in the 'jumps' list */
+ size_t objc; /* Number of elements in the 'jumps' list */
Tcl_Obj** objv; /* Pointers to the elements in the list */
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
@@ -1981,9 +1981,9 @@ CreateMirrorJumpTable(
Tcl_HashEntry* hashEntry; /* Entry for a key in the hashtable */
int isNew; /* Flag==1 if the key is not yet in the
* table. */
- int i;
+ size_t i;
- if (TclListObjGetElements_(interp, jumps, &objc, &objv) != TCL_OK) {
+ if (Tcl_ListObjGetElements(interp, jumps, &objc, &objv) != TCL_OK) {
return TCL_ERROR;
}
if (objc % 2 != 0) {
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index e310960..ae454c4 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -1006,14 +1006,14 @@ BinaryFormatCmd(
arg++;
count = 1;
} else {
- int listc;
+ size_t listc;
Tcl_Obj **listv;
/*
* The macro evals its args more than once: avoid arg++
*/
- if (TclListObjGetElements_(interp, objv[arg], &listc,
+ if (Tcl_ListObjGetElements(interp, objv[arg], &listc,
&listv) != TCL_OK) {
return TCL_ERROR;
}
@@ -1021,7 +1021,7 @@ BinaryFormatCmd(
if (count == BINARY_ALL) {
count = listc;
- } else if (count > (size_t)listc) {
+ } else if (count > listc) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"number of elements in list does not match count",
-1));
@@ -1284,7 +1284,7 @@ BinaryFormatCmd(
case 'q':
case 'Q':
case 'f': {
- int listc, i;
+ size_t listc, i;
Tcl_Obj **listv;
if (count == BINARY_NOCOUNT) {
@@ -1297,7 +1297,7 @@ BinaryFormatCmd(
listc = 1;
count = 1;
} else {
- TclListObjGetElements_(interp, objv[arg], &listc, &listv);
+ Tcl_ListObjGetElements(interp, objv[arg], &listc, &listv);
if (count == BINARY_ALL) {
count = listc;
}
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 35c70c4..b1f5fe5 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -890,10 +890,9 @@ TclCompileConcatCmd(
if (listObj != NULL) {
Tcl_Obj **objs;
const char *bytes;
- int len;
- size_t slen;
+ size_t len, slen;
- TclListObjGetElements_(NULL, listObj, &len, &objs);
+ Tcl_ListObjGetElements(NULL, listObj, &len, &objs);
objPtr = Tcl_ConcatObj(len, objs);
Tcl_DecrRefCount(listObj);
bytes = Tcl_GetStringFromObj(objPtr, &slen);
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index cfe07b6..7b91dc7 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -92,7 +92,7 @@ EXTERN void Tcl_AppendStringsToObj(Tcl_Obj *objPtr, ...);
EXTERN void Tcl_AppendToObj(Tcl_Obj *objPtr, const char *bytes,
size_t length);
/* 17 */
-EXTERN Tcl_Obj * Tcl_ConcatObj(int objc, Tcl_Obj *const objv[]);
+EXTERN Tcl_Obj * Tcl_ConcatObj(size_t objc, Tcl_Obj *const objv[]);
/* 18 */
EXTERN int Tcl_ConvertToType(Tcl_Interp *interp,
Tcl_Obj *objPtr, const Tcl_ObjType *typePtr);
@@ -1526,7 +1526,7 @@ EXTERN Tcl_Obj * Tcl_Format(Tcl_Interp *interp, const char *format,
/* 577 */
EXTERN int Tcl_AppendFormatToObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, const char *format,
- int objc, Tcl_Obj *const objv[]);
+ size_t objc, Tcl_Obj *const objv[]);
/* 578 */
EXTERN Tcl_Obj * Tcl_ObjPrintf(const char *format, ...) TCL_FORMAT_PRINTF(1, 2);
/* 579 */
@@ -1804,7 +1804,7 @@ typedef struct TclStubs {
int (*tcl_AppendAllObjTypes) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 14 */
void (*tcl_AppendStringsToObj) (Tcl_Obj *objPtr, ...); /* 15 */
void (*tcl_AppendToObj) (Tcl_Obj *objPtr, const char *bytes, size_t length); /* 16 */
- Tcl_Obj * (*tcl_ConcatObj) (int objc, Tcl_Obj *const objv[]); /* 17 */
+ Tcl_Obj * (*tcl_ConcatObj) (size_t objc, Tcl_Obj *const objv[]); /* 17 */
int (*tcl_ConvertToType) (Tcl_Interp *interp, Tcl_Obj *objPtr, const Tcl_ObjType *typePtr); /* 18 */
void (*tcl_DbDecrRefCount) (Tcl_Obj *objPtr, const char *file, int line); /* 19 */
void (*tcl_DbIncrRefCount) (Tcl_Obj *objPtr, const char *file, int line); /* 20 */
@@ -2364,7 +2364,7 @@ typedef struct TclStubs {
void (*tcl_AppendObjToErrorInfo) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 574 */
void (*tcl_AppendLimitedToObj) (Tcl_Obj *objPtr, const char *bytes, size_t length, size_t limit, const char *ellipsis); /* 575 */
Tcl_Obj * (*tcl_Format) (Tcl_Interp *interp, const char *format, int objc, Tcl_Obj *const objv[]); /* 576 */
- int (*tcl_AppendFormatToObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, const char *format, int objc, Tcl_Obj *const objv[]); /* 577 */
+ int (*tcl_AppendFormatToObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, const char *format, size_t objc, Tcl_Obj *const objv[]); /* 577 */
Tcl_Obj * (*tcl_ObjPrintf) (const char *format, ...) TCL_FORMAT_PRINTF(1, 2); /* 578 */
void (*tcl_AppendPrintfToObj) (Tcl_Obj *objPtr, const char *format, ...) TCL_FORMAT_PRINTF(2, 3); /* 579 */
int (*tcl_CancelEval) (Tcl_Interp *interp, Tcl_Obj *resultObjPtr, void *clientData, int flags); /* 580 */
diff --git a/generic/tclIO.c b/generic/tclIO.c
index ee5f5e3..4aa3f22 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -10910,7 +10910,8 @@ static Tcl_Obj *
FixLevelCode(
Tcl_Obj *msg)
{
- int explicitResult, numOptions, lc, lcn;
+ int explicitResult, numOptions, lcn;
+ size_t lc;
Tcl_Obj **lv, **lvn;
int res, i, j, val, lignore, cignore;
int newlevel = -1, newcode = -1;
@@ -10927,7 +10928,7 @@ FixLevelCode(
* information. Hence an error means that we've got serious breakage.
*/
- res = TclListObjGetElements_(NULL, msg, &lc, &lv);
+ res = Tcl_ListObjGetElements(NULL, msg, &lc, &lv);
if (res != TCL_OK) {
Tcl_Panic("Tcl_SetChannelError: bad syntax of message");
}
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 7c3032a..32a96ef 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -989,7 +989,8 @@ Tcl_FSMatchInDirectory(
{
const Tcl_Filesystem *fsPtr;
Tcl_Obj *cwd, *tmpResultPtr, **elemsPtr;
- int resLength, i, ret = -1;
+ size_t resLength, i;
+ int ret = -1;
if (types != NULL && (types->type & TCL_GLOB_TYPE_MOUNT)) {
/*
@@ -1065,7 +1066,7 @@ Tcl_FSMatchInDirectory(
* resultPtr and tmpResultPtr are guaranteed to be distinct.
*/
- ret = TclListObjGetElements_(interp, tmpResultPtr,
+ ret = Tcl_ListObjGetElements(interp, tmpResultPtr,
&resLength, &elemsPtr);
for (i=0 ; ret==TCL_OK && i<resLength ; i++) {
ret = Tcl_ListObjAppendElement(interp, resultPtr,
@@ -2475,10 +2476,10 @@ TclFSFileAttrIndex(
* It's a non-constant attribute list, so do a literal search.
*/
- int i, objc;
+ size_t i, objc;
Tcl_Obj **objv;
- if (TclListObjGetElements_(NULL, listObj, &objc, &objv) != TCL_OK) {
+ if (Tcl_ListObjGetElements(NULL, listObj, &objc, &objv) != TCL_OK) {
TclDecrRefCount(listObj);
return TCL_ERROR;
}
diff --git a/generic/tclLink.c b/generic/tclLink.c
index d637dbd..932ca5e 100644
--- a/generic/tclLink.c
+++ b/generic/tclLink.c
@@ -763,9 +763,8 @@ LinkTraceProc(
Tcl_WideInt valueWide;
Tcl_WideUInt valueUWide;
double valueDouble;
- int objc;
+ size_t objc, i;
Tcl_Obj **objv;
- int i;
/*
* If the variable is being unset, then just re-create it (with a trace)
@@ -947,8 +946,8 @@ LinkTraceProc(
*/
if (linkPtr->flags & LINK_ALLOC_LAST) {
- if (TclListObjGetElements_(NULL, (valueObj), &objc, &objv) == TCL_ERROR
- || (size_t)objc != linkPtr->numElems) {
+ if (Tcl_ListObjGetElements(NULL, (valueObj), &objc, &objv) == TCL_ERROR
+ || objc != linkPtr->numElems) {
return (char *) "wrong dimension";
}
}
@@ -956,7 +955,7 @@ LinkTraceProc(
switch (linkPtr->type) {
case TCL_LINK_INT:
if (linkPtr->flags & LINK_ALLOC_LAST) {
- for (i=0; i < objc; i++) {
+ for (i = 0; i < objc; i++) {
int *varPtr = &linkPtr->lastValue.iPtr[i];
if (GetInt(objv[i], varPtr)) {
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index dc57c9e..53c5769 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -4036,8 +4036,8 @@ NamespacePathCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Namespace *nsPtr = (Namespace *) TclGetCurrentNamespace(interp);
- size_t i;
- int nsObjc, result = TCL_ERROR;
+ size_t nsObjc, i;
+ int result = TCL_ERROR;
Tcl_Obj **nsObjv;
Tcl_Namespace **namespaceList = NULL;
@@ -4068,14 +4068,14 @@ NamespacePathCmd(
* There is a path given, so parse it into an array of namespace pointers.
*/
- if (TclListObjGetElements_(interp, objv[1], &nsObjc, &nsObjv) != TCL_OK) {
+ if (Tcl_ListObjGetElements(interp, objv[1], &nsObjc, &nsObjv) != TCL_OK) {
goto badNamespace;
}
if (nsObjc != 0) {
namespaceList = (Tcl_Namespace **)TclStackAlloc(interp,
sizeof(Tcl_Namespace *) * nsObjc);
- for (i=0 ; i<(size_t)nsObjc ; i++) {
+ for (i = 0; i < nsObjc; i++) {
if (TclGetNamespaceFromObj(interp, nsObjv[i],
&namespaceList[i]) != TCL_OK) {
goto badNamespace;
@@ -4428,7 +4428,7 @@ Tcl_SetNamespaceUnknownHandler(
Tcl_Namespace *nsPtr, /* Namespace which is being updated. */
Tcl_Obj *handlerPtr) /* The new handler, or NULL to reset. */
{
- int lstlen = 0;
+ size_t lstlen = 0;
Namespace *currNsPtr = (Namespace *) nsPtr;
/*
@@ -4436,7 +4436,7 @@ Tcl_SetNamespaceUnknownHandler(
*/
if (handlerPtr != NULL) {
- if (TclListObjLength_(interp, handlerPtr, &lstlen) != TCL_OK) {
+ if (Tcl_ListObjLength(interp, handlerPtr, &lstlen) != TCL_OK) {
/*
* Not a list.
*/
@@ -5010,10 +5010,10 @@ TclLogCommandInfo(
iPtr->errorStack = newObj;
}
if (iPtr->resetErrorStack) {
- int len;
+ size_t len;
iPtr->resetErrorStack = 0;
- TclListObjLength_(interp, iPtr->errorStack, &len);
+ Tcl_ListObjLength(interp, iPtr->errorStack, &len);
/*
* Reset while keeping the list internalrep as much as possible.
@@ -5095,10 +5095,10 @@ TclErrorStackResetIf(
iPtr->errorStack = newObj;
}
if (iPtr->resetErrorStack) {
- int len;
+ size_t len;
iPtr->resetErrorStack = 0;
- TclListObjLength_(interp, iPtr->errorStack, &len);
+ Tcl_ListObjLength(interp, iPtr->errorStack, &len);
/*
* Reset while keeping the list internalrep as much as possible.
diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c
index 81e94c6..c8b97a5 100644
--- a/generic/tclOOMethod.c
+++ b/generic/tclOOMethod.c
@@ -387,17 +387,17 @@ TclOONewProcMethod(
* structure's contents. NULL if caller is not
* interested. */
{
- int argsLen; /* -1 => delete argsObj before exit */
+ size_t argsLen; /* TCL_INDEX_NONE => delete argsObj before exit */
ProcedureMethod *pmPtr;
const char *procName;
Tcl_Method method;
if (argsObj == NULL) {
- argsLen = -1;
+ argsLen = TCL_INDEX_NONE;
TclNewObj(argsObj);
Tcl_IncrRefCount(argsObj);
procName = "<destructor>";
- } else if (TclListObjLength_(interp, argsObj, &argsLen) != TCL_OK) {
+ } else if (Tcl_ListObjLength(interp, argsObj, &argsLen) != TCL_OK) {
return NULL;
} else {
procName = (nameObj==NULL ? "<constructor>" : TclGetString(nameObj));
@@ -412,7 +412,7 @@ TclOONewProcMethod(
method = TclOOMakeProcMethod(interp, clsPtr, flags, nameObj, procName,
argsObj, bodyObj, &procMethodType, pmPtr, &pmPtr->procPtr);
- if (argsLen == -1) {
+ if (argsLen == TCL_INDEX_NONE) {
Tcl_DecrRefCount(argsObj);
}
if (method == NULL) {
@@ -1387,10 +1387,10 @@ TclOONewForwardInstanceMethod(
Tcl_Obj *prefixObj) /* List of arguments that form the command
* prefix to forward to. */
{
- int prefixLen;
+ size_t prefixLen;
ForwardMethod *fmPtr;
- if (TclListObjLength_(interp, prefixObj, &prefixLen) != TCL_OK) {
+ if (Tcl_ListObjLength(interp, prefixObj, &prefixLen) != TCL_OK) {
return NULL;
}
if (prefixLen < 1) {
@@ -1426,10 +1426,10 @@ TclOONewForwardMethod(
Tcl_Obj *prefixObj) /* List of arguments that form the command
* prefix to forward to. */
{
- int prefixLen;
+ size_t prefixLen;
ForwardMethod *fmPtr;
- if (TclListObjLength_(interp, prefixObj, &prefixLen) != TCL_OK) {
+ if (Tcl_ListObjLength(interp, prefixObj, &prefixLen) != TCL_OK) {
return NULL;
}
if (prefixLen < 1) {
@@ -1468,7 +1468,9 @@ InvokeForwardMethod(
CallContext *contextPtr = (CallContext *) context;
ForwardMethod *fmPtr = (ForwardMethod *)clientData;
Tcl_Obj **argObjs, **prefixObjs;
- int numPrefixes, len, skip = contextPtr->skip;
+ size_t numPrefixes;
+ int len;
+ int skip = contextPtr->skip;
/*
* Build the real list of arguments to use. Note that we know that the
@@ -1477,7 +1479,7 @@ InvokeForwardMethod(
* can ignore here.
*/
- TclListObjGetElements_(NULL, fmPtr->prefixObj, &numPrefixes, &prefixObjs);
+ Tcl_ListObjGetElements(NULL, fmPtr->prefixObj, &numPrefixes, &prefixObjs);
argObjs = InitEnsembleRewrite(interp, objc, objv, skip,
numPrefixes, prefixObjs, &len);
Tcl_NRAddCallback(interp, FinalizeForwardCall, argObjs, NULL, NULL, NULL);
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 6dd1a4e..113c2ed 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -2310,11 +2310,11 @@ SetFsPathFromAny(
* beginning with ~ are part of the native filesystem.
*/
- int objc;
+ size_t objc;
Tcl_Obj **objv;
Tcl_Obj *parts = TclpNativeSplitPath(pathPtr, NULL);
- TclListObjGetElements_(NULL, parts, &objc, &objv);
+ Tcl_ListObjGetElements(NULL, parts, &objc, &objv);
/*
* Skip '~'. It's replaced by its expansion.
diff --git a/generic/tclPkg.c b/generic/tclPkg.c
index 5e025a9..3f70ab8 100644
--- a/generic/tclPkg.c
+++ b/generic/tclPkg.c
@@ -1079,7 +1079,8 @@ TclNRPackageObjCmd(
PKG_VERSIONS, PKG_VSATISFIES
};
Interp *iPtr = (Interp *) interp;
- int optionIndex, exact, i, newobjc, satisfies;
+ int optionIndex, exact, satisfies;
+ size_t i, newobjc;
PkgAvail *availPtr, *prevPtr;
Package *pkgPtr;
Tcl_HashEntry *hPtr;
@@ -1123,7 +1124,7 @@ TclNRPackageObjCmd(
PkgFiles *pkgFiles = (PkgFiles *)
Tcl_GetAssocData(interp, "tclPkgFiles", NULL);
- for (i = 2; i < objc; i++) {
+ for (i = 2; i < (size_t)objc; i++) {
keyString = TclGetString(objv[i]);
if (pkgFiles) {
hPtr = Tcl_FindHashEntry(&pkgFiles->table, keyString);
@@ -1361,7 +1362,7 @@ TclNRPackageObjCmd(
objvListPtr = Tcl_NewListObj(0, NULL);
Tcl_IncrRefCount(objvListPtr);
Tcl_ListObjAppendElement(interp, objvListPtr, ov);
- TclListObjGetElements_(interp, objvListPtr, &newobjc, &newObjvPtr);
+ Tcl_ListObjGetElements(interp, objvListPtr, &newobjc, &newObjvPtr);
Tcl_NRAddCallback(interp,
TclNRPackageObjCmdCleanup, objv[3], objvListPtr, NULL,NULL);
@@ -1388,7 +1389,7 @@ TclNRPackageObjCmd(
Tcl_ListObjAppendElement(interp, objvListPtr,
Tcl_DuplicateObj(newobjv[i]));
}
- TclListObjGetElements_(interp, objvListPtr, &newobjc, &newObjvPtr);
+ Tcl_ListObjGetElements(interp, objvListPtr, &newobjc, &newObjvPtr);
Tcl_NRAddCallback(interp,
TclNRPackageObjCmdCleanup, objv[2], objvListPtr, NULL,NULL);
Tcl_NRAddCallback(interp,
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 138478c..0162def 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -404,10 +404,10 @@ TclCreateProc(
Interp *iPtr = (Interp *) interp;
Proc *procPtr = NULL;
- int i, result, numArgs;
+ size_t i, numArgs;
CompiledLocal *localPtr = NULL;
Tcl_Obj **argArray;
- int precompiled = 0;
+ int precompiled = 0, result;
ProcGetIntRep(bodyPtr, procPtr);
if (procPtr != NULL) {
@@ -484,15 +484,15 @@ TclCreateProc(
* in the Proc.
*/
- result = TclListObjGetElements_(interp , argsPtr ,&numArgs ,&argArray);
+ result = Tcl_ListObjGetElements(interp , argsPtr ,&numArgs ,&argArray);
if (result != TCL_OK) {
goto procError;
}
if (precompiled) {
- if (numArgs > procPtr->numArgs) {
+ if (numArgs > (size_t)procPtr->numArgs) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "procedure \"%s\": arg list contains %d entries, "
+ "procedure \"%s\": arg list contains %" TCL_Z_MODIFIER "d entries, "
"precompiled header expects %d", procName, numArgs,
procPtr->numArgs));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
@@ -507,15 +507,14 @@ TclCreateProc(
for (i = 0; i < numArgs; i++) {
const char *argname, *argnamei, *argnamelast;
- int fieldCount;
- size_t nameLength;
+ size_t fieldCount, nameLength;
Tcl_Obj **fieldValues;
/*
* Now divide the specifier up into name and default.
*/
- result = TclListObjGetElements_(interp, argArray[i], &fieldCount,
+ result = Tcl_ListObjGetElements(interp, argArray[i], &fieldCount,
&fieldValues);
if (result != TCL_OK) {
goto procError;
@@ -583,12 +582,12 @@ TclCreateProc(
if ((localPtr->nameLength != nameLength)
|| (memcmp(localPtr->name, argname, nameLength) != 0)
- || (localPtr->frameIndex != i)
+ || ((size_t)localPtr->frameIndex != i)
|| !(localPtr->flags & VAR_ARGUMENT)
|| (localPtr->defValuePtr == NULL && fieldCount == 2)
|| (localPtr->defValuePtr != NULL && fieldCount != 2)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "procedure \"%s\": formal parameter %d is "
+ "procedure \"%s\": formal parameter %" TCL_Z_MODIFIER "d is "
"inconsistent with precompiled body", procName, i));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
"BYTECODELIES", NULL);
@@ -2383,7 +2382,8 @@ SetLambdaFromAny(
Interp *iPtr = (Interp *) interp;
const char *name;
Tcl_Obj *argsPtr, *bodyPtr, *nsObjPtr, **objv;
- int isNew, objc, result;
+ int isNew, result;
+ size_t objc;
CmdFrame *cfPtr = NULL;
Proc *procPtr;
@@ -2396,7 +2396,7 @@ SetLambdaFromAny(
* length is not 2, then it cannot be converted to lambdaType.
*/
- result = TclListObjGetElements_(NULL, objPtr, &objc, &objv);
+ result = Tcl_ListObjGetElements(NULL, objPtr, &objc, &objv);
if ((result != TCL_OK) || ((objc != 2) && (objc != 3))) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't interpret \"%s\" as a lambda expression",
diff --git a/generic/tclProcess.c b/generic/tclProcess.c
index 31a17fa..49f9c9c 100644
--- a/generic/tclProcess.c
+++ b/generic/tclProcess.c
@@ -463,10 +463,9 @@ ProcessStatusObjCmd(
Tcl_HashEntry *entry;
Tcl_HashSearch search;
ProcessInfo *info;
- int numPids;
+ size_t i, numPids;
Tcl_Obj **pidObjs;
int result;
- int i;
int pid;
Tcl_Obj *const *savedobjv = objv;
static const char *const switches[] = {
@@ -533,7 +532,7 @@ ProcessStatusObjCmd(
* Only return statuses of provided processes.
*/
- result = TclListObjGetElements_(interp, objv[1], &numPids, &pidObjs);
+ result = Tcl_ListObjGetElements(interp, objv[1], &numPids, &pidObjs);
if (result != TCL_OK) {
return result;
}
@@ -609,11 +608,9 @@ ProcessPurgeObjCmd(
Tcl_HashEntry *entry;
Tcl_HashSearch search;
ProcessInfo *info;
- int numPids;
+ size_t i, numPids;
Tcl_Obj **pidObjs;
- int result;
- int i;
- int pid;
+ int result, pid;
if (objc != 1 && objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?pids?");
@@ -648,7 +645,7 @@ ProcessPurgeObjCmd(
* Purge only provided processes.
*/
- result = TclListObjGetElements_(interp, objv[1], &numPids, &pidObjs);
+ result = Tcl_ListObjGetElements(interp, objv[1], &numPids, &pidObjs);
if (result != TCL_OK) {
return result;
}
diff --git a/generic/tclResult.c b/generic/tclResult.c
index c0467d7..6286070 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -1100,11 +1100,12 @@ Tcl_SetReturnOptions(
Tcl_Interp *interp,
Tcl_Obj *options)
{
- int objc, level, code;
+ size_t objc;
+ int level, code;
Tcl_Obj **objv, *mergedOpts;
Tcl_IncrRefCount(options);
- if (TCL_ERROR == TclListObjGetElements_(interp, options, &objc, &objv)
+ if (TCL_ERROR == Tcl_ListObjGetElements(interp, options, &objc, &objv)
|| (objc % 2)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"expected dict but got \"%s\"", TclGetString(options)));
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 65c9983..ee2cde9 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -1717,12 +1717,12 @@ Tcl_AppendFormatToObj(
Tcl_Interp *interp,
Tcl_Obj *appendObj,
const char *format,
- int objc,
+ size_t objc,
Tcl_Obj *const objv[])
{
const char *span = format, *msg, *errCode;
- int objIndex = 0, gotXpg = 0, gotSequential = 0;
- size_t originalLength, limit, numBytes = 0;
+ int gotXpg = 0, gotSequential = 0;
+ size_t objIndex = 0, originalLength, limit, numBytes = 0;
Tcl_UniChar ch = 0;
static const char *mixedXPG =
"cannot mix \"%\" and \"%n$\" conversion specifiers";
@@ -1814,7 +1814,7 @@ Tcl_AppendFormatToObj(
}
gotSequential = 1;
}
- if ((objIndex < 0) || (objIndex >= objc)) {
+ if (objIndex >= objc) {
msg = badIndex[gotXpg];
errCode = gotXpg ? "INDEXRANGE" : "FIELDVARMISMATCH";
goto errorMsg;
@@ -2517,7 +2517,8 @@ AppendPrintfToObjVA(
const char *format,
va_list argList)
{
- int code, objc;
+ int code;
+ size_t objc;
Tcl_Obj **objv, *list;
const char *p;
@@ -2678,7 +2679,7 @@ AppendPrintfToObjVA(
}
} while (seekingConversion);
}
- TclListObjGetElements_(NULL, list, &objc, &objv);
+ Tcl_ListObjGetElements(NULL, list, &objc, &objv);
code = Tcl_AppendFormatToObj(NULL, objPtr, format, objc, objv);
if (code != TCL_OK) {
Tcl_AppendPrintfToObj(objPtr,
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 1fae619..72bf4cd 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -419,8 +419,8 @@ TraceExecutionObjCmd(
switch ((enum traceOptions) optionIndex) {
case TRACE_ADD:
case TRACE_REMOVE: {
- int flags = 0;
- int i, listLen, result;
+ int flags = 0, result;
+ size_t i, listLen;
Tcl_Obj **elemPtrs;
if (objc != 6) {
@@ -433,7 +433,7 @@ TraceExecutionObjCmd(
* pointer to its array of element pointers.
*/
- result = TclListObjGetElements_(interp, objv[4], &listLen, &elemPtrs);
+ result = Tcl_ListObjGetElements(interp, objv[4], &listLen, &elemPtrs);
if (result != TCL_OK) {
return result;
}
@@ -660,8 +660,8 @@ TraceCommandObjCmd(
switch ((enum traceOptions) optionIndex) {
case TRACE_ADD:
case TRACE_REMOVE: {
- int flags = 0;
- int i, listLen, result;
+ int flags = 0, result;
+ size_t i, listLen;
Tcl_Obj **elemPtrs;
if (objc != 6) {
@@ -674,7 +674,7 @@ TraceCommandObjCmd(
* pointer to its array of element pointers.
*/
- result = TclListObjGetElements_(interp, objv[4], &listLen, &elemPtrs);
+ result = Tcl_ListObjGetElements(interp, objv[4], &listLen, &elemPtrs);
if (result != TCL_OK) {
return result;
}
@@ -859,8 +859,8 @@ TraceVariableObjCmd(
switch ((enum traceOptions) optionIndex) {
case TRACE_ADD:
case TRACE_REMOVE: {
- int flags = 0;
- int i, listLen, result;
+ int flags = 0, result;
+ size_t i, listLen;
Tcl_Obj **elemPtrs;
if (objc != 6) {
@@ -873,7 +873,7 @@ TraceVariableObjCmd(
* pointer to its array of element pointers.
*/
- result = TclListObjGetElements_(interp, objv[4], &listLen, &elemPtrs);
+ result = Tcl_ListObjGetElements(interp, objv[4], &listLen, &elemPtrs);
if (result != TCL_OK) {
return result;
}
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 7ba2008..5ac7c2d 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -1935,11 +1935,11 @@ Tcl_Concat(
Tcl_Obj *
Tcl_ConcatObj(
- int objc, /* Number of objects to concatenate. */
+ size_t objc, /* Number of objects to concatenate. */
Tcl_Obj *const objv[]) /* Array of objects to concatenate. */
{
- int i, needSpace = 0;
- size_t bytesNeeded = 0, elemLength;
+ int needSpace = 0;
+ size_t i, bytesNeeded = 0, elemLength;
const char *element;
Tcl_Obj *objPtr, *resPtr;
diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c
index 8384a43..b6abb50 100644
--- a/win/tclWinSerial.c
+++ b/win/tclWinSerial.c
@@ -1826,7 +1826,8 @@ SerialSetOptionProc(
*/
if ((len > 4) && (strncmp(optionName, "-ttycontrol", len) == 0)) {
- int i, res = TCL_OK;
+ size_t i;
+ int res = TCL_OK;
if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) {
return TCL_ERROR;