From f09dcac7855bb4d75a3ca3b44b9d5ce188260bff Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jan 2021 09:37:25 +0000 Subject: Omit -Wdeclaration-after-statement from CFLAGS: No longer needed since we stopped support for MSVC 6++ Change Tcl_WideInt -> long long in various places: Tcl_WideInt could be a 128-bit type, we don't want that everywhere. --- doc/CrtChannel.3 | 6 +-- doc/FileSystem.3 | 6 +-- doc/OpenFileChnl.3 | 8 ++-- generic/tcl.decls | 16 ++++---- generic/tcl.h | 36 ++++++++---------- generic/tclDecls.h | 32 ++++++++-------- generic/tclFileName.c | 22 +++++------ generic/tclIO.c | 14 +++---- generic/tclIOGT.c | 10 ++--- generic/tclIORChan.c | 8 ++-- generic/tclIORTrans.c | 8 ++-- generic/tclInt.decls | 2 +- generic/tclInt.h | 8 ++-- generic/tclIntDecls.h | 4 +- generic/tclStrToD.c | 8 ++-- generic/tclThreadTest.c | 4 +- generic/tclZipfs.c | 12 +++--- macosx/Tcl-Common.xcconfig | 2 +- macosx/tclMacOSXNotify.c | 2 +- unix/configure | 2 +- unix/tcl.m4 | 2 +- unix/tclUnixChan.c | 16 ++++---- unix/tclUnixTime.c | 14 +++---- win/configure | 2 +- win/tcl.m4 | 2 +- win/tclWinChan.c | 16 ++++---- win/tclWinFile.c | 12 +++--- win/tclWinTime.c | 92 +++++++++++++++++++++++----------------------- 28 files changed, 181 insertions(+), 185 deletions(-) diff --git a/doc/CrtChannel.3 b/doc/CrtChannel.3 index 0092cfb..02772e8 100644 --- a/doc/CrtChannel.3 +++ b/doc/CrtChannel.3 @@ -600,9 +600,9 @@ in preference to the \fIseekProc\fR, but both must be defined if the following prototype: .PP .CS -typedef Tcl_WideInt \fBTcl_DriverWideSeekProc\fR( +typedef long long \fBTcl_DriverWideSeekProc\fR( ClientData \fIinstanceData\fR, - Tcl_WideInt \fIoffset\fR, + long long \fIoffset\fR, int \fIseekMode\fR, int *\fIerrorCodePtr\fR); .CE @@ -824,7 +824,7 @@ length. It can be NULL. .CS typedef int \fBTcl_DriverTruncateProc\fR( ClientData \fIinstanceData\fR, - Tcl_WideInt \fIlength\fR); + long long \fIlength\fR); .CE .PP \fIInstanceData\fR is the same as the value passed to diff --git a/doc/FileSystem.3 b/doc/FileSystem.3 index 4e77114..99acf7e 100644 --- a/doc/FileSystem.3 +++ b/doc/FileSystem.3 @@ -144,7 +144,7 @@ Tcl_Obj * Tcl_StatBuf * \fBTcl_AllocStatBuf\fR() .sp -Tcl_WideInt +long long \fBTcl_GetAccessTimeFromStat\fR(\fIstatPtr\fR) .sp unsigned @@ -153,7 +153,7 @@ unsigned Tcl_WideUInt \fBTcl_GetBlocksFromStat\fR(\fIstatPtr\fR) .sp -Tcl_WideInt +long long \fBTcl_GetChangeTimeFromStat\fR(\fIstatPtr\fR) .sp int @@ -174,7 +174,7 @@ int unsigned \fBTcl_GetModeFromStat\fR(\fIstatPtr\fR) .sp -Tcl_WideInt +long long \fBTcl_GetModificationTimeFromStat\fR(\fIstatPtr\fR) .sp Tcl_WideUInt diff --git a/doc/OpenFileChnl.3 b/doc/OpenFileChnl.3 index 82851da..c1d1922 100644 --- a/doc/OpenFileChnl.3 +++ b/doc/OpenFileChnl.3 @@ -92,10 +92,10 @@ int int \fBTcl_OutputBuffered\fR(\fIchannel\fR) .sp -Tcl_WideInt +long long \fBTcl_Seek\fR(\fIchannel, offset, seekMode\fR) .sp -Tcl_WideInt +long long \fBTcl_Tell\fR(\fIchannel\fR) .sp int @@ -190,7 +190,7 @@ A buffer containing the bytes to output to the channel. .AP int bytesToWrite in The number of bytes to consume from \fIcharBuf\fR or \fIbyteBuf\fR and output to the channel. -.AP Tcl_WideInt offset in +.AP "long long" offset in How far to move the access point in the channel at which the next input or output operation will be applied, measured in bytes from the position given by \fIseekMode\fR. May be either positive or negative. @@ -198,7 +198,7 @@ given by \fIseekMode\fR. May be either positive or negative. Relative to which point to seek; used with \fIoffset\fR to calculate the new access point for the channel. Legal values are \fBSEEK_SET\fR, \fBSEEK_CUR\fR, and \fBSEEK_END\fR. -.AP Tcl_WideInt length in +.AP "long long" length in The (non-negative) length to truncate the channel the channel to. .AP "const char" *optionName in The name of an option applicable to this channel, such as \fB\-blocking\fR. diff --git a/generic/tcl.decls b/generic/tcl.decls index c4af7cc..e0708d5 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -1751,10 +1751,10 @@ declare 490 { Tcl_StatBuf *Tcl_AllocStatBuf(void) } declare 491 { - Tcl_WideInt Tcl_Seek(Tcl_Channel chan, Tcl_WideInt offset, int mode) + long long Tcl_Seek(Tcl_Channel chan, long long offset, int mode) } declare 492 { - Tcl_WideInt Tcl_Tell(Tcl_Channel chan) + long long Tcl_Tell(Tcl_Channel chan) } # TIP#91 (back-compat enhancements for channels) dkf @@ -2026,7 +2026,7 @@ declare 559 { # TIP #208 ('chan' command) jeffh declare 560 { - int Tcl_TruncateChannel(Tcl_Channel chan, Tcl_WideInt length) + int Tcl_TruncateChannel(Tcl_Channel chan, long long length) } declare 561 { Tcl_DriverTruncateProc *Tcl_ChannelTruncateProc( @@ -2177,19 +2177,19 @@ declare 595 { int Tcl_GetDeviceTypeFromStat(const Tcl_StatBuf *statPtr) } declare 596 { - Tcl_WideInt Tcl_GetAccessTimeFromStat(const Tcl_StatBuf *statPtr) + long long Tcl_GetAccessTimeFromStat(const Tcl_StatBuf *statPtr) } declare 597 { - Tcl_WideInt Tcl_GetModificationTimeFromStat(const Tcl_StatBuf *statPtr) + long long Tcl_GetModificationTimeFromStat(const Tcl_StatBuf *statPtr) } declare 598 { - Tcl_WideInt Tcl_GetChangeTimeFromStat(const Tcl_StatBuf *statPtr) + long long Tcl_GetChangeTimeFromStat(const Tcl_StatBuf *statPtr) } declare 599 { - Tcl_WideUInt Tcl_GetSizeFromStat(const Tcl_StatBuf *statPtr) + unsigned long long Tcl_GetSizeFromStat(const Tcl_StatBuf *statPtr) } declare 600 { - Tcl_WideUInt Tcl_GetBlocksFromStat(const Tcl_StatBuf *statPtr) + unsigned long long Tcl_GetBlocksFromStat(const Tcl_StatBuf *statPtr) } declare 601 { unsigned Tcl_GetBlockSizeFromStat(const Tcl_StatBuf *statPtr) diff --git a/generic/tcl.h b/generic/tcl.h index dfd025f..08e656d 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -360,24 +360,16 @@ typedef long LONG; * sprintf(...,"%" TCL_LL_MODIFIER "d",...). */ -#if !defined(TCL_WIDE_INT_TYPE) && !defined(TCL_WIDE_INT_IS_LONG) -# ifdef _WIN32 -# if defined(_WIN32) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO) -# define TCL_LL_MODIFIER "I64" -# else -# define TCL_LL_MODIFIER "ll" -# endif -# elif !defined(__GNUC__) +#if !defined(TCL_WIDE_INT_TYPE) && !defined(TCL_WIDE_INT_IS_LONG) && !defined(_WIN32) && !defined(__GNUC__) /* * Don't know what platform it is and configure hasn't discovered what is * going on for us. Try to guess... */ -# include -# if defined(LLONG_MAX) && (LLONG_MAX == LONG_MAX) -# define TCL_WIDE_INT_IS_LONG 1 -# endif -# endif /* !__GNUC__ */ -#endif /* !TCL_WIDE_INT_TYPE & !TCL_WIDE_INT_IS_LONG */ +# include +# if defined(LLONG_MAX) && (LLONG_MAX == LONG_MAX) +# define TCL_WIDE_INT_IS_LONG 1 +# endif +#endif #ifndef TCL_WIDE_INT_TYPE # define TCL_WIDE_INT_TYPE long long @@ -387,7 +379,11 @@ typedef TCL_WIDE_INT_TYPE Tcl_WideInt; typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt; #ifndef TCL_LL_MODIFIER -# define TCL_LL_MODIFIER "ll" +# if defined(_WIN32) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO) +# define TCL_LL_MODIFIER "I64" +# else +# define TCL_LL_MODIFIER "ll" +# endif #endif /* !TCL_LL_MODIFIER */ #ifndef TCL_Z_MODIFIER # if defined(__GNUC__) && !defined(_WIN32) @@ -955,7 +951,7 @@ typedef struct Tcl_DString { * 64-bit integers). */ -#define TCL_INTEGER_SPACE 24 +#define TCL_INTEGER_SPACE (3*(int)sizeof(Tcl_WideInt)) /* * Flag values passed to Tcl_ConvertElement. @@ -1443,8 +1439,8 @@ typedef int (Tcl_DriverGetHandleProc) (ClientData instanceData, typedef int (Tcl_DriverFlushProc) (ClientData instanceData); typedef int (Tcl_DriverHandlerProc) (ClientData instanceData, int interestMask); -typedef Tcl_WideInt (Tcl_DriverWideSeekProc) (ClientData instanceData, - Tcl_WideInt offset, int mode, int *errorCodePtr); +typedef long long (Tcl_DriverWideSeekProc) (ClientData instanceData, + long long offset, int mode, int *errorCodePtr); /* * TIP #218, Channel Thread Actions */ @@ -1453,8 +1449,8 @@ typedef void (Tcl_DriverThreadActionProc) (ClientData instanceData, /* * TIP #208, File Truncation (etc.) */ -typedef int (Tcl_DriverTruncateProc) (ClientData instanceData, - Tcl_WideInt length); +typedef int (Tcl_DriverTruncateProc) (void *instanceData, + long long length); /* * struct Tcl_ChannelType: diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 9ea6838..baa27e3 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -1464,10 +1464,10 @@ EXTERN void Tcl_SetWideIntObj(Tcl_Obj *objPtr, /* 490 */ EXTERN Tcl_StatBuf * Tcl_AllocStatBuf(void); /* 491 */ -EXTERN Tcl_WideInt Tcl_Seek(Tcl_Channel chan, Tcl_WideInt offset, +EXTERN long long Tcl_Seek(Tcl_Channel chan, long long offset, int mode); /* 492 */ -EXTERN Tcl_WideInt Tcl_Tell(Tcl_Channel chan); +EXTERN long long Tcl_Tell(Tcl_Channel chan); /* 493 */ EXTERN Tcl_DriverWideSeekProc * Tcl_ChannelWideSeekProc( const Tcl_ChannelType *chanTypePtr); @@ -1665,7 +1665,7 @@ EXTERN int Tcl_TakeBignumFromObj(Tcl_Interp *interp, Tcl_Obj *obj, void *value); /* 560 */ EXTERN int Tcl_TruncateChannel(Tcl_Channel chan, - Tcl_WideInt length); + long long length); /* 561 */ EXTERN Tcl_DriverTruncateProc * Tcl_ChannelTruncateProc( const Tcl_ChannelType *chanTypePtr); @@ -1771,16 +1771,16 @@ EXTERN int Tcl_GetGroupIdFromStat(const Tcl_StatBuf *statPtr); /* 595 */ EXTERN int Tcl_GetDeviceTypeFromStat(const Tcl_StatBuf *statPtr); /* 596 */ -EXTERN Tcl_WideInt Tcl_GetAccessTimeFromStat(const Tcl_StatBuf *statPtr); +EXTERN long long Tcl_GetAccessTimeFromStat(const Tcl_StatBuf *statPtr); /* 597 */ -EXTERN Tcl_WideInt Tcl_GetModificationTimeFromStat( +EXTERN long long Tcl_GetModificationTimeFromStat( const Tcl_StatBuf *statPtr); /* 598 */ -EXTERN Tcl_WideInt Tcl_GetChangeTimeFromStat(const Tcl_StatBuf *statPtr); +EXTERN long long Tcl_GetChangeTimeFromStat(const Tcl_StatBuf *statPtr); /* 599 */ -EXTERN Tcl_WideUInt Tcl_GetSizeFromStat(const Tcl_StatBuf *statPtr); +EXTERN unsigned long long Tcl_GetSizeFromStat(const Tcl_StatBuf *statPtr); /* 600 */ -EXTERN Tcl_WideUInt Tcl_GetBlocksFromStat(const Tcl_StatBuf *statPtr); +EXTERN unsigned long long Tcl_GetBlocksFromStat(const Tcl_StatBuf *statPtr); /* 601 */ EXTERN unsigned Tcl_GetBlockSizeFromStat(const Tcl_StatBuf *statPtr); /* 602 */ @@ -2446,8 +2446,8 @@ typedef struct TclStubs { Tcl_Obj * (*tcl_NewWideIntObj) (Tcl_WideInt wideValue); /* 488 */ void (*tcl_SetWideIntObj) (Tcl_Obj *objPtr, Tcl_WideInt wideValue); /* 489 */ Tcl_StatBuf * (*tcl_AllocStatBuf) (void); /* 490 */ - Tcl_WideInt (*tcl_Seek) (Tcl_Channel chan, Tcl_WideInt offset, int mode); /* 491 */ - Tcl_WideInt (*tcl_Tell) (Tcl_Channel chan); /* 492 */ + long long (*tcl_Seek) (Tcl_Channel chan, long long offset, int mode); /* 491 */ + long long (*tcl_Tell) (Tcl_Channel chan); /* 492 */ Tcl_DriverWideSeekProc * (*tcl_ChannelWideSeekProc) (const Tcl_ChannelType *chanTypePtr); /* 493 */ int (*tcl_DictObjPut) (Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Obj *keyPtr, Tcl_Obj *valuePtr); /* 494 */ int (*tcl_DictObjGet) (Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Obj *keyPtr, Tcl_Obj **valuePtrPtr); /* 495 */ @@ -2515,7 +2515,7 @@ typedef struct TclStubs { void (*tcl_SetBignumObj) (Tcl_Obj *obj, void *value); /* 557 */ int (*tcl_GetBignumFromObj) (Tcl_Interp *interp, Tcl_Obj *obj, void *value); /* 558 */ int (*tcl_TakeBignumFromObj) (Tcl_Interp *interp, Tcl_Obj *obj, void *value); /* 559 */ - int (*tcl_TruncateChannel) (Tcl_Channel chan, Tcl_WideInt length); /* 560 */ + int (*tcl_TruncateChannel) (Tcl_Channel chan, long long length); /* 560 */ Tcl_DriverTruncateProc * (*tcl_ChannelTruncateProc) (const Tcl_ChannelType *chanTypePtr); /* 561 */ void (*tcl_SetChannelErrorInterp) (Tcl_Interp *interp, Tcl_Obj *msg); /* 562 */ void (*tcl_GetChannelErrorInterp) (Tcl_Interp *interp, Tcl_Obj **msg); /* 563 */ @@ -2551,11 +2551,11 @@ typedef struct TclStubs { int (*tcl_GetUserIdFromStat) (const Tcl_StatBuf *statPtr); /* 593 */ int (*tcl_GetGroupIdFromStat) (const Tcl_StatBuf *statPtr); /* 594 */ int (*tcl_GetDeviceTypeFromStat) (const Tcl_StatBuf *statPtr); /* 595 */ - Tcl_WideInt (*tcl_GetAccessTimeFromStat) (const Tcl_StatBuf *statPtr); /* 596 */ - Tcl_WideInt (*tcl_GetModificationTimeFromStat) (const Tcl_StatBuf *statPtr); /* 597 */ - Tcl_WideInt (*tcl_GetChangeTimeFromStat) (const Tcl_StatBuf *statPtr); /* 598 */ - Tcl_WideUInt (*tcl_GetSizeFromStat) (const Tcl_StatBuf *statPtr); /* 599 */ - Tcl_WideUInt (*tcl_GetBlocksFromStat) (const Tcl_StatBuf *statPtr); /* 600 */ + long long (*tcl_GetAccessTimeFromStat) (const Tcl_StatBuf *statPtr); /* 596 */ + long long (*tcl_GetModificationTimeFromStat) (const Tcl_StatBuf *statPtr); /* 597 */ + long long (*tcl_GetChangeTimeFromStat) (const Tcl_StatBuf *statPtr); /* 598 */ + unsigned long long (*tcl_GetSizeFromStat) (const Tcl_StatBuf *statPtr); /* 599 */ + unsigned long long (*tcl_GetBlocksFromStat) (const Tcl_StatBuf *statPtr); /* 600 */ unsigned (*tcl_GetBlockSizeFromStat) (const Tcl_StatBuf *statPtr); /* 601 */ int (*tcl_SetEnsembleParameterList) (Tcl_Interp *interp, Tcl_Command token, Tcl_Obj *paramList); /* 602 */ int (*tcl_GetEnsembleParameterList) (Tcl_Interp *interp, Tcl_Command token, Tcl_Obj **paramListPtr); /* 603 */ diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 6ef768d..4ef9e39 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -2600,44 +2600,44 @@ Tcl_GetDeviceTypeFromStat( return (int) statPtr->st_rdev; } -Tcl_WideInt +long long Tcl_GetAccessTimeFromStat( const Tcl_StatBuf *statPtr) { - return (Tcl_WideInt) statPtr->st_atime; + return (long long) statPtr->st_atime; } -Tcl_WideInt +long long Tcl_GetModificationTimeFromStat( const Tcl_StatBuf *statPtr) { - return (Tcl_WideInt) statPtr->st_mtime; + return (long long) statPtr->st_mtime; } -Tcl_WideInt +long long Tcl_GetChangeTimeFromStat( const Tcl_StatBuf *statPtr) { - return (Tcl_WideInt) statPtr->st_ctime; + return (long long) statPtr->st_ctime; } -Tcl_WideUInt +unsigned long long Tcl_GetSizeFromStat( const Tcl_StatBuf *statPtr) { - return (Tcl_WideUInt) statPtr->st_size; + return (unsigned long long) statPtr->st_size; } -Tcl_WideUInt +unsigned long long Tcl_GetBlocksFromStat( const Tcl_StatBuf *statPtr) { #ifdef HAVE_STRUCT_STAT_ST_BLOCKS - return (Tcl_WideUInt) statPtr->st_blocks; + return (unsigned long long) statPtr->st_blocks; #else unsigned blksize = Tcl_GetBlockSizeFromStat(statPtr); - return ((Tcl_WideUInt) statPtr->st_size + blksize - 1) / blksize; + return ((unsigned long long) statPtr->st_size + blksize - 1) / blksize; #endif } diff --git a/generic/tclIO.c b/generic/tclIO.c index 2afd2cf..9cace8c 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -6989,10 +6989,10 @@ GetInput( *---------------------------------------------------------------------- */ -Tcl_WideInt +long long Tcl_Seek( Tcl_Channel chan, /* The channel on which to seek. */ - Tcl_WideInt offset, /* Offset to seek to. */ + long long offset, /* Offset to seek to. */ int mode) /* Relative to which location to seek? */ { Channel *chanPtr = (Channel *) chan; @@ -7002,7 +7002,7 @@ Tcl_Seek( int inputBuffered, outputBuffered; /* # bytes held in buffers. */ int result; /* Of device driver operations. */ - Tcl_WideInt curPos; /* Position on the device. */ + long long curPos; /* Position on the device. */ int wasAsync; /* Was the channel nonblocking before the seek * operation? If so, must restore to * non-blocking mode after the seek. */ @@ -7162,7 +7162,7 @@ Tcl_Seek( *---------------------------------------------------------------------- */ -Tcl_WideInt +long long Tcl_Tell( Tcl_Channel chan) /* The channel to return pos for. */ { @@ -7173,7 +7173,7 @@ Tcl_Tell( int inputBuffered, outputBuffered; /* # bytes held in buffers. */ int result; /* Of calling device driver. */ - Tcl_WideInt curPos; /* Position on device. */ + long long curPos; /* Position on device. */ if (CheckChannelErrors(statePtr, TCL_WRITABLE | TCL_READABLE) != 0) { return -1; @@ -7257,7 +7257,7 @@ Tcl_Tell( int Tcl_TruncateChannel( Tcl_Channel chan, /* Channel to truncate. */ - Tcl_WideInt length) /* Length to truncate it to. */ + long long length) /* Length to truncate it to. */ { Channel *chanPtr = (Channel *) chan; Tcl_DriverTruncateProc *truncateProc = @@ -9159,7 +9159,7 @@ TclCopyChannel( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Channel inChan, /* Channel to read from. */ Tcl_Channel outChan, /* Channel to write to. */ - Tcl_WideInt toRead, /* Amount of data to copy, or -1 for all. */ + long long toRead, /* Amount of data to copy, or -1 for all. */ Tcl_Obj *cmdPtr) /* Pointer to script to execute or NULL. */ { Channel *inPtr = (Channel *) inChan; diff --git a/generic/tclIOGT.c b/generic/tclIOGT.c index 95a8e0e..f03fcca 100644 --- a/generic/tclIOGT.c +++ b/generic/tclIOGT.c @@ -41,8 +41,8 @@ static void TransformWatchProc(ClientData instanceData, int mask); static int TransformGetFileHandleProc(ClientData instanceData, int direction, ClientData *handlePtr); static int TransformNotifyProc(ClientData instanceData, int mask); -static Tcl_WideInt TransformWideSeekProc(ClientData instanceData, - Tcl_WideInt offset, int mode, int *errorCodePtr); +static long long TransformWideSeekProc(ClientData instanceData, + long long offset, int mode, int *errorCodePtr); /* * Forward declarations of internal procedures. Secondly the procedures for @@ -907,10 +907,10 @@ TransformSeekProc( *---------------------------------------------------------------------- */ -static Tcl_WideInt +static long long TransformWideSeekProc( ClientData instanceData, /* The channel to manipulate. */ - Tcl_WideInt offset, /* Size of movement. */ + long long offset, /* Size of movement. */ int mode, /* How to move. */ int *errorCodePtr) /* Location of error flag. */ { @@ -922,7 +922,7 @@ TransformWideSeekProc( #endif Tcl_DriverWideSeekProc *parentWideSeekProc = Tcl_ChannelWideSeekProc(parentType); - ClientData parentData = Tcl_GetChannelInstanceData(parent); + void *parentData = Tcl_GetChannelInstanceData(parent); if ((offset == 0) && (mode == SEEK_CUR)) { /* diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 888d946..e6e8e58 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -44,8 +44,8 @@ static void ReflectThread(ClientData clientData, int action); static int ReflectEventRun(Tcl_Event *ev, int flags); static int ReflectEventDelete(Tcl_Event *ev, ClientData cd); #endif -static Tcl_WideInt ReflectSeekWide(ClientData clientData, - Tcl_WideInt offset, int mode, int *errorCodePtr); +static long long ReflectSeekWide(ClientData clientData, + long long offset, int mode, int *errorCodePtr); #ifndef TCL_NO_DEPRECATED static int ReflectSeek(ClientData clientData, long offset, int mode, int *errorCodePtr); @@ -1550,10 +1550,10 @@ ReflectOutput( *---------------------------------------------------------------------- */ -static Tcl_WideInt +static long long ReflectSeekWide( ClientData clientData, - Tcl_WideInt offset, + long long offset, int seekMode, int *errorCodePtr) { diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index 29c5158..b06bd45 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -39,8 +39,8 @@ static int ReflectOutput(ClientData clientData, const char *buf, int toWrite, int *errorCodePtr); static void ReflectWatch(ClientData clientData, int mask); static int ReflectBlock(ClientData clientData, int mode); -static Tcl_WideInt ReflectSeekWide(ClientData clientData, - Tcl_WideInt offset, int mode, int *errorCodePtr); +static long long ReflectSeekWide(ClientData clientData, + long long offset, int mode, int *errorCodePtr); #ifndef TCL_NO_DEPRECATED static int ReflectSeek(ClientData clientData, long offset, int mode, int *errorCodePtr); @@ -1327,10 +1327,10 @@ ReflectOutput( *---------------------------------------------------------------------- */ -static Tcl_WideInt +static long long ReflectSeekWide( ClientData clientData, - Tcl_WideInt offset, + long long offset, int seekMode, int *errorCodePtr) { diff --git a/generic/tclInt.decls b/generic/tclInt.decls index e25443d..a4ed641 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -981,7 +981,7 @@ declare 247 { declare 248 { int TclCopyChannel(Tcl_Interp *interp, Tcl_Channel inChan, - Tcl_Channel outChan, Tcl_WideInt toRead, Tcl_Obj *cmdPtr) + Tcl_Channel outChan, long long toRead, Tcl_Obj *cmdPtr) } declare 249 { diff --git a/generic/tclInt.h b/generic/tclInt.h index dbb06cd..fa2360c 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3281,19 +3281,19 @@ MODULE_SCOPE void TclFinalizeThreadDataThread(void); MODULE_SCOPE void TclFinalizeThreadStorage(void); #ifdef TCL_WIDE_CLICKS -MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void); -MODULE_SCOPE double TclpWideClicksToNanoseconds(Tcl_WideInt clicks); +MODULE_SCOPE long long TclpGetWideClicks(void); +MODULE_SCOPE double TclpWideClicksToNanoseconds(long long clicks); MODULE_SCOPE double TclpWideClickInMicrosec(void); #else # ifdef _WIN32 # define TCL_WIDE_CLICKS 1 -MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void); +MODULE_SCOPE long long TclpGetWideClicks(void); MODULE_SCOPE double TclpWideClickInMicrosec(void); # define TclpWideClicksToNanoseconds(clicks) \ ((double)(clicks) * TclpWideClickInMicrosec() * 1000) # endif #endif -MODULE_SCOPE Tcl_WideInt TclpGetMicroseconds(void); +MODULE_SCOPE long long TclpGetMicroseconds(void); MODULE_SCOPE int TclZlibInit(Tcl_Interp *interp); MODULE_SCOPE void * TclpThreadCreateKey(void); diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index 71d9f5c..1e7e26d 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -618,7 +618,7 @@ EXTERN void TclResetRewriteEnsemble(Tcl_Interp *interp, /* 248 */ EXTERN int TclCopyChannel(Tcl_Interp *interp, Tcl_Channel inChan, Tcl_Channel outChan, - Tcl_WideInt toRead, Tcl_Obj *cmdPtr); + long long toRead, Tcl_Obj *cmdPtr); /* 249 */ EXTERN char * TclDoubleDigits(double dv, int ndigits, int flags, int *decpt, int *signum, char **endPtr); @@ -916,7 +916,7 @@ typedef struct TclIntStubs { Tcl_HashTable * (*tclGetNamespaceCommandTable) (Tcl_Namespace *nsPtr); /* 245 */ int (*tclInitRewriteEnsemble) (Tcl_Interp *interp, int numRemoved, int numInserted, Tcl_Obj *const *objv); /* 246 */ void (*tclResetRewriteEnsemble) (Tcl_Interp *interp, int isRootEnsemble); /* 247 */ - int (*tclCopyChannel) (Tcl_Interp *interp, Tcl_Channel inChan, Tcl_Channel outChan, Tcl_WideInt toRead, Tcl_Obj *cmdPtr); /* 248 */ + int (*tclCopyChannel) (Tcl_Interp *interp, Tcl_Channel inChan, Tcl_Channel outChan, long long toRead, Tcl_Obj *cmdPtr); /* 248 */ char * (*tclDoubleDigits) (double dv, int ndigits, int flags, int *decpt, int *signum, char **endPtr); /* 249 */ void (*tclSetChildCancelFlags) (Tcl_Interp *interp, int flags, int force); /* 250 */ int (*tclRegisterLiteral) (void *envPtr, const char *bytes, int length, int flags); /* 251 */ diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index b5c0ca2..7c1d779 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -5251,21 +5251,21 @@ TclFormatNaN( #else union { double dv; - Tcl_WideUInt iv; + unsigned long long iv; } bitwhack; bitwhack.dv = value; if (n770_fp) { bitwhack.iv = Nokia770Twiddle(bitwhack.iv); } - if (bitwhack.iv & ((Tcl_WideUInt) 1 << 63)) { - bitwhack.iv &= ~ ((Tcl_WideUInt) 1 << 63); + if (bitwhack.iv & (1ULL << 63)) { + bitwhack.iv &= ~ (1ULL << 63); *buffer++ = '-'; } *buffer++ = 'N'; *buffer++ = 'a'; *buffer++ = 'N'; - bitwhack.iv &= (((Tcl_WideUInt) 1) << 51) - 1; + bitwhack.iv &= ((1ULL) << 51) - 1; if (bitwhack.iv != 0) { sprintf(buffer, "(%" TCL_LL_MODIFIER "x)", bitwhack.iv); } else { diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c index c484fb6..9f08d83 100644 --- a/generic/tclThreadTest.c +++ b/generic/tclThreadTest.c @@ -368,9 +368,9 @@ ThreadObjCmd( if (result == TCL_OK) { Tcl_SetIntObj(Tcl_GetObjResult(interp), status); } else { - char buf[20]; + char buf[TCL_INTEGER_SPACE]; - sprintf(buf, "%" TCL_LL_MODIFIER "d", id); + sprintf(buf, "%" TCL_LL_MODIFIER "d", (long long)id); Tcl_AppendResult(interp, "cannot join thread ", buf, NULL); } return result; diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index e84b490..572fcd5 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -228,7 +228,7 @@ typedef struct ZipFile { typedef struct ZipEntry { char *name; /* The full pathname of the virtual file */ ZipFile *zipFilePtr; /* The ZIP file holding this virtual file */ - Tcl_WideInt offset; /* Data offset into memory mapped ZIP file */ + long long offset; /* Data offset into memory mapped ZIP file */ int numBytes; /* Uncompressed size of the virtual file */ int numCompressedBytes; /* Compressed size of the virtual file */ int compressMethod; /* Compress method */ @@ -336,7 +336,7 @@ static int ZipChannelRead(void *instanceData, char *buf, static int ZipChannelSeek(void *instanceData, long offset, int mode, int *errloc); #endif -static Tcl_WideInt ZipChannelWideSeek(void *instanceData, Tcl_WideInt offset, +static long long ZipChannelWideSeek(void *instanceData, long long offset, int mode, int *errloc); static void ZipChannelWatchChannel(void *instanceData, int mask); @@ -2058,7 +2058,7 @@ ZipAddFile( const char *zpath; int crc, flush, zpathlen; size_t nbyte, nbytecompr, len, olen, align = 0; - Tcl_WideInt pos[3]; + long long pos[3]; int mtime = 0, isNew, compMeth; unsigned long keys[3], keys0[3]; char obuf[4096]; @@ -2412,7 +2412,7 @@ ZipFSMkZipOrImgObjCmd( Tcl_Channel out; int pwlen = 0, count, ret = TCL_ERROR, lobjc; size_t len, slen = 0, i = 0; - Tcl_WideInt pos[3]; + long long pos[3]; Tcl_Obj **lobjv, *list = NULL; ZipEntry *z; Tcl_HashEntry *hPtr; @@ -3444,10 +3444,10 @@ ZipChannelWrite( *------------------------------------------------------------------------- */ -static Tcl_WideInt +static long long ZipChannelWideSeek( void *instanceData, - Tcl_WideInt offset, + long long offset, int mode, int *errloc) { diff --git a/macosx/Tcl-Common.xcconfig b/macosx/Tcl-Common.xcconfig index 39301db..5193b70 100644 --- a/macosx/Tcl-Common.xcconfig +++ b/macosx/Tcl-Common.xcconfig @@ -19,7 +19,7 @@ GCC_NO_COMMON_BLOCKS = YES GCC_DYNAMIC_NO_PIC = YES GCC_VERSION = 4.2 GCC = gcc-$(GCC_VERSION) -WARNING_CFLAGS = -Wall -Wextra -Wshadow -Wwrite-strings -Wpointer-arith -Wc++-compat -Wdeclaration-after-statement -Winit-self -Wcast-align -Wdisabled-optimization -Winline $(WARNING_CFLAGS) +WARNING_CFLAGS = -Wall -Wextra -Wshadow -Wwrite-strings -Wpointer-arith -Wc++-compat -Winit-self -Wcast-align -Wdisabled-optimization -Winline $(WARNING_CFLAGS) BINDIR = $(PREFIX)/bin CFLAGS = $(CFLAGS) CPPFLAGS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) $(CPPFLAGS) diff --git a/macosx/tclMacOSXNotify.c b/macosx/tclMacOSXNotify.c index 3bf5e08..dd2b898 100644 --- a/macosx/tclMacOSXNotify.c +++ b/macosx/tclMacOSXNotify.c @@ -239,7 +239,7 @@ static OSSpinLock notifierLock = SPINLOCK_INIT; #define SpinLockLockDbg(p) \ if (!SpinLockTry(p)) { \ - Tcl_WideInt s = TclpGetWideClicks(), e; \ + long long s = TclpGetWideClicks(), e; \ \ SpinLockLock(p); \ e = TclpGetWideClicks(); \ diff --git a/unix/configure b/unix/configure index c25305e..0678188 100755 --- a/unix/configure +++ b/unix/configure @@ -5585,7 +5585,7 @@ then : *++|*++-*) ;; *) - CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers -Wdeclaration-after-statement" + CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers" ;; esac diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 95a9e10..651d5fa 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -965,7 +965,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ *++|*++-*) ;; *) - CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers -Wdeclaration-after-statement" + CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers" ;; esac diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 71ff61d..837aa59 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -133,9 +133,9 @@ static int FileSeekProc(void *instanceData, long offset, int mode, int *errorCode); #endif static int FileTruncateProc(void *instanceData, - Tcl_WideInt length); -static Tcl_WideInt FileWideSeekProc(void *instanceData, - Tcl_WideInt offset, int mode, int *errorCode); + long long length); +static long long FileWideSeekProc(void *instanceData, + long long offset, int mode, int *errorCode); static void FileWatchProc(void *instanceData, int mask); #ifdef SUPPORTS_TTY static int TtyCloseProc(void *instanceData, @@ -456,7 +456,7 @@ FileSeekProc( int *errorCodePtr) /* To store error code. */ { FileState *fsPtr = (FileState *)instanceData; - Tcl_WideInt oldLoc, newLoc; + long long oldLoc, newLoc; /* * Save our current place in case we need to roll-back the seek. @@ -509,16 +509,16 @@ FileSeekProc( *---------------------------------------------------------------------- */ -static Tcl_WideInt +static long long FileWideSeekProc( void *instanceData, /* File state. */ - Tcl_WideInt offset, /* Offset to seek to. */ + long long offset, /* Offset to seek to. */ int mode, /* Relative to where should we seek? Can be * one of SEEK_START, SEEK_CUR or SEEK_END. */ int *errorCodePtr) /* To store error code. */ { FileState *fsPtr = (FileState *)instanceData; - Tcl_WideInt newLoc; + long long newLoc; newLoc = TclOSseek(fsPtr->fd, (Tcl_SeekOffset) offset, mode); @@ -2037,7 +2037,7 @@ Tcl_GetOpenFile( static int FileTruncateProc( void *instanceData, - Tcl_WideInt length) + long long length) { FileState *fsPtr = (FileState *)instanceData; int result; diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index ead7b0c..adeacb6 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.c @@ -100,13 +100,13 @@ TclpGetSeconds(void) *---------------------------------------------------------------------- */ -Tcl_WideInt +long long TclpGetMicroseconds(void) { Tcl_Time time; tclGetTimeProcPtr(&time, tclTimeClientData); - return ((Tcl_WideInt)time.sec)*1000000 + time.usec; + return ((long long)time.sec)*1000000 + time.usec; } /* @@ -177,19 +177,19 @@ TclpGetClicks(void) *---------------------------------------------------------------------- */ -Tcl_WideInt +long long TclpGetWideClicks(void) { - Tcl_WideInt now; + long long now; if (tclGetTimeProcPtr != NativeGetTime) { Tcl_Time time; tclGetTimeProcPtr(&time, tclTimeClientData); - now = ((Tcl_WideInt)time.sec)*1000000 + time.usec; + now = ((long long)time.sec)*1000000 + time.usec; } else { #ifdef MAC_OSX_TCL - now = (Tcl_WideInt) (mach_absolute_time() & INT64_MAX); + now = (long long) (mach_absolute_time() & INT64_MAX); #else #error Wide high-resolution clicks not implemented on this platform #endif @@ -217,7 +217,7 @@ TclpGetWideClicks(void) double TclpWideClicksToNanoseconds( - Tcl_WideInt clicks) + long long clicks) { double nsec; diff --git a/win/configure b/win/configure index 0ee2d52..95d9bbb 100755 --- a/win/configure +++ b/win/configure @@ -4360,7 +4360,7 @@ printf "%s\n" "using shared flags" >&6; } CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format" ;; *) - CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers -Wdeclaration-after-statement" + CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers" ;; esac diff --git a/win/tcl.m4 b/win/tcl.m4 index fe715eb..ca26311 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -673,7 +673,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format" ;; *) - CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers -Wdeclaration-after-statement" + CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers" ;; esac diff --git a/win/tclWinChan.c b/win/tclWinChan.c index 03671f9..a4ec1ae 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -89,14 +89,14 @@ static int FileOutputProc(ClientData instanceData, static int FileSeekProc(ClientData instanceData, long offset, int mode, int *errorCode); #endif -static Tcl_WideInt FileWideSeekProc(ClientData instanceData, - Tcl_WideInt offset, int mode, int *errorCode); +static long long FileWideSeekProc(ClientData instanceData, + long long offset, int mode, int *errorCode); static void FileSetupProc(ClientData clientData, int flags); static void FileWatchProc(ClientData instanceData, int mask); static void FileThreadActionProc(ClientData instanceData, int action); static int FileTruncateProc(ClientData instanceData, - Tcl_WideInt length); + long long length); static DWORD FileGetType(HANDLE handle); static int NativeIsComPort(const WCHAR *nativeName); @@ -546,10 +546,10 @@ FileSeekProc( *---------------------------------------------------------------------- */ -static Tcl_WideInt +static long long FileWideSeekProc( ClientData instanceData, /* File state. */ - Tcl_WideInt offset, /* Offset to seek to. */ + long long offset, /* Offset to seek to. */ int mode, /* Relative to where should we seek? */ int *errorCodePtr) /* To store error code. */ { @@ -578,8 +578,8 @@ FileWideSeekProc( return -1; } } - return (((Tcl_WideInt)((unsigned)newPos)) - | ((Tcl_WideInt)newPosHigh << 32)); + return (((long long)((unsigned)newPos)) + | ((long long)newPosHigh << 32)); } /* @@ -601,7 +601,7 @@ FileWideSeekProc( static int FileTruncateProc( ClientData instanceData, /* File state. */ - Tcl_WideInt length) /* Length to truncate at. */ + long long length) /* Length to truncate at. */ { FileInfo *infoPtr = (FileInfo *)instanceData; LONG newPos, newPosHigh, oldPos, oldPosHigh; diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 953259d..f89b522 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -29,7 +29,7 @@ */ #define POSIX_EPOCH_AS_FILETIME \ - ((Tcl_WideInt) 116444736 * (Tcl_WideInt) 1000000000) + ((long long) 116444736 * (long long) 1000000000) /* * Declarations for 'link' related information. This information should come @@ -2102,8 +2102,8 @@ NativeStat( statPtr->st_ctime = ToCTime(data.ftCreationTime); } attr = data.dwFileAttributes; - statPtr->st_size = ((Tcl_WideInt) data.nFileSizeLow) | - (((Tcl_WideInt) data.nFileSizeHigh) << 32); + statPtr->st_size = ((long long) data.nFileSizeLow) | + (((long long) data.nFileSizeHigh) << 32); /* * On Unix, for directories, nlink apparently depends on the number of @@ -2150,8 +2150,8 @@ NativeStat( attr = data.dwFileAttributes; - statPtr->st_size = ((Tcl_WideInt) data.nFileSizeLow) | - (((Tcl_WideInt) data.nFileSizeHigh) << 32); + statPtr->st_size = ((long long) data.nFileSizeLow) | + (((long long) data.nFileSizeHigh) << 32); statPtr->st_atime = ToCTime(data.ftLastAccessTime); statPtr->st_mtime = ToCTime(data.ftLastWriteTime); statPtr->st_ctime = ToCTime(data.ftCreationTime); @@ -2313,7 +2313,7 @@ ToCTime( convertedTime.HighPart = (LONG) fileTime.dwHighDateTime; return (time_t) ((convertedTime.QuadPart - - (Tcl_WideInt) POSIX_EPOCH_AS_FILETIME) / (Tcl_WideInt) 10000000); + (long long) POSIX_EPOCH_AS_FILETIME) / (long long) 10000000); } /* diff --git a/win/tclWinTime.c b/win/tclWinTime.c index 088c02b..64890c4 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.c @@ -83,9 +83,9 @@ typedef struct { * Data used in developing the estimate of performance counter frequency */ - Tcl_WideUInt fileTimeSample[SAMPLES]; + unsigned long long fileTimeSample[SAMPLES]; /* Last 64 samples of system time. */ - Tcl_WideInt perfCounterSample[SAMPLES]; + long long perfCounterSample[SAMPLES]; /* Last 64 samples of performance counter. */ int sampleNo; /* Current sample number. */ } TimeInfo; @@ -99,11 +99,11 @@ static TimeInfo timeInfo = { (HANDLE) NULL, (HANDLE) NULL, #if defined(HAVE_CAST_TO_UNION) && !defined(__cplusplus) - (LARGE_INTEGER) (Tcl_WideInt) 0, + (LARGE_INTEGER) (long long) 0, (ULARGE_INTEGER) (DWORDLONG) 0, - (LARGE_INTEGER) (Tcl_WideInt) 0, - (LARGE_INTEGER) (Tcl_WideInt) 0, - (LARGE_INTEGER) (Tcl_WideInt) 0, + (LARGE_INTEGER) (long long) 0, + (LARGE_INTEGER) (long long) 0, + (LARGE_INTEGER) (long long) 0, #else {0, 0}, {0, 0}, @@ -137,13 +137,13 @@ static struct tm * ComputeGMT(const time_t *tp); static void StopCalibration(ClientData clientData); static DWORD WINAPI CalibrationThread(LPVOID arg); static void UpdateTimeEachSecond(void); -static void ResetCounterSamples(Tcl_WideUInt fileTime, - Tcl_WideInt perfCounter, Tcl_WideInt perfFreq); -static Tcl_WideInt AccumulateSample(Tcl_WideInt perfCounter, - Tcl_WideUInt fileTime); +static void ResetCounterSamples(unsigned long long fileTime, + long long perfCounter, long long perfFreq); +static long long AccumulateSample(long long perfCounter, + unsigned long long fileTime); static void NativeScaleTime(Tcl_Time* timebuf, ClientData clientData); -static Tcl_WideInt NativeGetMicroseconds(void); +static long long NativeGetMicroseconds(void); static void NativeGetTime(Tcl_Time* timebuf, ClientData clientData); @@ -175,7 +175,7 @@ ClientData tclTimeClientData = NULL; unsigned long TclpGetSeconds(void) { - Tcl_WideInt usecSincePosixEpoch; + long long usecSincePosixEpoch; /* Try to use high resolution timer */ if ( tclGetTimeProcPtr == NativeGetTime @@ -212,7 +212,7 @@ TclpGetSeconds(void) unsigned long TclpGetClicks(void) { - Tcl_WideInt usecSincePosixEpoch; + long long usecSincePosixEpoch; /* Try to use high resolution timer */ if ( tclGetTimeProcPtr == NativeGetTime @@ -251,7 +251,7 @@ TclpGetClicks(void) *---------------------------------------------------------------------- */ -Tcl_WideInt +long long TclpGetWideClicks(void) { LARGE_INTEGER curCounter; @@ -277,7 +277,7 @@ TclpGetWideClicks(void) } if (wideClick.perfCounter) { if (QueryPerformanceCounter(&curCounter)) { - return (Tcl_WideInt)curCounter.QuadPart; + return (long long)curCounter.QuadPart; } /* fallback using microseconds */ wideClick.perfCounter = 0; @@ -332,10 +332,10 @@ TclpWideClickInMicrosec(void) *---------------------------------------------------------------------- */ -Tcl_WideInt +long long TclpGetMicroseconds(void) { - Tcl_WideInt usecSincePosixEpoch; + long long usecSincePosixEpoch; /* Try to use high resolution timer */ if ( tclGetTimeProcPtr == NativeGetTime @@ -351,7 +351,7 @@ TclpGetMicroseconds(void) Tcl_Time now; tclGetTimeProcPtr(&now, tclTimeClientData); /* Tcl_GetTime inlined */ - return (((Tcl_WideInt)now.sec) * 1000000) + now.usec; + return (((long long)now.sec) * 1000000) + now.usec; } } @@ -381,7 +381,7 @@ void Tcl_GetTime( Tcl_Time *timePtr) /* Location to store time information. */ { - Tcl_WideInt usecSincePosixEpoch; + long long usecSincePosixEpoch; /* Try to use high resolution timer */ if ( tclGetTimeProcPtr == NativeGetTime @@ -444,7 +444,7 @@ NativeScaleTime( *---------------------------------------------------------------------- */ -static inline Tcl_WideInt +static inline long long NativeCalc100NsTicks( ULONGLONG fileTimeLastCall, LONGLONG perfCounterLastCall, @@ -455,7 +455,7 @@ NativeCalc100NsTicks( ((curCounter - perfCounterLastCall) * 10000000 / curCounterFreq); } -static Tcl_WideInt +static long long NativeGetMicroseconds(void) { /* @@ -507,10 +507,10 @@ NativeGetMicroseconds(void) /* * The following lines would do an exact match on crystal * frequency: - * && timeInfo.nominalFreq.QuadPart != (Tcl_WideInt)1193182 - * && timeInfo.nominalFreq.QuadPart != (Tcl_WideInt)3579545 + * && timeInfo.nominalFreq.QuadPart != (long long)1193182 + * && timeInfo.nominalFreq.QuadPart != (long long)3579545 */ - && timeInfo.nominalFreq.QuadPart > (Tcl_WideInt) 15000000){ + && timeInfo.nominalFreq.QuadPart > (long long) 15000000){ /* * As an exception, if every logical processor on the system * is on the same chip, we use the performance counter anyway, @@ -651,7 +651,7 @@ NativeGetTime( Tcl_Time *timePtr, TCL_UNUSED(ClientData)) { - Tcl_WideInt usecSincePosixEpoch; + long long usecSincePosixEpoch; /* * Try to use high resolution timer. @@ -1033,12 +1033,12 @@ UpdateTimeEachSecond(void) static LARGE_INTEGER lastFileTime; /* File time of the previous calibration */ LARGE_INTEGER curFileTime; /* File time at the time this callback was * scheduled. */ - Tcl_WideInt estFreq; /* Estimated perf counter frequency. */ - Tcl_WideInt vt0; /* Tcl time right now. */ - Tcl_WideInt vt1; /* Tcl time one second from now. */ - Tcl_WideInt tdiff; /* Difference between system clock and Tcl + long long estFreq; /* Estimated perf counter frequency. */ + long long vt0; /* Tcl time right now. */ + long long vt1; /* Tcl time one second from now. */ + long long tdiff; /* Difference between system clock and Tcl * time. */ - Tcl_WideInt driftFreq; /* Frequency needed to drift virtual time into + long long driftFreq; /* Frequency needed to drift virtual time into * step over 1 second. */ /* @@ -1090,7 +1090,7 @@ UpdateTimeEachSecond(void) */ estFreq = AccumulateSample(curPerfCounter.QuadPart, - (Tcl_WideUInt) curFileTime.QuadPart); + (unsigned long long) curFileTime.QuadPart); /* * We want to adjust things so that time appears to be continuous. @@ -1155,7 +1155,7 @@ UpdateTimeEachSecond(void) * new calibrated values) and do a small adjustment (short time freeze) */ LARGE_INTEGER newPerfCounter; - Tcl_WideInt nt0, nt1; + long long nt0, nt1; QueryPerformanceCounter(&newPerfCounter); nt0 = NativeCalc100NsTicks(timeInfo.fileTimeLastCall.QuadPart, @@ -1215,9 +1215,9 @@ UpdateTimeEachSecond(void) static void ResetCounterSamples( - Tcl_WideUInt fileTime, /* Current file time */ - Tcl_WideInt perfCounter, /* Current performance counter */ - Tcl_WideInt perfFreq) /* Target performance frequency */ + unsigned long long fileTime, /* Current file time */ + long long perfCounter, /* Current performance counter */ + long long perfFreq) /* Target performance frequency */ { int i; for (i=SAMPLES-1 ; i>=0 ; --i) { @@ -1255,20 +1255,20 @@ ResetCounterSamples( * case). */ -static Tcl_WideInt +static long long AccumulateSample( - Tcl_WideInt perfCounter, - Tcl_WideUInt fileTime) + long long perfCounter, + unsigned long long fileTime) { - Tcl_WideUInt workFTSample; /* File time sample being removed from or + unsigned long long workFTSample; /* File time sample being removed from or * added to the circular buffer. */ - Tcl_WideInt workPCSample; /* Performance counter sample being removed + long long workPCSample; /* Performance counter sample being removed * from or added to the circular buffer. */ - Tcl_WideUInt lastFTSample; /* Last file time sample recorded */ - Tcl_WideInt lastPCSample; /* Last performance counter sample recorded */ - Tcl_WideInt FTdiff; /* Difference between last FT and current */ - Tcl_WideInt PCdiff; /* Difference between last PC and current */ - Tcl_WideInt estFreq; /* Estimated performance counter frequency */ + unsigned long long lastFTSample; /* Last file time sample recorded */ + long long lastPCSample; /* Last performance counter sample recorded */ + long long FTdiff; /* Difference between last FT and current */ + long long PCdiff; /* Difference between last PC and current */ + long long estFreq; /* Estimated performance counter frequency */ /* * Test for jumps and reset the samples if we have one. @@ -1302,7 +1302,7 @@ AccumulateSample( estFreq = 10000000 * (perfCounter - workPCSample) / (fileTime - workFTSample); timeInfo.perfCounterSample[timeInfo.sampleNo] = perfCounter; - timeInfo.fileTimeSample[timeInfo.sampleNo] = (Tcl_WideInt) fileTime; + timeInfo.fileTimeSample[timeInfo.sampleNo] = (long long) fileTime; /* * Advance the sample number. -- cgit v0.12