summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-03-12 15:06:47 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-03-12 15:06:47 (GMT)
commit2ff0db90f57b60e46b714f2b5cdb1d2c5eacce98 (patch)
treeed891ab3e00ea5888426f25d675aff2d89a00b1d /generic/tclIOUtil.c
parent0d3106376c20bbe48cba344885fcad371b72b50f (diff)
downloadtcl-2ff0db90f57b60e46b714f2b5cdb1d2c5eacce98.zip
tcl-2ff0db90f57b60e46b714f2b5cdb1d2c5eacce98.tar.gz
tcl-2ff0db90f57b60e46b714f2b5cdb1d2c5eacce98.tar.bz2
Adjust ckalloc/ckfree macros to greatly reduce number of explicit casts in
rest of Tcl source code. No ABI change. API change *should* be harmless.
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r--generic/tclIOUtil.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 0cd8888..17e50fa 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -417,7 +417,7 @@ FsThrExitProc(
while (fsRecPtr != NULL) {
tmpFsRecPtr = fsRecPtr->nextPtr;
if (--fsRecPtr->fileRefCount <= 0) {
- ckfree((char *) fsRecPtr);
+ ckfree(fsRecPtr);
}
fsRecPtr = tmpFsRecPtr;
}
@@ -535,7 +535,7 @@ FsRecacheFilesystemList(void)
while (fsRecPtr != NULL) {
tmpFsRecPtr = fsRecPtr->nextPtr;
if (--fsRecPtr->fileRefCount <= 0) {
- ckfree((char *) fsRecPtr);
+ ckfree(fsRecPtr);
}
fsRecPtr = tmpFsRecPtr;
}
@@ -560,7 +560,7 @@ FsRecacheFilesystemList(void)
fsRecPtr = tmpFsRecPtr;
while (fsRecPtr != NULL) {
- tmpFsRecPtr = (FilesystemRecord *) ckalloc(sizeof(FilesystemRecord));
+ tmpFsRecPtr = ckalloc(sizeof(FilesystemRecord));
*tmpFsRecPtr = *fsRecPtr;
tmpFsRecPtr->nextPtr = tsdPtr->filesystemList;
tmpFsRecPtr->prevPtr = NULL;
@@ -733,7 +733,7 @@ TclFinalizeFilesystem(void)
*/
if (fsRecPtr->fsPtr != &tclNativeFilesystem) {
- ckfree((char *) fsRecPtr);
+ ckfree(fsRecPtr);
}
}
fsRecPtr = tmpFsRecPtr;
@@ -827,7 +827,7 @@ Tcl_FSRegister(
return TCL_ERROR;
}
- newFilesystemPtr = (FilesystemRecord *) ckalloc(sizeof(FilesystemRecord));
+ newFilesystemPtr = ckalloc(sizeof(FilesystemRecord));
newFilesystemPtr->clientData = clientData;
newFilesystemPtr->fsPtr = fsPtr;
@@ -935,7 +935,7 @@ Tcl_FSUnregister(
fsRecPtr->fileRefCount--;
if (fsRecPtr->fileRefCount <= 0) {
- ckfree((char *) fsRecPtr);
+ ckfree(fsRecPtr);
}
retVal = TCL_OK;
@@ -1596,7 +1596,7 @@ TclGetOpenModeEx(
Tcl_AppendResult(interp, "access mode \"", flag,
"\" not supported by this system", NULL);
}
- ckfree((char *) modeArgv);
+ ckfree(modeArgv);
return -1;
#endif
@@ -1608,7 +1608,7 @@ TclGetOpenModeEx(
Tcl_AppendResult(interp, "access mode \"", flag,
"\" not supported by this system", NULL);
}
- ckfree((char *) modeArgv);
+ ckfree(modeArgv);
return -1;
#endif
@@ -1623,12 +1623,12 @@ TclGetOpenModeEx(
"\": must be RDONLY, WRONLY, RDWR, APPEND, BINARY, "
"CREAT, EXCL, NOCTTY, NONBLOCK, or TRUNC", NULL);
}
- ckfree((char *) modeArgv);
+ ckfree(modeArgv);
return -1;
}
}
- ckfree((char *) modeArgv);
+ ckfree(modeArgv);
if (!gotRW) {
if (interp != NULL) {
@@ -3229,7 +3229,7 @@ Tcl_LoadFile(
* unload and cleanup the temporary file correctly.
*/
- tvdlPtr = (FsDivertLoad *) ckalloc(sizeof(FsDivertLoad));
+ tvdlPtr = ckalloc(sizeof(FsDivertLoad));
/*
* Remember three pieces of information. This allows us to cleanup the
@@ -3275,10 +3275,8 @@ Tcl_LoadFile(
copyToPtr = NULL;
-
- divertedLoadHandle = (Tcl_LoadHandle)
- ckalloc(sizeof (struct Tcl_LoadHandle_));
- divertedLoadHandle->clientData = (ClientData) tvdlPtr;
+ divertedLoadHandle = ckalloc(sizeof(struct Tcl_LoadHandle_));
+ divertedLoadHandle->clientData = tvdlPtr;
divertedLoadHandle->findSymbolProcPtr = DivertFindSymbol;
divertedLoadHandle->unloadFileProcPtr = DivertUnloadFile;
*handlePtr = divertedLoadHandle;
@@ -3421,8 +3419,8 @@ DivertUnloadFile(
Tcl_DecrRefCount(tvdlPtr->divertedFile);
}
- ckfree((void *) tvdlPtr);
- ckfree((void *) loadHandle);
+ ckfree(tvdlPtr);
+ ckfree(loadHandle);
}
/*
@@ -3635,7 +3633,7 @@ TclFSUnloadTempFile(
Tcl_DecrRefCount(tvdlPtr->divertedFile);
}
- ckfree((char *) tvdlPtr);
+ ckfree(tvdlPtr);
}
/*
@@ -4589,7 +4587,7 @@ static void
NativeFreeInternalRep(
ClientData clientData)
{
- ckfree((char *) clientData);
+ ckfree(clientData);
}
/*