summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixTime.c
diff options
context:
space:
mode:
authordas <das>2007-11-10 20:49:42 (GMT)
committerdas <das>2007-11-10 20:49:42 (GMT)
commitdb8435f4f6d903ab177a991ed393676493928b77 (patch)
treef9933518784a53a7899c20a3b10740469185a122 /unix/tclUnixTime.c
parente607cd1ab59a2a4185647ec4f6831ca1d9781535 (diff)
downloadtcl-db8435f4f6d903ab177a991ed393676493928b77.zip
tcl-db8435f4f6d903ab177a991ed393676493928b77.tar.gz
tcl-db8435f4f6d903ab177a991ed393676493928b77.tar.bz2
* unix/tclUnixTime.c (TclpWideClicksToNanoseconds): fix issues with
* generic/tclInt.h: int64_t overflow.
Diffstat (limited to 'unix/tclUnixTime.c')
-rw-r--r--unix/tclUnixTime.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c
index 770f904..2fb1782 100644
--- a/unix/tclUnixTime.c
+++ b/unix/tclUnixTime.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixTime.c,v 1.31 2007/08/03 13:51:41 dkf Exp $
+ * RCS: @(#) $Id: tclUnixTime.c,v 1.32 2007/11/10 20:49:43 das Exp $
*/
#include "tclInt.h"
@@ -192,11 +192,11 @@ TclpGetWideClicks(void)
*-----------------------------------------------------------------------------
*/
-Tcl_WideInt
+double
TclpWideClicksToNanoseconds(
Tcl_WideInt clicks)
{
- Tcl_WideInt nsec;
+ double nsec;
if (tclGetTimeProcPtr != NativeGetTime) {
nsec = clicks * 1000;
@@ -210,9 +210,9 @@ TclpWideClicksToNanoseconds(
maxClicksForUInt64 = UINT64_MAX / tb.numer;
}
if ((uint64_t) clicks < maxClicksForUInt64) {
- nsec = (Tcl_WideInt) ((uint64_t) clicks * tb.numer / tb.denom);
+ nsec = ((uint64_t) clicks) * tb.numer / tb.denom;
} else {
- nsec = (Tcl_WideInt) ((long double) clicks * tb.numer / tb.denom);
+ nsec = ((long double) (uint64_t) clicks) * tb.numer / tb.denom;
}
#else
#error Wide high-resolution clicks not implemented on this platform