diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-12-17 15:44:01 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-12-17 15:44:01 (GMT) |
commit | c5500b60350f48a5de2b1217fa38cc678511a329 (patch) | |
tree | b9bf2ce2d2aa700f1c289bf0e8d113ce4be5108e /generic | |
parent | 0e057345422c670033e65792b8c69272862a5e74 (diff) | |
download | tcl-c5500b60350f48a5de2b1217fa38cc678511a329.zip tcl-c5500b60350f48a5de2b1217fa38cc678511a329.tar.gz tcl-c5500b60350f48a5de2b1217fa38cc678511a329.tar.bz2 |
Simplifications when assuming VS 2015 or later
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tcl.h | 2 | ||||
-rw-r--r-- | generic/tclCmdMZ.c | 14 | ||||
-rw-r--r-- | generic/tclInt.h | 7 | ||||
-rw-r--r-- | generic/tclMain.c | 5 | ||||
-rw-r--r-- | generic/tclThreadTest.c | 2 |
5 files changed, 9 insertions, 21 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index 72f9bed..e0bc708 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -361,7 +361,7 @@ typedef long LONG; #if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG) # if defined(_WIN32) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO) -# define TCL_WIDE_INT_TYPE __int64 +# define TCL_WIDE_INT_TYPE long long # define TCL_LL_MODIFIER "I64" # if defined(_WIN64) # define TCL_Z_MODIFIER "I" diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 3906810..d020a93 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -4148,14 +4148,14 @@ Tcl_TimeRateObjCmd( Tcl_Obj *objPtr; int result, i; Tcl_Obj *calibrate = NULL, *direct = NULL; - TclWideMUInt count = 0; /* Holds repetition count */ + Tcl_WideUInt count = 0; /* Holds repetition count */ Tcl_WideInt maxms = WIDE_MIN; /* Maximal running time (in milliseconds) */ - TclWideMUInt maxcnt = WIDE_MAX; + Tcl_WideUInt maxcnt = WIDE_MAX; /* Maximal count of iterations. */ - TclWideMUInt threshold = 1; /* Current threshold for check time (faster + Tcl_WideUInt threshold = 1; /* Current threshold for check time (faster * repeat count without time check) */ - TclWideMUInt maxIterTm = 1; /* Max time of some iteration as max + Tcl_WideUInt 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 @@ -4529,13 +4529,13 @@ Tcl_TimeRateObjCmd( { Tcl_Obj *objarr[8], **objs = objarr; - TclWideMUInt usec, val; + Tcl_WideUInt usec, val; int digits; /* * Absolute execution time in microseconds or in wide clicks. */ - usec = (TclWideMUInt)(middle - start); + usec = (Tcl_WideUInt)(middle - start); #ifdef TCL_WIDE_CLICKS /* @@ -4565,7 +4565,7 @@ Tcl_TimeRateObjCmd( * Estimate the time of overhead (microsecs). */ - TclWideMUInt curOverhead = overhead * count; + Tcl_WideUInt curOverhead = overhead * count; if (usec > curOverhead) { usec -= curOverhead; diff --git a/generic/tclInt.h b/generic/tclInt.h index 8088d0e..dbb06cd 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3280,13 +3280,6 @@ MODULE_SCOPE void TclInitThreadStorage(void); MODULE_SCOPE void TclFinalizeThreadDataThread(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/generic/tclMain.c b/generic/tclMain.c index 13231b5..bb48dbb 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -64,11 +64,6 @@ NewNativeObj( * source directory to make their own modified versions). */ -#if defined _MSC_VER && _MSC_VER < 1900 -/* isatty is always defined on MSVC 14.0, but not necessarily as CRTIMPORT. */ -extern CRTIMPORT int isatty(int fd); -#endif - /* * The thread-local variables for this file's functions. */ diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c index c484fb6..cbffb0d 100644 --- a/generic/tclThreadTest.c +++ b/generic/tclThreadTest.c @@ -370,7 +370,7 @@ ThreadObjCmd( } else { char buf[20]; - sprintf(buf, "%" TCL_LL_MODIFIER "d", id); + sprintf(buf, "%lld", id); Tcl_AppendResult(interp, "cannot join thread ", buf, NULL); } return result; |