Skip to content

Commit

Permalink
Fix warning: warning C4047: 'function': 'char *' differs in levels of…
Browse files Browse the repository at this point in the history
… indirection from 'const char **' on Windows.

Remove unneeded (char *) typecast in ckfree() usage
  • Loading branch information
jan.nijtmans committed Oct 9, 2024
1 parent e301c28 commit b592080
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion doc/SplitList.3
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/SplitPath.3
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions generic/tclArithSeries.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ FreeArithSeriesInternalRep(Tcl_Obj *arithSeriesObjPtr) /* Free any allocated me
for(i=0; i<arithSeriesRepPtr->len; i++) {
Tcl_DecrRefCount(arithSeriesRepPtr->elements[i]);
}
ckfree((char *)arithSeriesRepPtr->elements);
ckfree(arithSeriesRepPtr->elements);
arithSeriesRepPtr->elements = NULL;
}
ckfree((char *)arithSeriesRepPtr);
ckfree(arithSeriesRepPtr);
}


Expand Down Expand Up @@ -1009,7 +1009,7 @@ TclArithSeriesObjReverse(
for (i=0; i<len; i++) {
Tcl_DecrRefCount(arithSeriesRepPtr->elements[i]);
}
ckfree((char*)arithSeriesRepPtr->elements);
ckfree(arithSeriesRepPtr->elements);
}
arithSeriesRepPtr->elements = NULL;

Expand Down
2 changes: 1 addition & 1 deletion generic/tclCmdIL.c
Original file line number Diff line number Diff line change
Expand Up @@ -4985,7 +4985,7 @@ Tcl_LsortObjCmd(
}
if (elementArray) {
if (elmArrSize <= MAXCALLOC) {
ckfree((char *)elementArray);
ckfree(elementArray);
} else {
free((char *)elementArray);
}
Expand Down
2 changes: 1 addition & 1 deletion generic/tclDecls.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
} \
Expand Down
2 changes: 1 addition & 1 deletion generic/tclEnsemble.c
Original file line number Diff line number Diff line change
Expand Up @@ -2574,7 +2574,7 @@ ClearTable(
Tcl_DecrRefCount(prefixObj);
hPtr = Tcl_NextHashEntry(&search);
}
ckfree((char *) ensemblePtr->subcommandArrayPtr);
ckfree(ensemblePtr->subcommandArrayPtr);
}
Tcl_DeleteHashTable(hash);
}
Expand Down
2 changes: 1 addition & 1 deletion generic/tclInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
} \
Expand Down
2 changes: 1 addition & 1 deletion generic/tclLink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ LinkFree(
if (linkPtr->flags & LINK_ALLOC_LAST) {
ckfree(linkPtr->lastValue.aryPtr);
}
ckfree((char *)linkPtr);
ckfree(linkPtr);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion generic/tclStrToD.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion generic/tclTomMathDecls.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b592080

Please sign in to comment.