diff options
| author | das <das> | 2007-11-10 20:49:42 (GMT) |
|---|---|---|
| committer | das <das> | 2007-11-10 20:49:42 (GMT) |
| commit | 03f4929c04a034939ba8f638a08ec1d2540ff23a (patch) | |
| tree | f9933518784a53a7899c20a3b10740469185a122 /unix/tclUnixTime.c | |
| parent | 28991a1d80c6c660f59c7833a1a0eeaa355e1a43 (diff) | |
| download | tcl-03f4929c04a034939ba8f638a08ec1d2540ff23a.zip tcl-03f4929c04a034939ba8f638a08ec1d2540ff23a.tar.gz tcl-03f4929c04a034939ba8f638a08ec1d2540ff23a.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.c | 10 |
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 |
