From 4fe5cc0e44e83f9a1d4fa25e5f3cb4ffc08ddff7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 18 Mar 2024 16:18:00 +0000 Subject: Review: use more "LL". Eliminate some (Tcl_WideInt) typecasts. --- generic/tclClock.c | 8 ++++---- generic/tclClockFmt.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/generic/tclClock.c b/generic/tclClock.c index c49b1b4..5b0e5b1 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -2403,7 +2403,7 @@ ConvertUTCToLocalUsingC( * Convert that value to seconds. */ - fields->localSeconds = (((fields->julianDay * (Tcl_WideInt) 24 + fields->localSeconds = (((fields->julianDay * 24LL + timeVal->tm_hour) * 60 + timeVal->tm_min) * 60 + timeVal->tm_sec) - JULIAN_SEC_POSIX_EPOCH; @@ -3178,7 +3178,7 @@ ClockClicksObjCmd( switch (index) { case CLICKS_MILLIS: Tcl_GetTime(&now); - clicks = (Tcl_WideInt)now.sec * 1000 + now.usec / 1000; + clicks = now.sec * 1000LL + now.usec / 1000; break; case CLICKS_NATIVE: #ifdef TCL_WIDE_CLICKS @@ -3787,8 +3787,8 @@ ClockScanCommit( if (info->flags & (CLF_ASSEMBLE_SECONDS)) { yydate.localSeconds = - -210866803200L - + ( SECONDS_PER_DAY * (Tcl_WideInt)yydate.julianDay ) + -210866803200LL + + ( SECONDS_PER_DAY * yydate.julianDay ) + ( yySecondOfDay % SECONDS_PER_DAY ); } diff --git a/generic/tclClockFmt.c b/generic/tclClockFmt.c index 66dbf6b..d2175e6 100644 --- a/generic/tclClockFmt.c +++ b/generic/tclClockFmt.c @@ -231,9 +231,9 @@ _witoaw( if (val >= 0) { /* check resp. recalculate width */ - if (val >= 10000000000L) { + if (val >= 10000000000LL) { Tcl_WideInt val2; - val2 = val / 10000000000L; + val2 = val / 10000000000LL; while (width <= 9 && val2 >= wrange[width]) { width++; } @@ -263,9 +263,9 @@ _witoaw( if (!width) width++; /* check resp. recalculate width (regarding sign) */ width--; - if (val <= -10000000000L) { + if (val <= -10000000000LL) { Tcl_WideInt val2; - val2 = val / 10000000000L; + val2 = val / 10000000000LL; while (width <= 9 && val2 <= -wrange[width]) { width++; } @@ -1663,7 +1663,7 @@ done: yydate.julianDay = intJD; yydate.seconds = - -210866803200L + -210866803200LL + ( SECONDS_PER_DAY * intJD ) + ( fractJD ); @@ -1823,7 +1823,7 @@ ClockScnToken_StarDate_Proc(TCL_UNUSED(ClockFmtScnCmdArgs *), GetJulianDayFromEraYearDay(&yydate, GREGORIAN_CHANGE_DATE); yydate.localSeconds = - -210866803200L + -210866803200LL + ( SECONDS_PER_DAY * yydate.julianDay ) + ( SECONDS_PER_DAY * fractDay / fractDayDiv ); -- cgit v0.12