summaryrefslogtreecommitdiffstats
path: root/win/tclWinPipe.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2020-12-06 18:24:00 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2020-12-06 18:24:00 (GMT)
commit0f93742804d047a8de0fe3acda7b019daae7b273 (patch)
tree18bed9fa65dbe84ebb028ca81c52ae123e9b3867 /win/tclWinPipe.c
parent7dd7fe1b6c5348772912a64134334358a39f8211 (diff)
parentfcee72d2c7daddae9dd63e4eb14746b7bd319aa9 (diff)
downloadtcl-0f93742804d047a8de0fe3acda7b019daae7b273.zip
tcl-0f93742804d047a8de0fe3acda7b019daae7b273.tar.gz
tcl-0f93742804d047a8de0fe3acda7b019daae7b273.tar.bz2
merge core-8-branch
Diffstat (limited to 'win/tclWinPipe.c')
-rw-r--r--win/tclWinPipe.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 23ede6e..a93688d 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -310,7 +310,7 @@ TclpFinalizePipes(void)
void
PipeSetupProc(
- ClientData data, /* Not used. */
+ TCL_UNUSED(ClientData),
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
PipeInfo *infoPtr;
@@ -363,7 +363,7 @@ PipeSetupProc(
static void
PipeCheckProc(
- ClientData data, /* Not used. */
+ TCL_UNUSED(ClientData),
int flags) /* Event flags as passed to Tcl_DoOneEvent. */
{
PipeInfo *infoPtr;
@@ -402,7 +402,7 @@ PipeCheckProc(
if (needEvent) {
infoPtr->flags |= PIPE_PENDING;
- evPtr = ckalloc(sizeof(PipeEvent));
+ evPtr = (PipeEvent *)ckalloc(sizeof(PipeEvent));
evPtr->header.proc = PipeEventProc;
evPtr->infoPtr = infoPtr;
Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL);
@@ -433,7 +433,7 @@ TclWinMakeFile(
{
WinFile *filePtr;
- filePtr = ckalloc(sizeof(WinFile));
+ filePtr = (WinFile *)ckalloc(sizeof(WinFile));
filePtr->type = WIN_FILE;
filePtr->handle = handle;
@@ -610,7 +610,7 @@ TclpOpenFile(
DWORD err;
err = GetLastError();
- if ((err & 0xffffL) == ERROR_OPEN_FAILED) {
+ if ((err & 0xFFFFL) == ERROR_OPEN_FAILED) {
err = (mode & O_CREAT) ? ERROR_FILE_EXISTS : ERROR_FILE_NOT_FOUND;
}
TclWinConvertError(err);
@@ -1307,7 +1307,7 @@ ApplicationType(
*/
attr = GetFileAttributesW(nativeFullPath);
- if ((attr == 0xffffffff) || (attr & FILE_ATTRIBUTE_DIRECTORY)) {
+ if ((attr == 0xFFFFFFFF) || (attr & FILE_ATTRIBUTE_DIRECTORY)) {
continue;
}
Tcl_DStringInit(&ds);
@@ -1763,7 +1763,7 @@ TclpCreateCommandChannel(
Tcl_Pid *pidPtr) /* An array of process identifiers. */
{
char channelName[16 + TCL_INTEGER_SPACE];
- PipeInfo *infoPtr = ckalloc(sizeof(PipeInfo));
+ PipeInfo *infoPtr = (PipeInfo *)ckalloc(sizeof(PipeInfo));
PipeInit();
@@ -1856,7 +1856,7 @@ Tcl_CreatePipe(
Tcl_Interp *interp, /* Errors returned in result.*/
Tcl_Channel *rchan, /* Where to return the read side. */
Tcl_Channel *wchan, /* Where to return the write side. */
- int flags) /* Reserved for future use. */
+ TCL_UNUSED(int) /*flags*/) /* Reserved for future use. */
{
HANDLE readHandle, writeHandle;
SECURITY_ATTRIBUTES sec;
@@ -1917,7 +1917,7 @@ TclGetAndDetachPids(
return;
}
- pipePtr = Tcl_GetChannelInstanceData(chan);
+ pipePtr = (PipeInfo *)Tcl_GetChannelInstanceData(chan);
TclNewObj(pidsObj);
for (i = 0; i < pipePtr->numPids; i++) {
Tcl_ListObjAppendElement(NULL, pidsObj,
@@ -2303,7 +2303,7 @@ PipeOutputProc(
ckfree(infoPtr->writeBuf);
}
infoPtr->writeBufLen = toWrite;
- infoPtr->writeBuf = ckalloc(toWrite);
+ infoPtr->writeBuf = (char *)ckalloc(toWrite);
}
memcpy(infoPtr->writeBuf, buf, toWrite);
infoPtr->toWrite = toWrite;
@@ -2711,7 +2711,7 @@ TclWinAddProcess(
void *hProcess, /* Handle to process */
unsigned long id) /* Global process identifier */
{
- ProcInfo *procPtr = ckalloc(sizeof(ProcInfo));
+ ProcInfo *procPtr = (ProcInfo*)ckalloc(sizeof(ProcInfo));
PipeInit();
@@ -2740,10 +2740,9 @@ TclWinAddProcess(
*----------------------------------------------------------------------
*/
- /* ARGSUSED */
int
Tcl_PidObjCmd(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument strings. */
@@ -2772,7 +2771,7 @@ Tcl_PidObjCmd(
}
pipePtr = (PipeInfo *) Tcl_GetChannelInstanceData(chan);
- resultPtr = Tcl_NewObj();
+ TclNewObj(resultPtr);
for (i = 0; i < pipePtr->numPids; i++) {
Tcl_ListObjAppendElement(/*interp*/ NULL, resultPtr,
Tcl_NewWideIntObj((unsigned)
@@ -2812,7 +2811,7 @@ WaitForRead(
* or not. */
{
DWORD timeout, count;
- HANDLE *handle = ((WinFile *) infoPtr->readFile)->handle;
+ HANDLE *handle = (HANDLE *)((WinFile *) infoPtr->readFile)->handle;
while (1) {
/*
@@ -3189,9 +3188,9 @@ PipeThreadActionProc(
Tcl_Channel
TclpOpenTemporaryFile(
- Tcl_Obj *dirObj,
+ TCL_UNUSED(Tcl_Obj *) /*dirObj*/,
Tcl_Obj *basenameObj,
- Tcl_Obj *extensionObj,
+ TCL_UNUSED(Tcl_Obj *) /*extensionObj*/,
Tcl_Obj *resultingNameObj)
{
WCHAR name[MAX_PATH];
@@ -3286,9 +3285,9 @@ TclPipeThreadCreateTI(
{
TclPipeThreadInfo *pipeTI;
#ifndef _PTI_USE_CKALLOC
- pipeTI = malloc(sizeof(TclPipeThreadInfo));
+ pipeTI = (TclPipeThreadInfo *)malloc(sizeof(TclPipeThreadInfo));
#else
- pipeTI = ckalloc(sizeof(TclPipeThreadInfo));
+ pipeTI = (TclPipeThreadInfo *)ckalloc(sizeof(TclPipeThreadInfo));
#endif /* !_PTI_USE_CKALLOC */
pipeTI->evControl = CreateEventW(NULL, FALSE, FALSE, NULL);
pipeTI->state = PTI_STATE_IDLE;