summaryrefslogtreecommitdiffstats
path: root/generic/tclClock.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-11-25 16:11:38 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-11-25 16:11:38 (GMT)
commitb816a585c00c97feca1b4516769ccf2769a58e02 (patch)
tree77a1bcad1ca6879eda9d8bfffc581640656aa39f /generic/tclClock.c
parentd6fedf785445439d2d54c58f3e9906b0d867cd88 (diff)
downloadtcl-b816a585c00c97feca1b4516769ccf2769a58e02.zip
tcl-b816a585c00c97feca1b4516769ccf2769a58e02.tar.gz
tcl-b816a585c00c97feca1b4516769ccf2769a58e02.tar.bz2
Tcl_NewDoubleObj -> TclNewDoubleObj and Tcl_NewWideIntObj -> TclNewIntObj (and similar). Gives more info when debugging
Diffstat (limited to 'generic/tclClock.c')
-rw-r--r--generic/tclClock.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c
index a9ba70c..d1f08c1 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -14,6 +14,7 @@
*/
#include "tclInt.h"
+#include "tclTomMath.h"
/*
* Windows has mktime. The configurators do not check.
@@ -1804,14 +1805,16 @@ ClockMillisecondsObjCmd(
Tcl_Obj *const *objv) /* Parameter values */
{
Tcl_Time now;
+ Tcl_Obj *timeObj;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
}
Tcl_GetTime(&now);
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj((Tcl_WideInt)
- now.sec * 1000 + now.usec / 1000));
+ TclNewUIntObj(timeObj, (Tcl_WideUInt)
+ now.sec * 1000 + now.usec / 1000);
+ Tcl_SetObjResult(interp, timeObj);
return TCL_OK;
}
@@ -1992,13 +1995,16 @@ ClockSecondsObjCmd(
Tcl_Obj *const *objv) /* Parameter values */
{
Tcl_Time now;
+ Tcl_Obj *timeObj;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
}
Tcl_GetTime(&now);
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj((Tcl_WideInt) now.sec));
+ TclNewUIntObj(timeObj, (Tcl_WideUInt)now.sec);
+
+ Tcl_SetObjResult(interp, timeObj);
return TCL_OK;
}