summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-05-08 15:06:09 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-05-08 15:06:09 (GMT)
commitb8132395c3218a5c317b7ee908f32b8adec11905 (patch)
tree09312509b79b683af2616aad8fd94ca126eee25f /win
parent2c4a038cbf140b6d6777ae43b9a0f4a428fce582 (diff)
downloadtcl-b8132395c3218a5c317b7ee908f32b8adec11905.zip
tcl-b8132395c3218a5c317b7ee908f32b8adec11905.tar.gz
tcl-b8132395c3218a5c317b7ee908f32b8adec11905.tar.bz2
Add some typecasts, remove duplicate "memset", remove some spacing.
Diffstat (limited to 'win')
-rw-r--r--win/tclWinConsole.c5
-rw-r--r--win/tclWinSock.c10
-rw-r--r--win/tclWinTest.c6
3 files changed, 10 insertions, 11 deletions
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c
index c7e12ae..d34104e 100644
--- a/win/tclWinConsole.c
+++ b/win/tclWinConsole.c
@@ -341,7 +341,7 @@ RingBufferInit(
if (capacity <= 0 || capacity > TCL_SIZE_MAX) {
Tcl_Panic("Internal error: invalid ring buffer capacity requested.");
}
- ringPtr->bufPtr = (char *) ckalloc(capacity);
+ ringPtr->bufPtr = (char *)ckalloc(capacity);
ringPtr->capacity = capacity;
ringPtr->start = 0;
ringPtr->length = 0;
@@ -2006,8 +2006,7 @@ AllocateConsoleHandleInfo(
ConsoleHandleInfo *handleInfoPtr;
DWORD consoleMode;
- handleInfoPtr = (ConsoleHandleInfo *) ckalloc(sizeof(*handleInfoPtr));
- memset(handleInfoPtr, 0, sizeof(*handleInfoPtr));
+ handleInfoPtr = (ConsoleHandleInfo *)ckalloc(sizeof(*handleInfoPtr));
memset(handleInfoPtr, 0, sizeof(*handleInfoPtr));
handleInfoPtr->console = consoleHandle;
InitializeSRWLock(&handleInfoPtr->lock);
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index e427c39..d7c137a 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -403,7 +403,7 @@ InitializeHostName(
*encodingPtr = Tcl_GetEncoding(NULL, "utf-8");
*lengthPtr = Tcl_DStringLength(&ds);
- *valuePtr = (char *) ckalloc(*lengthPtr + 1);
+ *valuePtr = (char *)ckalloc(*lengthPtr + 1);
memcpy(*valuePtr, Tcl_DStringValue(&ds), *lengthPtr + 1);
Tcl_DStringFree(&ds);
}
@@ -2572,7 +2572,7 @@ SocketCheckProc(
statePtr->watchEvents | FD_CONNECT | FD_ACCEPT)
&& !GOT_BITS(statePtr->flags, SOCKET_PENDING)) {
SET_BITS(statePtr->flags, SOCKET_PENDING);
- evPtr = (SocketEvent *) ckalloc(sizeof(SocketEvent));
+ evPtr = (SocketEvent *)ckalloc(sizeof(SocketEvent));
evPtr->header.proc = SocketEventProc;
evPtr->socket = statePtr->sockets->fd;
Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL);
@@ -2847,7 +2847,7 @@ AddSocketInfoFd(
* Add the first FD.
*/
- statePtr->sockets = (TcpFdList *) ckalloc(sizeof(TcpFdList));
+ statePtr->sockets = (TcpFdList *)ckalloc(sizeof(TcpFdList));
fds = statePtr->sockets;
} else {
/*
@@ -2858,7 +2858,7 @@ AddSocketInfoFd(
fds = fds->next;
}
- fds->next = (TcpFdList *) ckalloc(sizeof(TcpFdList));
+ fds->next = (TcpFdList *)ckalloc(sizeof(TcpFdList));
fds = fds->next;
}
@@ -2891,7 +2891,7 @@ static TcpState *
NewSocketInfo(
SOCKET socket)
{
- TcpState *statePtr = (TcpState *) ckalloc(sizeof(TcpState));
+ TcpState *statePtr = (TcpState *)ckalloc(sizeof(TcpState));
memset(statePtr, 0, sizeof(TcpState));
diff --git a/win/tclWinTest.c b/win/tclWinTest.c
index ec12f67..44ff038 100644
--- a/win/tclWinTest.c
+++ b/win/tclWinTest.c
@@ -485,7 +485,7 @@ TestplatformChmod(
goto done;
}
aceEntry[nSids].sidLen = GetLengthSid(pTokenUser->User.Sid);
- aceEntry[nSids].pSid = ckalloc(aceEntry[nSids].sidLen);
+ aceEntry[nSids].pSid = (PSID)ckalloc(aceEntry[nSids].sidLen);
if (!CopySid(aceEntry[nSids].sidLen, aceEntry[nSids].pSid,
pTokenUser->User.Sid)) {
ckfree(aceEntry[nSids].pSid); /* Since we have not ++'ed nSids */
@@ -527,7 +527,7 @@ TestplatformChmod(
goto done;
}
aceEntry[nSids].sidLen = GetLengthSid(pTokenGroup->PrimaryGroup);
- aceEntry[nSids].pSid = ckalloc(aceEntry[nSids].sidLen);
+ aceEntry[nSids].pSid = (PSID)ckalloc(aceEntry[nSids].sidLen);
if (!CopySid(aceEntry[nSids].sidLen, aceEntry[nSids].pSid, pTokenGroup->PrimaryGroup)) {
ckfree(pTokenGroup);
ckfree(aceEntry[nSids].pSid); /* Since we have not ++'ed nSids */
@@ -557,7 +557,7 @@ TestplatformChmod(
goto done;
}
aceEntry[nSids].sidLen = GetLengthSid(pWorldSid);
- aceEntry[nSids].pSid = ckalloc(aceEntry[nSids].sidLen);
+ aceEntry[nSids].pSid = (PSID)ckalloc(aceEntry[nSids].sidLen);
if (!CopySid(aceEntry[nSids].sidLen, aceEntry[nSids].pSid, pWorldSid)) {
LocalFree(pWorldSid);
ckfree(aceEntry[nSids].pSid); /* Since we have not ++'ed nSids */