diff options
Diffstat (limited to 'generic')
-rwxr-xr-x | generic/tclArithSeries.c | 2 | ||||
-rw-r--r-- | generic/tclAssembly.c | 2 | ||||
-rw-r--r-- | generic/tclCmdIL.c | 2 | ||||
-rw-r--r-- | generic/tclCompCmds.c | 2 | ||||
-rw-r--r-- | generic/tclCompCmdsGR.c | 4 | ||||
-rw-r--r-- | generic/tclCompCmdsSZ.c | 4 | ||||
-rw-r--r-- | generic/tclCompile.c | 6 | ||||
-rw-r--r-- | generic/tclExecute.c | 2 | ||||
-rw-r--r-- | generic/tclFCmd.c | 2 | ||||
-rw-r--r-- | generic/tclFileName.c | 12 | ||||
-rw-r--r-- | generic/tclIOCmd.c | 4 | ||||
-rw-r--r-- | generic/tclIORTrans.c | 4 | ||||
-rw-r--r-- | generic/tclIOUtil.c | 12 | ||||
-rw-r--r-- | generic/tclLink.c | 4 | ||||
-rw-r--r-- | generic/tclLiteral.c | 9 | ||||
-rw-r--r-- | generic/tclNamesp.c | 2 | ||||
-rw-r--r-- | generic/tclOOBasic.c | 4 | ||||
-rw-r--r-- | generic/tclOODefineCmds.c | 14 | ||||
-rw-r--r-- | generic/tclObj.c | 2 | ||||
-rw-r--r-- | generic/tclOptimize.c | 4 | ||||
-rw-r--r-- | generic/tclPathObj.c | 40 | ||||
-rw-r--r-- | generic/tclPkg.c | 6 | ||||
-rw-r--r-- | generic/tclRegexp.c | 2 | ||||
-rw-r--r-- | generic/tclResult.c | 4 | ||||
-rw-r--r-- | generic/tclTest.c | 16 | ||||
-rw-r--r-- | generic/tclTimer.c | 4 | ||||
-rw-r--r-- | generic/tclVar.c | 4 | ||||
-rw-r--r-- | generic/tclZipfs.c | 68 | ||||
-rw-r--r-- | generic/tclZlib.c | 29 |
29 files changed, 139 insertions, 131 deletions
diff --git a/generic/tclArithSeries.c b/generic/tclArithSeries.c index 2efae10..9d87f1a 100755 --- a/generic/tclArithSeries.c +++ b/generic/tclArithSeries.c @@ -592,7 +592,7 @@ UpdateStringOfArithSeries(Tcl_Obj *arithSeriesObj) Tcl_Obj *elemObj; Tcl_Size i; Tcl_WideInt length = 0; - size_t slen; + Tcl_Size slen; /* * Pass 1: estimate space. diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index e3f9517..910532e 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -857,7 +857,7 @@ CompileAssembleObj( * names in the bytecode resolve */ int status; /* Status return from Tcl_AssembleCode */ const char* source; /* String representation of the source code */ - size_t sourceLen; /* Length of the source code in bytes */ + Tcl_Size sourceLen; /* Length of the source code in bytes */ /* * Get the expression ByteCode from the object. If it exists, make sure it diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index c5a6616..dbc74bd 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -2940,7 +2940,7 @@ Tcl_LrepeatObjCmd( } if (elementCount < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "bad count \"%d\": must be integer >= 0", elementCount)); + "bad count \"%" TCL_SIZE_MODIFIER "d\": must be integer >= 0", elementCount)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LREPEAT", "NEGARG", NULL); return TCL_ERROR; diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 2c1fe69..f86de84 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -3156,7 +3156,7 @@ TclCompileFormatCmd( Tcl_Obj **objv, *formatObj, *tmpObj; const char *bytes, *start; int i, j; - size_t len; + Tcl_Size len; /* * Don't handle any guaranteed-error cases. diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c index 5b79187..f35cd50 100644 --- a/generic/tclCompCmdsGR.c +++ b/generic/tclCompCmdsGR.c @@ -2113,7 +2113,7 @@ TclCompileRegsubCmd( Tcl_DString pattern; const char *bytes; int exact, quantified, result = TCL_ERROR; - size_t len; + Tcl_Size len; if ((int)parsePtr->numWords < 5 || (int)parsePtr->numWords > 6) { return TCL_ERROR; @@ -2705,7 +2705,7 @@ IndexTailVarIfKnown( Tcl_Obj *tailPtr; const char *tailName, *p; int n = varTokenPtr->numComponents; - size_t len; + Tcl_Size len; Tcl_Token *lastTokenPtr; int full, localIndex; diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index a819c97..531fbf0 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -252,7 +252,7 @@ TclCompileStringCatCmd( } else { Tcl_DecrRefCount(obj); if (folded) { - size_t len; + Tcl_Size len; const char *bytes = Tcl_GetStringFromObj(folded, &len); PushLiteral(envPtr, bytes, len); @@ -270,7 +270,7 @@ TclCompileStringCatCmd( wordTokenPtr = TokenAfter(wordTokenPtr); } if (folded) { - size_t len; + Tcl_Size len; const char *bytes = Tcl_GetStringFromObj(folded, &len); PushLiteral(envPtr, bytes, len); diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 6940448..5da5cf1 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -776,7 +776,7 @@ TclSetByteCodeFromAny( Interp *iPtr = (Interp *) interp; CompileEnv compEnv; /* Compilation environment structure allocated * in frame. */ - size_t length; + Tcl_Size length; int result = TCL_OK; const char *stringPtr; Proc *procPtr = iPtr->compiledProcPtr; @@ -1328,7 +1328,7 @@ CompileSubstObj( } if (codePtr == NULL) { CompileEnv compEnv; - size_t numBytes; + Tcl_Size numBytes; const char *bytes = Tcl_GetStringFromObj(objPtr, &numBytes); /* TODO: Check for more TIP 280 */ @@ -1812,7 +1812,7 @@ CompileCmdLiteral( const char *bytes; Command *cmdPtr; int cmdLitIdx, extraLiteralFlags = LITERAL_CMD_NAME; - size_t length; + Tcl_Size length; cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, cmdObj); if ((cmdPtr != NULL) && (cmdPtr->flags & CMD_VIA_RESOLVER)) { diff --git a/generic/tclExecute.c b/generic/tclExecute.c index f22538f..a69d29c 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -1437,7 +1437,7 @@ CompileExprObj( * TIP #280: No invoker (yet) - Expression compilation. */ - size_t length; + Tcl_Size length; const char *string = Tcl_GetStringFromObj(objPtr, &length); TclInitCompileEnv(interp, &compEnv, string, length, NULL, 0); diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index f5c9a37..ca4ff27 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -1381,7 +1381,7 @@ TclFileTemporaryCmd( TclNewObj(nameObj); } if (objc > 2) { - size_t length; + Tcl_Size length; Tcl_Obj *templateObj = objv[2]; const char *string = Tcl_GetStringFromObj(templateObj, &length); diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 4dab688..c9148c1 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -807,7 +807,7 @@ TclpNativeJoinPath( const char *joining) { int needsSep; - size_t length; + Tcl_Size length; char *dest; const char *p; const char *start; @@ -848,7 +848,7 @@ TclpNativeJoinPath( * Append the element, eliminating duplicate and trailing slashes. */ - Tcl_SetObjLength(prefix, length + (int) strlen(p)); + Tcl_SetObjLength(prefix, length + strlen(p)); dest = TclGetString(prefix) + length; for (; *p != '\0'; p++) { @@ -1358,7 +1358,7 @@ Tcl_GlobObjCmd( globTypes->macCreator = NULL; while (length-- > 0) { - size_t len; + Tcl_Size len; const char *str; Tcl_ListObjIndex(interp, typePtr, length, &look); @@ -2188,7 +2188,7 @@ DoGlob( */ if (*p == '\0') { - size_t length; + Tcl_Size length; Tcl_DString append; /* @@ -2252,7 +2252,7 @@ DoGlob( * The current prefix must end in a separator. */ - size_t len; + Tcl_Size len; const char *joined = Tcl_GetStringFromObj(joinedPtr,&len); if ((len > 0) && (strchr(separators, joined[len-1]) == NULL)) { @@ -2289,7 +2289,7 @@ DoGlob( * This behaviour is not currently tested for in the test suite. */ - size_t len; + Tcl_Size len; const char *joined = Tcl_GetStringFromObj(joinedPtr,&len); if ((len > 0) && (strchr(separators, joined[len-1]) == NULL)) { diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index ecc8652..93c50ec 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -698,7 +698,7 @@ Tcl_CloseObjCmd( Tcl_Obj *resultPtr = Tcl_GetObjResult(interp); const char *string; - size_t len; + Tcl_Size len; if (Tcl_IsShared(resultPtr)) { resultPtr = Tcl_DuplicateObj(resultPtr); @@ -858,7 +858,7 @@ Tcl_ExecObjCmd( const char *string; Tcl_Channel chan; int argc, background, i, index, keepNewline, result, skip, ignoreStderr; - size_t length; + Tcl_Size length; static const char *const options[] = { "-ignorestderr", "-keepnewline", "--", NULL }; diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index b3af45e..3c54366 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -2004,7 +2004,7 @@ InvokeTclMethod( */ if (result != TCL_ERROR) { Tcl_Obj *cmd = Tcl_NewListObj(cmdc, rtPtr->argv); - size_t cmdLen; + Tcl_Size cmdLen; const char *cmdString = Tcl_GetStringFromObj(cmd, &cmdLen); Tcl_IncrRefCount(cmd); @@ -2770,7 +2770,7 @@ ForwardSetObjError( ForwardParam *paramPtr, Tcl_Obj *obj) { - size_t len; + Tcl_Size len; const char *msgStr = Tcl_GetStringFromObj(obj, &len); len++; diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index f2f91a7..cec6ad3 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -521,7 +521,7 @@ TclFSCwdPointerEquals( if (tsdPtr->cwdPathPtr == *pathPtrPtr) { return 1; } else { - size_t len1, len2; + Tcl_Size len1, len2; const char *str1, *str2; str1 = Tcl_GetStringFromObj(tsdPtr->cwdPathPtr, &len1); @@ -663,7 +663,7 @@ FsUpdateCwd( Tcl_Obj *cwdObj, void *clientData) { - size_t len = 0; + Tcl_Size len = 0; const char *str = NULL; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&fsDataKey); @@ -1324,7 +1324,7 @@ TclFSNormalizeToUniquePath( { FilesystemRecord *fsRecPtr, *firstFsRecPtr; - size_t i; + Tcl_Size i; int isVfsPath = 0; const char *path; @@ -1686,7 +1686,7 @@ Tcl_FSEvalFileEx( const char *encodingName) /* Either the name of an encoding or NULL to use the utf-8 encoding. */ { - size_t length; + Tcl_Size length; int result = TCL_ERROR; Tcl_StatBuf statBuf; Tcl_Obj *oldScriptFile; @@ -1952,7 +1952,7 @@ EvalFileCallback( * Record information about where the error occurred. */ - size_t length; + Tcl_Size length; const char *pathString = Tcl_GetStringFromObj(pathPtr, &length); const unsigned int limit = 150; int overflow = (length > limit); @@ -2794,7 +2794,7 @@ Tcl_FSGetCwd( * infinite loop bug when trying to normalize tsdPtr->cwdPathPtr. */ - size_t len1, len2; + Tcl_Size len1, len2; const char *str1, *str2; str1 = Tcl_GetStringFromObj(tsdPtr->cwdPathPtr, &len1); diff --git a/generic/tclLink.c b/generic/tclLink.c index 1cd5f15..7474769 100644 --- a/generic/tclLink.c +++ b/generic/tclLink.c @@ -592,7 +592,7 @@ SetInvalidRealFromAny( { const char *str; const char *endPtr; - size_t length; + Tcl_Size length; str = Tcl_GetStringFromObj(objPtr, &length); if ((length == 1) && (str[0] == '.')) { @@ -638,7 +638,7 @@ GetInvalidIntFromObj( Tcl_Obj *objPtr, int *intPtr) { - size_t length; + Tcl_Size length; const char *str = Tcl_GetStringFromObj(objPtr, &length); if ((length == 0) || ((length == 2) && (str[0] == '0') diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index d04776a..7ddb88a 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -560,7 +560,8 @@ TclHideLiteral( { LiteralEntry **nextPtrPtr, *entryPtr, *lPtr; LiteralTable *localTablePtr = &envPtr->localLitTable; - size_t localHash, length; + size_t localHash; + Tcl_Size length; const char *bytes; Tcl_Obj *newObjPtr; @@ -837,7 +838,8 @@ TclReleaseLiteral( LiteralTable *globalTablePtr; LiteralEntry *entryPtr, *prevPtr; const char *bytes; - size_t length, index; + size_t index; + Tcl_Size length; if (iPtr == NULL) { goto done; @@ -980,7 +982,8 @@ RebuildLiteralTable( LiteralEntry *entryPtr; LiteralEntry **bucketPtr; const char *bytes; - size_t oldSize, count, index, length; + size_t oldSize, count, index; + Tcl_Size length; oldSize = tablePtr->numBuckets; oldBuckets = tablePtr->buckets; diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 8e16b17..0a4bf58 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -3145,7 +3145,7 @@ NamespaceCodeCmd( Namespace *currNsPtr; Tcl_Obj *listPtr, *objPtr; const char *arg; - size_t length; + Tcl_Size length; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "arg"); diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c index c9b0d5f..e644a2f 100644 --- a/generic/tclOOBasic.c +++ b/generic/tclOOBasic.c @@ -185,7 +185,7 @@ TclOO_Class_Create( { Object *oPtr = (Object *) Tcl_ObjectContextObject(context); const char *objName; - size_t len; + Tcl_Size len; /* * Sanity check; should not be possible to invoke this method on a @@ -250,7 +250,7 @@ TclOO_Class_CreateNs( { Object *oPtr = (Object *) Tcl_ObjectContextObject(context); const char *objName, *nsName; - size_t len; + Tcl_Size len; /* * Sanity check; should not be possible to invoke this method on a diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index bde8203..84204f9 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -704,7 +704,7 @@ TclOOUnknownDefinition( Namespace *nsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp); Tcl_HashSearch search; Tcl_HashEntry *hPtr; - size_t soughtLen; + Tcl_Size soughtLen; const char *soughtStr, *matchedStr = NULL; if (objc < 2) { @@ -778,7 +778,7 @@ FindCommand( Tcl_Obj *stringObj, Tcl_Namespace *const namespacePtr) { - size_t length; + Tcl_Size length; const char *nameStr, *string = Tcl_GetStringFromObj(stringObj, &length); Namespace *const nsPtr = (Namespace *) namespacePtr; FOREACH_HASH_DECLS; @@ -997,16 +997,16 @@ GenerateErrorInfo( * an object, class or class-as-object that * was being configured. */ { - size_t length; + Tcl_Size length; Tcl_Obj *realNameObj = Tcl_ObjectDeleted((Tcl_Object) oPtr) ? savedNameObj : TclOOObjectName(interp, oPtr); const char *objName = Tcl_GetStringFromObj(realNameObj, &length); - unsigned limit = OBJNAME_LENGTH_IN_ERRORINFO_LIMIT; + int limit = OBJNAME_LENGTH_IN_ERRORINFO_LIMIT; int overflow = (length > limit); Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( "\n (in definition script for %s \"%.*s%s\" line %d)", - typeOfSubject, (overflow ? limit : (unsigned)length), objName, + typeOfSubject, (overflow ? limit : (int)length), objName, (overflow ? "..." : ""), Tcl_GetErrorLine(interp))); } @@ -1534,7 +1534,7 @@ TclOODefineConstructorObjCmd( Object *oPtr; Class *clsPtr; Tcl_Method method; - size_t bodyLength; + Tcl_Size bodyLength; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "arguments body"); @@ -1745,7 +1745,7 @@ TclOODefineDestructorObjCmd( Object *oPtr; Class *clsPtr; Tcl_Method method; - size_t bodyLength; + Tcl_Size bodyLength; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "body"); diff --git a/generic/tclObj.c b/generic/tclObj.c index 3735084..a978a09 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -617,7 +617,7 @@ TclContinuationsEnterDerived( int start, int *clNext) { - size_t length; + Tcl_Size length; int end, num; int *wordCLLast = clNext; diff --git a/generic/tclOptimize.c b/generic/tclOptimize.c index e0a77aa..7a4a962 100644 --- a/generic/tclOptimize.c +++ b/generic/tclOptimize.c @@ -232,7 +232,7 @@ ConvertZeroEffectToNOP( && TclGetUInt1AtPtr(currentInstPtr + size + 1) == 2) { Tcl_Obj *litPtr = TclFetchLiteral(envPtr, TclGetUInt1AtPtr(currentInstPtr + 1)); - size_t numBytes; + Tcl_Size numBytes; (void) Tcl_GetStringFromObj(litPtr, &numBytes); if (numBytes == 0) { @@ -247,7 +247,7 @@ ConvertZeroEffectToNOP( && TclGetUInt1AtPtr(currentInstPtr + size + 1) == 2) { Tcl_Obj *litPtr = TclFetchLiteral(envPtr, TclGetUInt4AtPtr(currentInstPtr + 1)); - size_t numBytes; + Tcl_Size numBytes; (void) Tcl_GetStringFromObj(litPtr, &numBytes); if (numBytes == 0) { diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index a59256f..abf9d6b 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -25,7 +25,7 @@ static void DupFsPathInternalRep(Tcl_Obj *srcPtr, static void FreeFsPathInternalRep(Tcl_Obj *pathPtr); static void UpdateStringOfFsPath(Tcl_Obj *pathPtr); static int SetFsPathFromAny(Tcl_Interp *interp, Tcl_Obj *pathPtr); -static size_t FindSplitPos(const char *path, int separator); +static Tcl_Size FindSplitPos(const char *path, int separator); static int IsSeparatorOrNull(int ch); static Tcl_Obj * GetExtension(Tcl_Obj *pathPtr); static int MakePathFromNormalized(Tcl_Interp *interp, @@ -206,7 +206,7 @@ TclFSNormalizeAbsolutePath( /* * Need to skip '.' in the path. */ - size_t curLen; + Tcl_Size curLen; if (retVal == NULL) { const char *path = TclGetString(pathPtr); @@ -226,7 +226,7 @@ TclFSNormalizeAbsolutePath( } if (dirSep[2] == '.' && IsSeparatorOrNull(dirSep[3])) { Tcl_Obj *linkObj; - size_t curLen; + Tcl_Size curLen; char *linkStr; /* @@ -305,7 +305,7 @@ TclFSNormalizeAbsolutePath( */ if (tclPlatform == TCL_PLATFORM_WINDOWS) { - size_t i; + Tcl_Size i; for (i = 0; i < curLen; i++) { if (linkStr[i] == '\\') { @@ -385,7 +385,7 @@ TclFSNormalizeAbsolutePath( */ if (tclPlatform == TCL_PLATFORM_WINDOWS) { - size_t len; + Tcl_Size len; const char *path = Tcl_GetStringFromObj(retVal, &len); if (len == 2 && path[0] != 0 && path[1] == ':') { @@ -559,7 +559,7 @@ TclPathPart( * the standardPath code. */ - size_t numBytes; + Tcl_Size numBytes; const char *rest = Tcl_GetStringFromObj(fsPathPtr->normPathPtr, &numBytes); if (strchr(rest, '/') != NULL) { @@ -596,7 +596,7 @@ TclPathPart( * we don't, and instead just use the standardPath code. */ - size_t numBytes; + Tcl_Size numBytes; const char *rest = Tcl_GetStringFromObj(fsPathPtr->normPathPtr, &numBytes); if (strchr(rest, '/') != NULL) { @@ -624,7 +624,7 @@ TclPathPart( return GetExtension(fsPathPtr->normPathPtr); case TCL_PATH_ROOT: { const char *fileName, *extension; - size_t length; + Tcl_Size length; fileName = Tcl_GetStringFromObj(fsPathPtr->normPathPtr, &length); @@ -675,7 +675,7 @@ TclPathPart( if (portion == TCL_PATH_EXTENSION) { return GetExtension(pathPtr); } else if (portion == TCL_PATH_ROOT) { - size_t length; + Tcl_Size length; const char *fileName, *extension; fileName = Tcl_GetStringFromObj(pathPtr, &length); @@ -1166,7 +1166,7 @@ IsSeparatorOrNull( * of the end of the string. */ -static size_t +static Tcl_Size FindSplitPos( const char *path, int separator) @@ -1364,7 +1364,7 @@ TclFSMakePathRelative( Tcl_Obj *pathPtr, /* The path we have. */ Tcl_Obj *cwdPtr) /* Make it relative to this. */ { - size_t cwdLen, len; + Tcl_Size cwdLen, len; const char *tempStr; Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(pathPtr, &fsPathType); @@ -1632,7 +1632,7 @@ Tcl_FSGetTranslatedStringPath( Tcl_Obj *transPtr = Tcl_FSGetTranslatedPath(interp, pathPtr); if (transPtr != NULL) { - size_t len; + Tcl_Size len; const char *orig = Tcl_GetStringFromObj(transPtr, &len); char *result = (char *)Tcl_Alloc(len+1); @@ -1682,7 +1682,7 @@ Tcl_FSGetNormalizedPath( */ Tcl_Obj *dir, *copy; - size_t tailLen, cwdLen; + Tcl_Size tailLen, cwdLen; int pathType; pathType = Tcl_FSGetPathType(fsPathPtr->cwdPtr); @@ -1784,7 +1784,7 @@ Tcl_FSGetNormalizedPath( } fsPathPtr = PATHOBJ(pathPtr); } else if (fsPathPtr->normPathPtr == NULL) { - size_t cwdLen; + Tcl_Size cwdLen; Tcl_Obj *copy; copy = AppendPath(fsPathPtr->cwdPtr, pathPtr); @@ -2117,7 +2117,7 @@ Tcl_FSEqualPaths( Tcl_Obj *secondPtr) { const char *firstStr, *secondStr; - size_t firstLen, secondLen; + Tcl_Size firstLen, secondLen; int tempErrno; if (firstPtr == secondPtr) { @@ -2174,7 +2174,7 @@ SetFsPathFromAny( TCL_UNUSED(Tcl_Interp *), /* Used for error reporting if not NULL. */ Tcl_Obj *pathPtr) /* The object to convert. */ { - size_t len; + Tcl_Size len; FsPath *fsPathPtr; Tcl_Obj *transPtr; @@ -2326,7 +2326,7 @@ UpdateStringOfFsPath( Tcl_Obj *pathPtr) /* path obj with string rep to update. */ { FsPath *fsPathPtr = PATHOBJ(pathPtr); - size_t cwdLen; + Tcl_Size cwdLen; Tcl_Obj *copy; if (PATHFLAGS(pathPtr) == 0 || fsPathPtr->cwdPtr == NULL) { @@ -2398,7 +2398,7 @@ TclNativePathInFilesystem( * situation. */ - size_t len; + Tcl_Size len; (void) Tcl_GetStringFromObj(pathPtr, &len); if (len == 0) { @@ -2544,8 +2544,8 @@ TclResolveTildePath( Tcl_Obj *pathObj) { const char *path; - size_t len; - size_t split; + Tcl_Size len; + Tcl_Size split; Tcl_DString resolvedPath; path = Tcl_GetStringFromObj(pathObj, &len); diff --git a/generic/tclPkg.c b/generic/tclPkg.c index 336018f..3ff7755 100644 --- a/generic/tclPkg.c +++ b/generic/tclPkg.c @@ -1160,7 +1160,7 @@ TclNRPackageObjCmd( break; } case PKG_IFNEEDED: { - size_t length; + Tcl_Size length; int res; char *argv3i, *avi; @@ -1399,7 +1399,7 @@ TclNRPackageObjCmd( } break; case PKG_UNKNOWN: { - size_t length; + Tcl_Size length; if (objc == 2) { if (iPtr->packageUnknown != NULL) { @@ -2072,7 +2072,7 @@ AddRequirementsToResult( { Tcl_Obj *result = Tcl_GetObjResult(interp); int i; - size_t length; + Tcl_Size length; for (i = 0; i < reqc; i++) { const char *v = Tcl_GetStringFromObj(reqv[i], &length); diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c index 1e6a2a9..dfdf12d 100644 --- a/generic/tclRegexp.c +++ b/generic/tclRegexp.c @@ -595,7 +595,7 @@ Tcl_GetRegExpFromObj( * expression. */ int flags) /* Regular expression compilation flags. */ { - size_t length; + Tcl_Size length; TclRegexp *regexpPtr; const char *pattern; diff --git a/generic/tclResult.c b/generic/tclResult.c index 29c36d1..c06a73a 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -354,7 +354,7 @@ Tcl_AppendElement( Tcl_Obj *elementPtr = Tcl_NewStringObj(element, -1); Tcl_Obj *listPtr = Tcl_NewListObj(1, &elementPtr); const char *bytes; - size_t length; + Tcl_Size length; if (Tcl_IsShared(iPtr->objResultPtr)) { Tcl_SetObjResult(interp, Tcl_DuplicateObj(iPtr->objResultPtr)); @@ -718,7 +718,7 @@ TclProcessReturn( Tcl_DictObjGet(NULL, iPtr->returnOpts, keys[KEY_ERRORINFO], &valuePtr); if (valuePtr != NULL) { - size_t length; + Tcl_Size length; (void) Tcl_GetStringFromObj(valuePtr, &length); if (length) { diff --git a/generic/tclTest.c b/generic/tclTest.c index 3a6ebba..9388110 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -2237,7 +2237,7 @@ TestencodingObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_Encoding encoding; - size_t length; + Tcl_Size length; const char *string; TclEncoding *encodingPtr; static const char *const optionStrings[] = { @@ -4126,7 +4126,7 @@ PrintParse( Tcl_Obj *objPtr; const char *typeString; Tcl_Token *tokenPtr; - size_t i; + Tcl_Size i; objPtr = Tcl_GetObjResult(interp); if (parsePtr->commentSize + 1 > 1) { @@ -4140,7 +4140,7 @@ PrintParse( Tcl_NewStringObj(parsePtr->commandStart, parsePtr->commandSize)); Tcl_ListObjAppendElement(NULL, objPtr, Tcl_NewWideIntObj(parsePtr->numWords)); - for (i = 0; i < (size_t)parsePtr->numTokens; i++) { + for (i = 0; i < parsePtr->numTokens; i++) { tokenPtr = &parsePtr->tokenPtr[i]; switch (tokenPtr->type) { case TCL_TOKEN_EXPAND_WORD: @@ -7323,7 +7323,7 @@ SimpleMatchInDirectory( origPtr = SimpleRedirect(dirPtr); res = Tcl_FSMatchInDirectory(interp, resPtr, origPtr, pattern, types); if (res == TCL_OK) { - size_t gLength, j; + Tcl_Size gLength, j; Tcl_ListObjLength(NULL, resPtr, &gLength); for (j = 0; j < gLength; j++) { Tcl_Obj *gElt, *nElt; @@ -7409,7 +7409,7 @@ TestUtfNextCmd( int objc, Tcl_Obj *const objv[]) { - size_t numBytes; + Tcl_Size numBytes; char *bytes; const char *result, *first; char buffer[32]; @@ -7422,7 +7422,7 @@ TestUtfNextCmd( } bytes = Tcl_GetStringFromObj(objv[1], &numBytes); - if (numBytes + 4U > sizeof(buffer)) { + if (numBytes + 4 > (Tcl_Size) sizeof(buffer)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"testutfnext\" can only handle %" TCL_Z_MODIFIER "u bytes", sizeof(buffer) - 4)); @@ -7888,7 +7888,7 @@ TestconcatobjCmd( { Tcl_Obj *list1Ptr, *list2Ptr, *emptyPtr, *concatPtr, *tmpPtr; int result = TCL_OK; - size_t len; + Tcl_Size len; Tcl_Obj *objv[3]; /* @@ -8245,7 +8245,7 @@ TestparseargsCmd( Tcl_Obj *const objv[]) /* Arguments. */ { static int foo = 0; - size_t count = objc; + Tcl_Size count = objc; Tcl_Obj **remObjv, *result[3]; Tcl_ArgvInfo argTable[] = { {TCL_ARGV_CONSTANT, "-bool", INT2PTR(1), &foo, "booltest", NULL}, diff --git a/generic/tclTimer.c b/generic/tclTimer.c index 70c7b6a..0d17fa5 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -787,7 +787,7 @@ Tcl_AfterObjCmd( Tcl_Time wakeup; AfterInfo *afterPtr; AfterAssocData *assocPtr; - size_t length; + Tcl_Size length; int index = -1; static const char *const afterSubCmds[] = { "cancel", "idle", "info", NULL @@ -882,7 +882,7 @@ Tcl_AfterObjCmd( case AFTER_CANCEL: { Tcl_Obj *commandPtr; const char *command, *tempCommand; - size_t tempLength; + Tcl_Size tempLength; if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "id|command"); diff --git a/generic/tclVar.c b/generic/tclVar.c index 63bcf19..550d7a6 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -842,7 +842,7 @@ TclLookupSimpleVar( Namespace *varNsPtr, *cxtNsPtr, *dummy1Ptr, *dummy2Ptr; ResolverScheme *resPtr; int isNew, i, result; - size_t varLen; + Tcl_Size varLen; const char *varName = Tcl_GetStringFromObj(varNamePtr, &varLen); varPtr = NULL; @@ -972,7 +972,7 @@ TclLookupSimpleVar( if (localCt > 0) { Tcl_Obj **objPtrPtr = &varFramePtr->localCachePtr->varName0; const char *localNameStr; - size_t localLen; + Tcl_Size localLen; for (i=0 ; i<localCt ; i++, objPtrPtr++) { Tcl_Obj *objPtr = *objPtrPtr; diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 446aeb2..7843996 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -2280,7 +2280,7 @@ ZipFSMountBufferObjCmd( { const char *mountPoint; /* Mount point path. */ unsigned char *data; - size_t length; + Tcl_Size length; if (objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?mountpoint? ?data?"); @@ -2391,7 +2391,7 @@ ZipFSMkKeyObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - size_t len, i = 0; + Tcl_Size len, i = 0; const char *pw; Tcl_Obj *passObj; unsigned char *passBuf; @@ -2409,7 +2409,7 @@ ZipFSMkKeyObjCmd( } passObj = Tcl_NewByteArrayObj(NULL, 264); - passBuf = Tcl_GetByteArrayFromObj(passObj, (size_t *)NULL); + passBuf = Tcl_GetByteArrayFromObj(passObj, (Tcl_Size *)NULL); while (len > 0) { int ch = pw[len - 1]; @@ -2516,7 +2516,8 @@ ZipAddFile( * UTF-8). */ const char *zpathTcl; /* Filename in Tcl's internal encoding. */ int crc, flush, zpathlen; - size_t nbyte, nbytecompr, len, olen, align = 0; + size_t nbyte, nbytecompr; + Tcl_Size len, olen, align = 0; long long headerStartOffset, dataStartOffset, dataEndOffset; int mtime = 0, isNew, compMeth; unsigned long keys[3], keys0[3]; @@ -2540,7 +2541,7 @@ ZipAddFile( * crazy enough to embed NULs in filenames, they deserve what they get! */ - zpathExt = Tcl_UtfToExternalDString(ZipFS.utf8, zpathTcl, TCL_INDEX_NONE, &zpathDs); + zpathExt = Tcl_UtfToExternalDString(ZipFS.utf8, zpathTcl, -1, &zpathDs); zpathlen = strlen(zpathExt); if (zpathlen + ZIP_CENTRAL_HEADER_LEN > bufsize) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -2578,7 +2579,7 @@ ZipAddFile( nbyte = nbytecompr = 0; while (1) { len = Tcl_Read(in, buf, bufsize); - if (len == (size_t) TCL_INDEX_NONE) { + if (len < 0) { Tcl_DStringFree(&zpathDs); if (nbyte == 0 && errno == EISDIR) { Tcl_Close(interp, in); @@ -2619,7 +2620,7 @@ ZipAddFile( memset(buf, '\0', ZIP_LOCAL_HEADER_LEN); memcpy(buf + ZIP_LOCAL_HEADER_LEN, zpathExt, zpathlen); len = zpathlen + ZIP_LOCAL_HEADER_LEN; - if ((size_t) Tcl_Write(out, buf, len) != len) { + if (Tcl_Write(out, buf, len) != len) { writeErrorWithChannelOpen: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "write error on \"%s\": %s", @@ -2643,7 +2644,7 @@ ZipAddFile( ZipWriteShort(astart, aend, abuf, 0xffff); ZipWriteShort(astart, aend, abuf + 2, align - 4); ZipWriteInt(astart, aend, abuf + 4, 0x03020100); - if ((size_t) Tcl_Write(out, (const char *) abuf, align) != align) { + if (Tcl_Write(out, (const char *) abuf, align) != align) { goto writeErrorWithChannelOpen; } } @@ -2708,7 +2709,7 @@ ZipAddFile( do { len = Tcl_Read(in, buf, bufsize); - if (len == (size_t) TCL_INDEX_NONE) { + if (len < 0) { deflateEnd(&stream); goto readErrorWithChannelOpen; } @@ -2719,7 +2720,7 @@ ZipAddFile( stream.avail_out = sizeof(obuf); stream.next_out = (unsigned char *) obuf; len = deflate(&stream, flush); - if (len == (size_t) Z_STREAM_ERROR) { + if (len == Z_STREAM_ERROR) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "deflate error on \"%s\"", TclGetString(pathObj))); ZIPFS_ERROR_CODE(interp, "DEFLATE"); @@ -2730,14 +2731,14 @@ ZipAddFile( } olen = sizeof(obuf) - stream.avail_out; if (passwd) { - size_t i; + Tcl_Size i; int tmp; for (i = 0; i < olen; i++) { obuf[i] = (char) zencode(keys, crc32tab, obuf[i], tmp); } } - if (olen && ((size_t) Tcl_Write(out, obuf, olen) != olen)) { + if (olen && (Tcl_Write(out, obuf, olen) != olen)) { deflateEnd(&stream); goto writeErrorWithChannelOpen; } @@ -2772,20 +2773,20 @@ ZipAddFile( nbytecompr = (passwd ? 12 : 0); while (1) { len = Tcl_Read(in, buf, bufsize); - if (len == (size_t) TCL_INDEX_NONE) { + if (len < 0) { goto readErrorWithChannelOpen; } else if (len == 0) { break; } if (passwd) { - size_t i; + Tcl_Size i; int tmp; for (i = 0; i < len; i++) { buf[i] = (char) zencode(keys0, crc32tab, buf[i], tmp); } } - if ((size_t) Tcl_Write(out, buf, len) != len) { + if (Tcl_Write(out, buf, len) != len) { goto writeErrorWithChannelOpen; } nbytecompr += len; @@ -2918,11 +2919,11 @@ ComputeNameInArchive( * archive */ const char *strip, /* A prefix to strip; may be NULL if no * stripping need be done. */ - size_t slen) /* The length of the prefix; must be 0 if no + Tcl_Size slen) /* The length of the prefix; must be 0 if no * stripping need be done. */ { const char *name; - size_t len; + Tcl_Size len; if (directNameObj) { name = TclGetString(directNameObj); @@ -2991,7 +2992,7 @@ ZipFSMkZipOrImg( { Tcl_Channel out; int count, ret = TCL_ERROR; - size_t pwlen = 0, slen = 0, len, i = 0; + Tcl_Size pwlen = 0, slen = 0, len, i = 0; Tcl_Size lobjc; long long directoryStartOffset; /* The overall file offset of the start of the @@ -3178,7 +3179,7 @@ ZipFSMkZipOrImg( strip = NULL; } } - for (i = 0; i < (size_t) lobjc; i += (mappingList ? 2 : 1)) { + for (i = 0; i < lobjc; i += (mappingList ? 2 : 1)) { Tcl_Obj *pathObj = lobjv[i]; const char *name = ComputeNameInArchive(pathObj, (mappingList ? lobjv[i + 1] : NULL), strip, slen); @@ -3198,7 +3199,7 @@ ZipFSMkZipOrImg( directoryStartOffset = Tcl_Tell(out); count = 0; - for (i = 0; i < (size_t) lobjc; i += (mappingList ? 2 : 1)) { + for (i = 0; i < lobjc; i += (mappingList ? 2 : 1)) { const char *name = ComputeNameInArchive(lobjv[i], (mappingList ? lobjv[i + 1] : NULL), strip, slen); Tcl_DString ds; @@ -3215,7 +3216,7 @@ ZipFSMkZipOrImg( z, len); if ((Tcl_Write(out, buf, ZIP_CENTRAL_HEADER_LEN) != ZIP_CENTRAL_HEADER_LEN) - || ((size_t) Tcl_Write(out, name, len) != len)) { + || (Tcl_Write(out, name, len) != len)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "write error: %s", Tcl_PosixError(interp))); Tcl_DStringFree(&ds); @@ -3282,8 +3283,8 @@ CopyImageFile( Tcl_Channel out) /* Where to copy to; already open for writing * binary data. */ { - size_t i, k; - int m, n; + Tcl_WideInt i, k; + Tcl_Size m, n; Tcl_Channel in; char buf[4096]; const char *errMsg; @@ -3299,7 +3300,7 @@ CopyImageFile( */ i = Tcl_Seek(in, 0, SEEK_END); - if (i == (size_t) TCL_INDEX_NONE) { + if (i == -1) { errMsg = "seek error"; goto copyError; } @@ -3312,8 +3313,8 @@ CopyImageFile( for (k = 0; k < i; k += m) { m = i - k; - if (m > (int) sizeof(buf)) { - m = (int) sizeof(buf); + if (m > (Tcl_Size) sizeof(buf)) { + m = sizeof(buf); } n = Tcl_Read(in, buf, m); if (n == -1) { @@ -5002,8 +5003,8 @@ ZipFSMatchInDirectoryProc( Tcl_HashEntry *hPtr; Tcl_HashSearch search; Tcl_Obj *normPathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr); - int scnt, l, dirOnly = -1, strip = 0, mounts = 0; - size_t prefixLen, len; + int scnt, l, dirOnly = -1, mounts = 0; + Tcl_Size prefixLen, len, strip = 0; char *pat, *prefix, *path; Tcl_DString dsPref, *prefixBuf = NULL; @@ -5139,7 +5140,8 @@ ZipFSMatchMountPoints( { Tcl_HashEntry *hPtr; Tcl_HashSearch search; - size_t l, normLength; + size_t l; + Tcl_Size normLength; const char *path = Tcl_GetStringFromObj(normPathPtr, &normLength); size_t len = normLength; @@ -5221,7 +5223,7 @@ ZipFSPathInFilesystemProc( Tcl_HashEntry *hPtr; Tcl_HashSearch search; int ret = -1; - size_t len; + Tcl_Size len; char *path; pathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr); @@ -5248,9 +5250,9 @@ ZipFSPathInFilesystemProc( ZipEntry *z; for (z = zf->topEnts; z != NULL; z = z->tnext) { - size_t lenz = strlen(z->name); + Tcl_Size lenz = strlen(z->name); - if (((size_t) len >= lenz) && + if ((len >= lenz) && (strncmp(path, z->name, lenz) == 0)) { ret = TCL_OK; goto endloop; @@ -5368,7 +5370,7 @@ ZipFSFileAttrsGetProc( Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef) { - size_t len; + Tcl_Size len; int ret = TCL_OK; char *path; ZipEntry *z; diff --git a/generic/tclZlib.c b/generic/tclZlib.c index 8c6ab10..1399ec9 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -423,7 +423,7 @@ GenerateHeader( { Tcl_Obj *value; int len, result = TCL_ERROR; - size_t length; + Tcl_Size length; Tcl_WideInt wideValue = 0; const char *valueStr; Tcl_Encoding latin1enc; @@ -624,7 +624,7 @@ SetInflateDictionary( Tcl_Obj *compDictObj) { if (compDictObj != NULL) { - size_t length = 0; + Tcl_Size length = 0; unsigned char *bytes = Tcl_GetByteArrayFromObj(compDictObj, &length); if (bytes == NULL) { @@ -641,7 +641,7 @@ SetDeflateDictionary( Tcl_Obj *compDictObj) { if (compDictObj != NULL) { - size_t length = 0; + Tcl_Size length = 0; unsigned char *bytes = Tcl_GetByteArrayFromObj(compDictObj, &length); if (bytes == NULL) { @@ -1191,7 +1191,7 @@ Tcl_ZlibStreamSetCompressionDictionary( ZlibStreamHandle *zshPtr = (ZlibStreamHandle *) zshandle; if (compressionDictionaryObj && (NULL == Tcl_GetByteArrayFromObj( - compressionDictionaryObj, (size_t *)NULL))) { + compressionDictionaryObj, (Tcl_Size *)NULL))) { /* Missing or invalid compression dictionary */ compressionDictionaryObj = NULL; } @@ -1234,7 +1234,8 @@ Tcl_ZlibStreamPut( ZlibStreamHandle *zshPtr = (ZlibStreamHandle *) zshandle; char *dataTmp = NULL; int e; - size_t size = 0, outSize, toStore; + Tcl_Size size = 0; + size_t outSize, toStore; unsigned char *bytes; if (zshPtr->streamEnd) { @@ -1616,7 +1617,7 @@ Tcl_ZlibDeflate( Tcl_Obj *gzipHeaderDictObj) { int wbits = 0, e = 0, extraSize = 0; - size_t inLen = 0; + Tcl_Size inLen = 0; Byte *inData = NULL; z_stream stream; GzipHeader header; @@ -1989,7 +1990,9 @@ ZlibCmd( Tcl_Obj *const objv[]) { int i, option, level = -1; - size_t dlen = 0, start, buffersize = 0; + size_t buffersize = 0; + Tcl_Size dlen = 0; + unsigned int start; Tcl_WideInt wideLen; Byte *data; Tcl_Obj *headerDictObj; @@ -2387,7 +2390,7 @@ ZlibStreamSubcmd( } if (compDictObj) { - if (NULL == Tcl_GetBytesFromObj(interp, compDictObj, (size_t *)NULL)) { + if (NULL == Tcl_GetBytesFromObj(interp, compDictObj, (Tcl_Size *)NULL)) { return TCL_ERROR; } } @@ -2570,7 +2573,7 @@ ZlibPushSubcmd( } } - if (compDictObj && (NULL == Tcl_GetBytesFromObj(interp, compDictObj, (size_t *)NULL))) { + if (compDictObj && (NULL == Tcl_GetBytesFromObj(interp, compDictObj, (Tcl_Size *)NULL))) { return TCL_ERROR; } @@ -2817,7 +2820,7 @@ ZlibStreamAddCmd( */ if (compDictObj != NULL) { - size_t len = 0; + Tcl_Size len = 0; if (NULL == Tcl_GetBytesFromObj(interp, compDictObj, &len)) { return TCL_ERROR; @@ -2924,7 +2927,7 @@ ZlibStreamPutCmd( */ if (compDictObj != NULL) { - size_t len = 0; + Tcl_Size len = 0; if (NULL == Tcl_GetBytesFromObj(interp, compDictObj, &len)) { return TCL_ERROR; @@ -3367,7 +3370,7 @@ ZlibTransformSetOption( /* not used */ TclNewStringObj(compDictObj, value, strlen(value)); Tcl_IncrRefCount(compDictObj); - if (NULL == Tcl_GetBytesFromObj(interp, compDictObj, (size_t *)NULL)) { + if (NULL == Tcl_GetBytesFromObj(interp, compDictObj, (Tcl_Size *)NULL)) { Tcl_DecrRefCount(compDictObj); return TCL_ERROR; } @@ -3517,7 +3520,7 @@ ZlibTransformGetOption( } } else { if (cd->compDictObj) { - size_t length; + Tcl_Size length; const char *str = Tcl_GetStringFromObj(cd->compDictObj, &length); Tcl_DStringAppend(dsPtr, str, length); |