summaryrefslogtreecommitdiffstats
path: root/win/tclWinPipe.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-11-20 20:07:43 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-11-20 20:07:43 (GMT)
commite043c623f79de150a3f1230d95d4d66d6d9da62c (patch)
tree4412d9a45167b471a9b3efb92230e9d46d6321f8 /win/tclWinPipe.c
parenteec237466690316958a6a7686e5ba5030992a358 (diff)
downloadtcl-e043c623f79de150a3f1230d95d4d66d6d9da62c.zip
tcl-e043c623f79de150a3f1230d95d4d66d6d9da62c.tar.gz
tcl-e043c623f79de150a3f1230d95d4d66d6d9da62c.tar.bz2
Fix TclpGetPid() signature (should use Tcl_Size, not size_t)
Diffstat (limited to 'win/tclWinPipe.c')
-rw-r--r--win/tclWinPipe.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 9f889b2..157547f 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -61,7 +61,7 @@ typedef struct {
typedef struct ProcInfo {
HANDLE hProcess;
- size_t dwProcessId;
+ int dwProcessId;
struct ProcInfo *nextPtr;
} ProcInfo;
@@ -864,7 +864,7 @@ TclpCloseFile(
*--------------------------------------------------------------------------
*/
-size_t
+Tcl_Size
TclpGetPid(
Tcl_Pid pid) /* The HANDLE of the child process. */
{
@@ -874,13 +874,13 @@ TclpGetPid(
Tcl_MutexLock(&pipeMutex);
for (infoPtr = procList; infoPtr != NULL; infoPtr = infoPtr->nextPtr) {
- if (infoPtr->dwProcessId == (size_t)pid) {
+ if (infoPtr->dwProcessId == (Tcl_Size)pid) {
Tcl_MutexUnlock(&pipeMutex);
return infoPtr->dwProcessId;
}
}
Tcl_MutexUnlock(&pipeMutex);
- return TCL_INDEX_NONE;
+ return -1;
}
/*
@@ -1168,7 +1168,7 @@ TclpCreateProcess(
WaitForInputIdle(procInfo.hProcess, 5000);
CloseHandle(procInfo.hThread);
- *pidPtr = (Tcl_Pid) (size_t) procInfo.dwProcessId;
+ *pidPtr = (Tcl_Pid)INT2PTR(procInfo.dwProcessId);
if (*pidPtr != 0) {
TclWinAddProcess(procInfo.hProcess, procInfo.dwProcessId);
}
@@ -2564,7 +2564,7 @@ Tcl_WaitPid(
prevPtrPtr = &procList;
for (infoPtr = procList; infoPtr != NULL;
prevPtrPtr = &infoPtr->nextPtr, infoPtr = infoPtr->nextPtr) {
- if (infoPtr->dwProcessId == (size_t) pid) {
+ if (infoPtr->dwProcessId == (Tcl_Size)pid) {
*prevPtrPtr = infoPtr->nextPtr;
break;
}
@@ -2674,7 +2674,7 @@ Tcl_WaitPid(
} else {
errno = ECHILD;
*statPtr = 0xC0000000 | ECHILD;
- result = (Tcl_Pid) -1;
+ result = (Tcl_Pid)-1;
}
/*
@@ -2708,7 +2708,7 @@ Tcl_WaitPid(
void
TclWinAddProcess(
void *hProcess, /* Handle to process */
- size_t id) /* Global process identifier */
+ Tcl_Size id) /* Global process identifier */
{
ProcInfo *procPtr = (ProcInfo *)Tcl_Alloc(sizeof(ProcInfo));