From b592080d7e28c6f351cecba26fce523a512f56c8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 9 Oct 2024 16:05:29 +0000 Subject: Fix warning: warning C4047: 'function': 'char *' differs in levels of indirection from 'const char **' on Windows. Remove unneeded (char *) typecast in ckfree() usage --- doc/SplitList.3 | 2 +- doc/SplitPath.3 | 2 +- generic/tclArithSeries.c | 6 +++--- generic/tclCmdIL.c | 2 +- generic/tclDecls.h | 2 +- generic/tclEnsemble.c | 2 +- generic/tclInt.h | 2 +- generic/tclLink.c | 2 +- generic/tclStrToD.c | 2 +- generic/tclTomMathDecls.h | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/SplitList.3 b/doc/SplitList.3 index c080974..71478fb 100644 --- a/doc/SplitList.3 +++ b/doc/SplitList.3 @@ -95,7 +95,7 @@ Then you should eventually free the storage with a call like the following: .PP .CS -ckfree((char *)argv); +ckfree(argv); .CE .PP \fBTcl_SplitList\fR normally returns \fBTCL_OK\fR, which means the list was diff --git a/doc/SplitPath.3 b/doc/SplitPath.3 index 91c9a67..23c546f 100644 --- a/doc/SplitPath.3 +++ b/doc/SplitPath.3 @@ -74,7 +74,7 @@ Then you should eventually free the storage with a call like the following: .PP .CS -ckfree((char *)argv); +ckfree(argv); .CE .PP \fBTcl_JoinPath\fR is the inverse of \fBTcl_SplitPath\fR: it takes a diff --git a/generic/tclArithSeries.c b/generic/tclArithSeries.c index 6001e57..af2a72a 100755 --- a/generic/tclArithSeries.c +++ b/generic/tclArithSeries.c @@ -284,10 +284,10 @@ FreeArithSeriesInternalRep(Tcl_Obj *arithSeriesObjPtr) /* Free any allocated me for(i=0; ilen; i++) { Tcl_DecrRefCount(arithSeriesRepPtr->elements[i]); } - ckfree((char *)arithSeriesRepPtr->elements); + ckfree(arithSeriesRepPtr->elements); arithSeriesRepPtr->elements = NULL; } - ckfree((char *)arithSeriesRepPtr); + ckfree(arithSeriesRepPtr); } @@ -1009,7 +1009,7 @@ TclArithSeriesObjReverse( for (i=0; ielements[i]); } - ckfree((char*)arithSeriesRepPtr->elements); + ckfree(arithSeriesRepPtr->elements); } arithSeriesRepPtr->elements = NULL; diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 680c610..95f2196 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -4985,7 +4985,7 @@ Tcl_LsortObjCmd( } if (elementArray) { if (elmArrSize <= MAXCALLOC) { - ckfree((char *)elementArray); + ckfree(elementArray); } else { free((char *)elementArray); } diff --git a/generic/tclDecls.h b/generic/tclDecls.h index ddca33a..b9f4d8d 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -4273,7 +4273,7 @@ extern const TclStubs *tclStubsPtr; Tcl_SetObjResult(interp, Tcl_NewStringObj(__result, TCL_INDEX_NONE)); \ if (__result != NULL && __freeProc != NULL && __freeProc != TCL_VOLATILE) { \ if (__freeProc == TCL_DYNAMIC) { \ - ckfree((char *)__result); \ + ckfree(__result); \ } else { \ (*__freeProc)((char *)__result); \ } \ diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index caf909d..694bdb6 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -2574,7 +2574,7 @@ ClearTable( Tcl_DecrRefCount(prefixObj); hPtr = Tcl_NextHashEntry(&search); } - ckfree((char *) ensemblePtr->subcommandArrayPtr); + ckfree(ensemblePtr->subcommandArrayPtr); } Tcl_DeleteHashTable(hash); } diff --git a/generic/tclInt.h b/generic/tclInt.h index b99c0a5..bc187d4 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4315,7 +4315,7 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, Tcl_Obj *_isobjPtr = (Tcl_Obj *)(objPtr); \ if (_isobjPtr->bytes != NULL) { \ if (_isobjPtr->bytes != &tclEmptyString) { \ - ckfree((char *)_isobjPtr->bytes); \ + ckfree(_isobjPtr->bytes); \ } \ _isobjPtr->bytes = NULL; \ } \ diff --git a/generic/tclLink.c b/generic/tclLink.c index fd7dd2d..9a7227e 100644 --- a/generic/tclLink.c +++ b/generic/tclLink.c @@ -1491,7 +1491,7 @@ LinkFree( if (linkPtr->flags & LINK_ALLOC_LAST) { ckfree(linkPtr->lastValue.aryPtr); } - ckfree((char *)linkPtr); + ckfree(linkPtr); } /* diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 4017f0f..d7834eb 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -1592,7 +1592,7 @@ TclParseNumber( const char **argv; if ((TclMaxListLength(bytes, TCL_INDEX_NONE, NULL) > 1) && Tcl_SplitList(NULL, bytes, &argc, &argv) == TCL_OK) { - Tcl_Free(argv); + ckfree(argv); Tcl_AppendToObj(msg, "a list", -1); } else { Tcl_AppendToObj(msg, "\"", -1); diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h index a36c97a..468b7a5 100644 --- a/generic/tclTomMathDecls.h +++ b/generic/tclTomMathDecls.h @@ -41,7 +41,7 @@ /* MODULE_SCOPE void* TclBNRealloc( void*, size_t ); */ #define TclBNRealloc(x,s) ((void*)attemptckrealloc((char*)(x),(size_t)(s))) /* MODULE_SCOPE void TclBNFree( void* ); */ -#define TclBNFree(x) (ckfree((char*)(x))) +#define TclBNFree(x) (ckfree(x)) #undef MP_MALLOC #undef MP_CALLOC -- cgit v0.12