From be26adf83b00a077251c7242792c50c23fa0baa7 Mon Sep 17 00:00:00 2001 From: sebres Date: Tue, 25 Jun 2019 16:09:33 +0000 Subject: fixed build with MSVC 6.0 --- generic/tclCmdMZ.c | 14 +++++++------- generic/tclExecute.c | 9 +++------ generic/tclInt.h | 7 +++++++ win/tclWinFile.c | 1 - 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index bc03d73..d36b0f0 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -3986,14 +3986,14 @@ Tcl_TimeRateObjCmd( register Tcl_Obj *objPtr; register int result, i; Tcl_Obj *calibrate = NULL, *direct = NULL; - Tcl_WideUInt count = 0; /* Holds repetition count */ + TclWideMUInt count = 0; /* Holds repetition count */ Tcl_WideInt maxms = WIDE_MIN; /* Maximal running time (in milliseconds) */ - Tcl_WideUInt maxcnt = WIDE_MAX; + TclWideMUInt maxcnt = WIDE_MAX; /* Maximal count of iterations. */ - Tcl_WideUInt threshold = 1; /* Current threshold for check time (faster + TclWideMUInt threshold = 1; /* Current threshold for check time (faster * repeat count without time check) */ - Tcl_WideUInt maxIterTm = 1; /* Max time of some iteration as max + TclWideMUInt maxIterTm = 1; /* Max time of some iteration as max * threshold, additionally avoiding divide to * zero (i.e., never < 1) */ unsigned short factor = 50; /* Factor (4..50) limiting threshold to avoid @@ -4363,13 +4363,13 @@ Tcl_TimeRateObjCmd( { Tcl_Obj *objarr[8], **objs = objarr; - Tcl_WideUInt usec, val; + TclWideMUInt usec, val; int digits; /* * Absolute execution time in microseconds or in wide clicks. */ - usec = (Tcl_WideUInt)(middle - start); + usec = (TclWideMUInt)(middle - start); #ifdef TCL_WIDE_CLICKS /* @@ -4398,7 +4398,7 @@ Tcl_TimeRateObjCmd( * Estimate the time of overhead (microsecs). */ - Tcl_WideUInt curOverhead = overhead * count; + TclWideMUInt curOverhead = overhead * count; if (usec > curOverhead) { usec -= curOverhead; diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 265b82f..0c2baab 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -4938,7 +4938,7 @@ TclExecuteByteCode( } #endif { - mp_int big2; + mp_int big1, big2; Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2); @@ -4956,8 +4956,6 @@ TclExecuteByteCode( * Arguments are opposite sign; remainder is sum. */ - mp_int big1; - TclBNInitBignumFromLong(&big1, l1); mp_add(&big2, &big1, &big2); mp_clear(&big1); @@ -4994,7 +4992,8 @@ TclExecuteByteCode( NEXT_INST_F(1, 2, 1); } { - mp_int big2; + mp_int big1, big2; + Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2); /* TODO: internals intrusion */ @@ -5011,8 +5010,6 @@ TclExecuteByteCode( * Arguments are opposite sign; remainder is sum. */ - mp_int big1; - TclBNInitBignumFromWideInt(&big1, w1); mp_add(&big2, &big1, &big2); mp_clear(&big1); diff --git a/generic/tclInt.h b/generic/tclInt.h index 8b4ccc5..974dd0d 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2773,6 +2773,13 @@ MODULE_SCOPE void TclInitThreadStorage(void); MODULE_SCOPE void TclpFinalizeThreadDataThread(void); MODULE_SCOPE void TclFinalizeThreadStorage(void); +/* TclWideMUInt -- wide integer used for measurement calculations: */ +#if (!defined(_WIN32) || !defined(_MSC_VER) || (_MSC_VER >= 1400)) +# define TclWideMUInt Tcl_WideUInt +#else +/* older MSVS may not allow conversions between unsigned __int64 and double) */ +# define TclWideMUInt Tcl_WideInt +#endif #ifdef TCL_WIDE_CLICKS MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void); MODULE_SCOPE double TclpWideClicksToNanoseconds(Tcl_WideInt clicks); diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 8ee4bce..d582664 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -17,7 +17,6 @@ #include #include #include /* For TclpGetUserHome(). */ -#include /* For TclpGetUserHome(). */ /* * The number of 100-ns intervals between the Windows system epoch (1601-01-01 -- cgit v0.12 From 334b8029eddb4e6df592c5f540ade0fd957a72c1 Mon Sep 17 00:00:00 2001 From: sebres Date: Tue, 25 Jun 2019 17:45:23 +0000 Subject: nmakehlp: fixed const qualifier --- win/nmakehlp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/nmakehlp.c b/win/nmakehlp.c index 0439d1c..6532f8a 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -74,7 +74,7 @@ main( char msg[300]; DWORD dwWritten; int chars; - char *s; + const char *s; /* * Make sure children (cl.exe and link.exe) are kept quiet. -- cgit v0.12