summaryrefslogtreecommitdiffstats
path: root/win/tclWinLoad.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinLoad.c')
-rw-r--r--win/tclWinLoad.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c
index e3c4603..e877ebe 100644
--- a/win/tclWinLoad.c
+++ b/win/tclWinLoad.c
@@ -109,7 +109,7 @@ TclpDlopen(
size = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, lastError, 0,
(LPTSTR) &lpMsgBuf, 0, NULL);
- buf = (char *) ckalloc((unsigned) TCL_INTEGER_SPACE + size + 1);
+ buf = ckalloc(TCL_INTEGER_SPACE + size + 1);
sprintf(buf, "%d %s", lastError, (char *)lpMsgBuf);
#endif
@@ -148,8 +148,7 @@ TclpDlopen(
}
return TCL_ERROR;
} else {
- handlePtr =
- (Tcl_LoadHandle) ckalloc(sizeof(struct Tcl_LoadHandle_));
+ handlePtr = ckalloc(sizeof(struct Tcl_LoadHandle_));
handlePtr->clientData = (ClientData) hInstance;
handlePtr->findSymbolProcPtr = &FindSymbol;
handlePtr->unloadFileProcPtr = &UnloadFile;
@@ -231,8 +230,9 @@ UnloadFile(
* that represents the loaded file. */
{
HINSTANCE hInstance = (HINSTANCE) loadHandle->clientData;
+
FreeLibrary(hInstance);
- ckfree((char*) loadHandle);
+ ckfree(loadHandle);
}
/*
@@ -336,8 +336,7 @@ TclpTempFileNameForLibrary(Tcl_Interp* interp, /* Tcl interpreter */
}
}
if (status != 0) {
- dllDirectoryName = (WCHAR*)
- ckalloc((nameLen+1) * sizeof(WCHAR));
+ dllDirectoryName = ckalloc((nameLen+1) * sizeof(WCHAR));
wcscpy(dllDirectoryName, name);
}
}