diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-04-08 12:10:35 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-04-08 12:10:35 (GMT) |
commit | ecd8e8bce1ae18281cf79ca447cbafe017127afb (patch) | |
tree | 9d540c96ef6a09efd2dcece44184a279e50441cd /generic | |
parent | b65a7b7a4c0158ebe20ac113a3e65ad1d331a397 (diff) | |
download | tcl-ecd8e8bce1ae18281cf79ca447cbafe017127afb.zip tcl-ecd8e8bce1ae18281cf79ca447cbafe017127afb.tar.gz tcl-ecd8e8bce1ae18281cf79ca447cbafe017127afb.tar.bz2 |
Use INT2PTR/PTR2INT macro's as appropriate
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclThreadTest.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c index 9f08d83..49633f2 100644 --- a/generic/tclThreadTest.c +++ b/generic/tclThreadTest.c @@ -271,7 +271,7 @@ ThreadObjCmd( } else { result = NULL; } - return ThreadCancel(interp, (Tcl_ThreadId) (size_t) id, result, flags); + return ThreadCancel(interp, (Tcl_ThreadId) INT2PTR(id), result, flags); } case THREAD_CREATE: { const char *script; @@ -335,11 +335,11 @@ ThreadObjCmd( */ if (objc == 2) { - idObj = Tcl_NewWideIntObj((Tcl_WideInt)(size_t)Tcl_GetCurrentThread()); + idObj = Tcl_NewWideIntObj((Tcl_WideInt)PTR2INT(Tcl_GetCurrentThread())); } else if (objc == 3 && strcmp("-main", Tcl_GetString(objv[2])) == 0) { Tcl_MutexLock(&threadMutex); - idObj = Tcl_NewWideIntObj((Tcl_WideInt)(size_t)mainThreadId); + idObj = Tcl_NewWideIntObj((Tcl_WideInt)PTR2INT(mainThreadId)); Tcl_MutexUnlock(&threadMutex); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); @@ -364,7 +364,7 @@ ThreadObjCmd( return TCL_ERROR; } - result = Tcl_JoinThread((Tcl_ThreadId)(size_t)id, &status); + result = Tcl_JoinThread((Tcl_ThreadId)INT2PTR(id), &status); if (result == TCL_OK) { Tcl_SetIntObj(Tcl_GetObjResult(interp), status); } else { @@ -406,7 +406,7 @@ ThreadObjCmd( } arg++; script = Tcl_GetString(objv[arg]); - return ThreadSend(interp, (Tcl_ThreadId)(size_t)id, script, wait); + return ThreadSend(interp, (Tcl_ThreadId)INT2PTR(id), script, wait); } case THREAD_EVENT: { if (objc > 2) { |