summaryrefslogtreecommitdiffstats
path: root/generic/tclProcess.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclProcess.c')
-rw-r--r--generic/tclProcess.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/generic/tclProcess.c b/generic/tclProcess.c
index 65c087c..72d8b96 100644
--- a/generic/tclProcess.c
+++ b/generic/tclProcess.c
@@ -47,7 +47,7 @@ static void InitProcessInfo(ProcessInfo *info, Tcl_Pid pid,
int resolvedPid);
static void FreeProcessInfo(ProcessInfo *info);
static int RefreshProcessInfo(ProcessInfo *info, int options);
-static TclProcessWaitStatus WaitProcessStatus(Tcl_Pid pid, int resolvedPid,
+static TclProcessWaitStatus WaitProcessStatus(Tcl_Pid pid, size_t resolvedPid,
int options, int *codePtr, Tcl_Obj **msgPtr,
Tcl_Obj **errorObjPtr);
static Tcl_Obj * BuildProcessStatusObj(ProcessInfo *info);
@@ -130,7 +130,7 @@ FreeProcessInfo(
* Free allocated structure.
*/
- ckfree(info);
+ Tcl_Free(info);
}
/*
@@ -193,7 +193,7 @@ RefreshProcessInfo(
TclProcessWaitStatus
WaitProcessStatus(
Tcl_Pid pid, /* Process id. */
- int resolvedPid, /* Resolved process id. */
+ size_t resolvedPid, /* Resolved process id. */
int options, /* Options passed to Tcl_WaitPid. */
int *codePtr, /* If non-NULL, will receive either:
* - 0 for normal exit.
@@ -402,7 +402,7 @@ BuildProcessStatusObj(
static int
ProcessListObjCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -453,20 +453,19 @@ ProcessListObjCmd(
static int
ProcessStatusObjCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *dict;
- int index, options = WNOHANG;
+ int options = WNOHANG;
Tcl_HashEntry *entry;
Tcl_HashSearch search;
ProcessInfo *info;
- int numPids;
+ size_t i, numPids;
Tcl_Obj **pidObjs;
int result;
- int i;
int pid;
Tcl_Obj *const *savedobjv = objv;
static const char *const switches[] = {
@@ -474,7 +473,7 @@ ProcessStatusObjCmd(
};
enum switchesEnum {
STATUS_WAIT, STATUS_LAST
- };
+ } index;
while (objc > 1) {
if (TclGetString(objv[1])[0] != '-') {
@@ -485,7 +484,7 @@ ProcessStatusObjCmd(
return TCL_ERROR;
}
++objv; --objc;
- if (STATUS_WAIT == (enum switchesEnum) index) {
+ if (STATUS_WAIT == index) {
options = 0;
} else {
break;
@@ -601,7 +600,7 @@ ProcessStatusObjCmd(
static int
ProcessPurgeObjCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -609,11 +608,9 @@ ProcessPurgeObjCmd(
Tcl_HashEntry *entry;
Tcl_HashSearch search;
ProcessInfo *info;
- int numPids;
+ size_t i, numPids;
Tcl_Obj **pidObjs;
- int result;
- int i;
- int pid;
+ int result, pid;
if (objc != 1 && objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?pids?");
@@ -701,7 +698,7 @@ ProcessPurgeObjCmd(
static int
ProcessAutopurgeObjCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -800,7 +797,7 @@ void
TclProcessCreated(
Tcl_Pid pid) /* Process id. */
{
- int resolvedPid;
+ size_t resolvedPid;
Tcl_HashEntry *entry, *entry2;
int isNew;
ProcessInfo *info;
@@ -834,7 +831,7 @@ TclProcessCreated(
* Allocate and initialize info structure.
*/
- info = (ProcessInfo *)ckalloc(sizeof(ProcessInfo));
+ info = (ProcessInfo *)Tcl_Alloc(sizeof(ProcessInfo));
InitProcessInfo(info, pid, resolvedPid);
/*