From 257691ef7309a95aa418da8017492f3c4c223fd6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 26 Apr 2022 12:22:51 +0000 Subject: Tcl_GetIndexFromObjStruct -> Tcl_GetIndexFromObj. Don't use braces around (Tcl_GetBytesFromObj) --- generic/tclExecute.c | 2 +- generic/tclIO.c | 4 ++-- generic/tclStringObj.c | 6 +++--- generic/tclTimer.c | 4 ++-- generic/tclZipfs.c | 9 ++++----- generic/tclZlib.c | 18 +++++++++--------- 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 42e8008..23c3ef5 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5113,7 +5113,7 @@ TEBCresume( TclNewObj(objResultPtr); } else if (TclIsPureByteArray(valuePtr)) { objResultPtr = Tcl_NewByteArrayObj( - (Tcl_GetBytesFromObj)(NULL, valuePtr, NULL)+index, 1); + Tcl_GetBytesFromObj(NULL, valuePtr, (size_t *)NULL)+index, 1); } else if (valuePtr->bytes && slength == valuePtr->length) { objResultPtr = Tcl_NewStringObj((const char *) valuePtr->bytes+index, 1); diff --git a/generic/tclIO.c b/generic/tclIO.c index 57e1a66..4cf6a7e 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -4573,7 +4573,7 @@ Tcl_GetsObj( if ((statePtr->encoding == NULL) && ((statePtr->inputTranslation == TCL_TRANSLATE_LF) || (statePtr->inputTranslation == TCL_TRANSLATE_CR)) - && (Tcl_GetBytesFromObj)(NULL, objPtr, NULL) != NULL) { + && Tcl_GetBytesFromObj(NULL, objPtr, (size_t *)NULL) != NULL) { return TclGetsObjBinary(chan, objPtr); } @@ -5843,7 +5843,7 @@ DoReadChars( && (statePtr->inEofChar == '\0'); if (appendFlag) { - if (binaryMode && (NULL == Tcl_GetBytesFromObj(NULL, objPtr, NULL))) { + if (binaryMode && (NULL == Tcl_GetBytesFromObj(NULL, objPtr, (size_t *)NULL))) { binaryMode = 0; } } else { diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 107640b..c5e018f 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -1460,7 +1460,7 @@ Tcl_AppendObjToObj( */ TclAppendBytesToByteArray(objPtr, - (Tcl_GetBytesFromObj)(NULL, appendObjPtr, NULL), lengthSrc); + Tcl_GetBytesFromObj(NULL, appendObjPtr, (size_t *)NULL), lengthSrc); return; } @@ -2975,7 +2975,7 @@ TclStringRepeat( done *= 2; } TclAppendBytesToByteArray(objResultPtr, - (Tcl_GetBytesFromObj)(NULL, objResultPtr, NULL), + Tcl_GetBytesFromObj(NULL, objResultPtr, (size_t *)NULL), (count - done) * length); } else if (unichar) { /* @@ -3852,7 +3852,7 @@ TclStringReverse( if (!inPlace || Tcl_IsShared(objPtr)) { objPtr = Tcl_NewByteArrayObj(NULL, numBytes); } - ReverseBytes((Tcl_GetBytesFromObj)(NULL, objPtr, NULL), from, numBytes); + ReverseBytes(Tcl_GetBytesFromObj(NULL, objPtr, (size_t *)NULL), from, numBytes); return objPtr; } diff --git a/generic/tclTimer.c b/generic/tclTimer.c index 90301aa..0e6324c 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -818,8 +818,8 @@ Tcl_AfterObjCmd( */ if (Tcl_GetWideIntFromObj(NULL, objv[1], &ms) != TCL_OK) { - if (Tcl_GetIndexFromObjStruct(NULL, objv[1], afterSubCmds, - sizeof(char *), "", 0, &index) != TCL_OK) { + if (Tcl_GetIndexFromObj(NULL, objv[1], afterSubCmds, "", 0, &index) + != TCL_OK) { const char *arg = TclGetString(objv[1]); Tcl_SetObjResult(interp, Tcl_ObjPrintf( diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 269d8bc..85b57a5 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -2409,7 +2409,7 @@ ZipFSMkKeyObjCmd( } passObj = Tcl_NewByteArrayObj(NULL, 264); - passBuf = Tcl_GetBytesFromObj(NULL, passObj, NULL); + passBuf = Tcl_GetBytesFromObj(NULL, passObj, (size_t *)NULL); while (len > 0) { int ch = pw[len - 1]; @@ -3776,8 +3776,8 @@ ZipFSListObjCmd( if (objc == 3) { int idx; - if (Tcl_GetIndexFromObjStruct(interp, objv[1], options, - sizeof(char *), "option", 0, &idx) != TCL_OK) { + if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", + 0, &idx) != TCL_OK) { return TCL_ERROR; } switch (idx) { @@ -4998,8 +4998,7 @@ ZipFSMatchInDirectoryProc( Tcl_HashEntry *hPtr; Tcl_HashSearch search; Tcl_Obj *normPathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr); - int scnt, l, dirOnly = -1, prefixLen, strip = 0, mounts = 0; - int len; + int scnt, l, dirOnly = -1, prefixLen, strip = 0, mounts = 0, len; char *pat, *prefix, *path; Tcl_DString dsPref, *prefixBuf = NULL; diff --git a/generic/tclZlib.c b/generic/tclZlib.c index fa87a10..8a95fd5 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -496,8 +496,8 @@ GenerateHeader( if (GetValue(interp, dictObj, "type", &value) != TCL_OK) { goto error; - } else if (value != NULL && Tcl_GetIndexFromObjStruct(interp, value, types, - sizeof(char *), "type", TCL_EXACT, &headerPtr->header.text) != TCL_OK) { + } else if (value != NULL && Tcl_GetIndexFromObj(interp, value, types, + "type", TCL_EXACT, &headerPtr->header.text) != TCL_OK) { goto error; } @@ -1155,7 +1155,7 @@ Tcl_ZlibStreamSetCompressionDictionary( ZlibStreamHandle *zshPtr = (ZlibStreamHandle *) zshandle; if (compressionDictionaryObj && (NULL == Tcl_GetBytesFromObj(NULL, - compressionDictionaryObj, NULL))) { + compressionDictionaryObj, (size_t *)NULL))) { /* Missing or invalid compression dictionary */ compressionDictionaryObj = NULL; } @@ -1972,8 +1972,8 @@ ZlibCmd( Tcl_WrongNumArgs(interp, 1, objv, "command arg ?...?"); return TCL_ERROR; } - if (Tcl_GetIndexFromObjStruct(interp, objv[1], commands, - sizeof(char *), "command", 0, &command) != TCL_OK) { + if (Tcl_GetIndexFromObj(interp, objv[1], commands, "command", 0, + &command) != TCL_OK) { return TCL_ERROR; } @@ -2351,7 +2351,7 @@ ZlibStreamSubcmd( } if (compDictObj) { - if (NULL == (Tcl_GetBytesFromObj)(interp, compDictObj, NULL)) { + if (NULL == Tcl_GetBytesFromObj(interp, compDictObj, (size_t *)NULL)) { return TCL_ERROR; } } @@ -2533,7 +2533,7 @@ ZlibPushSubcmd( } } - if (compDictObj && (NULL == (Tcl_GetBytesFromObj)(interp, compDictObj, NULL))) { + if (compDictObj && (NULL == Tcl_GetBytesFromObj(interp, compDictObj, (size_t *)NULL))) { return TCL_ERROR; } @@ -3330,7 +3330,7 @@ ZlibTransformSetOption( /* not used */ TclNewStringObj(compDictObj, value, strlen(value)); Tcl_IncrRefCount(compDictObj); - if (NULL == (Tcl_GetBytesFromObj)(interp, compDictObj, NULL)) { + if (NULL == Tcl_GetBytesFromObj(interp, compDictObj, (size_t *)NULL)) { Tcl_DecrRefCount(compDictObj); return TCL_ERROR; } @@ -3721,7 +3721,7 @@ ZlibStackChannelTransform( if (compDictObj != NULL) { cd->compDictObj = Tcl_DuplicateObj(compDictObj); Tcl_IncrRefCount(cd->compDictObj); - (Tcl_GetBytesFromObj)(NULL, cd->compDictObj, NULL); + Tcl_GetBytesFromObj(NULL, cd->compDictObj, (size_t *)NULL); } if (format == TCL_ZLIB_FORMAT_RAW) { -- cgit v0.12