Tcl Source Code

Artifact [653f65585b]
Login

Artifact 653f65585bc92bef4997dec499d8590e88462e83:

Attachment "721196.patch" to ticket [721196ffff] added by kennykb 2003-04-15 06:15:35.
Index: win/tclWinTime.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWinTime.c,v
retrieving revision 1.16
diff -u -u -r1.16 tclWinTime.c
--- win/tclWinTime.c	14 Apr 2003 02:36:58 -0000	1.16
+++ win/tclWinTime.c	14 Apr 2003 22:55:36 -0000
@@ -89,9 +89,9 @@
      * Data used in developing the estimate of performance counter
      * frequency
      */
-    ULONGLONG fileTimeSample[SAMPLES];
+    Tcl_WideUInt fileTimeSample[SAMPLES];
 				/* Last 64 samples of system time */
-    LONGLONG perfCounterSample[SAMPLES];
+    Tcl_WideInt perfCounterSample[SAMPLES];
 				/* Last 64 samples of performance counter */
     int sampleNo;		/* Current sample number */
 
@@ -106,10 +106,10 @@
     (HANDLE) NULL,
     (HANDLE) NULL,
 #ifdef HAVE_CAST_TO_UNION
-    (LARGE_INTEGER) (LONGLONG) 0,
+    (LARGE_INTEGER) (Tcl_WideInt) 0,
     (ULARGE_INTEGER) (DWORDLONG) 0,
-    (LARGE_INTEGER) (LONGLONG) 0,
-    (LARGE_INTEGER) (LONGLONG) 0,
+    (LARGE_INTEGER) (Tcl_WideInt) 0,
+    (LARGE_INTEGER) (Tcl_WideInt) 0,
 #else
     0,
     0,
@@ -132,13 +132,13 @@
 static DWORD WINAPI     CalibrationThread _ANSI_ARGS_(( LPVOID arg ));
 static void 		UpdateTimeEachSecond _ANSI_ARGS_(( void ));
 static void		ResetCounterSamples _ANSI_ARGS_((
-			    ULONGLONG fileTime, 
-                            LONGLONG perfCounter,
-			    LONGLONG perfFreq
+			    Tcl_WideUInt fileTime, 
+                            Tcl_WideInt perfCounter,
+			    Tcl_WideInt perfFreq
 			));
-static LONGLONG		AccumulateSample _ANSI_ARGS_((
-			    LONGLONG perfCounter,
-			    ULONGLONG fileTime
+static Tcl_WideInt		AccumulateSample _ANSI_ARGS_((
+			    Tcl_WideInt perfCounter,
+			    Tcl_WideUInt fileTime
 			));
 
 /*
@@ -307,10 +307,10 @@
 	    if ( timeInfo.perfCounterAvailable
 		 /* The following lines would do an exact match on
 		  * crystal frequency:
-		  * && timeInfo.nominalFreq.QuadPart != (LONGLONG) 1193182
-		  * && timeInfo.nominalFreq.QuadPart != (LONGLONG) 3579545
+		  * && timeInfo.nominalFreq.QuadPart != (Tcl_WideInt) 1193182
+		  * && timeInfo.nominalFreq.QuadPart != (Tcl_WideInt) 3579545
 		  */
-		 && timeInfo.nominalFreq.QuadPart > (LONGLONG) 15000000 ) {
+		 && timeInfo.nominalFreq.QuadPart > (Tcl_WideInt) 15000000 ) {
 		timeInfo.perfCounterAvailable = FALSE;
 	    }
 
@@ -358,7 +358,7 @@
 	LARGE_INTEGER curCounter;
 				/* Current performance counter */
 
-	LONGLONG curFileTime;
+	Tcl_WideInt curFileTime;
 				/* Current estimated time, expressed
 				 * as 100-ns ticks since the Windows epoch */
 
@@ -366,7 +366,7 @@
 				/* Posix epoch expressed as 100-ns ticks
 				 * since the windows epoch */
 
-	LONGLONG usecSincePosixEpoch;
+	Tcl_WideInt usecSincePosixEpoch;
 				/* Current microseconds since Posix epoch */
 
 	posixEpoch.LowPart = 0xD53E8000;
@@ -832,15 +832,15 @@
     LARGE_INTEGER curFileTime;	/* File time at the time this callback
 				 * was scheduled. */
 
-    LONGLONG estFreq;		/* Estimated perf counter frequency */
+    Tcl_WideInt estFreq;	/* Estimated perf counter frequency */
 
-    LONGLONG vt0;		/* Tcl time right now */
-    LONGLONG vt1;		/* Tcl time one second from now */
+    Tcl_WideInt vt0;		/* Tcl time right now */
+    Tcl_WideInt vt1;		/* Tcl time one second from now */
 
-    LONGLONG tdiff;		/* Difference between system clock and
+    Tcl_WideInt tdiff;		/* Difference between system clock and
 				 * Tcl time. */
 
-    LONGLONG driftFreq;		/* Frequency needed to drift virtual time
+    Tcl_WideInt driftFreq;	/* Frequency needed to drift virtual time
 				 * into step over 1 second */
 
     /*
@@ -873,7 +873,7 @@
      */
 
     estFreq = AccumulateSample( curPerfCounter.QuadPart,
-				(ULONGLONG) curFileTime.QuadPart );
+				(Tcl_WideUInt) curFileTime.QuadPart );
 
     /*
      * We want to adjust things so that time appears to be continuous.
@@ -947,11 +947,11 @@
  */
 
 static void
-ResetCounterSamples( ULONGLONG fileTime,
+ResetCounterSamples( Tcl_WideUInt fileTime,
 				/* Current file time */
-		     LONGLONG perfCounter,
+		     Tcl_WideInt perfCounter,
 				/* Current performance counter */
-		     LONGLONG perfFreq )
+		     Tcl_WideInt perfFreq )
 				/* Target performance frequency */
 {
     int i;
@@ -991,26 +991,26 @@
  * probably run slow in the first case).
  */
 
-static LONGLONG
-AccumulateSample( LONGLONG perfCounter,
-		  ULONGLONG fileTime )
+static Tcl_WideInt
+AccumulateSample( Tcl_WideInt perfCounter,
+		  Tcl_WideUInt fileTime )
 {
-    ULONGLONG workFTSample;	/* File time sample being removed
+    Tcl_WideUInt workFTSample;	/* File time sample being removed
 				 * from or added to the circular buffer */
 
-    LONGLONG workPCSample;	/* Performance counter sample being
+    Tcl_WideInt workPCSample;	/* Performance counter sample being
 				 * removed from or added to the circular 
 				 * buffer */
 
-    ULONGLONG lastFTSample;	/* Last file time sample recorded */
+    Tcl_WideUInt lastFTSample;	/* Last file time sample recorded */
 
-    LONGLONG lastPCSample;	/* Last performance counter sample recorded */
+    Tcl_WideInt lastPCSample;	/* Last performance counter sample recorded */
 
-    LONGLONG FTdiff;		/* Difference between last FT and current */
+    Tcl_WideInt FTdiff;		/* Difference between last FT and current */
 
-    LONGLONG PCdiff;		/* Difference between last PC and current */
+    Tcl_WideInt PCdiff;		/* Difference between last PC and current */
 
-    LONGLONG estFreq;		/* Estimated performance counter frequency */
+    Tcl_WideInt estFreq;	/* Estimated performance counter frequency */
 
     /* Test for jumps and reset the samples if we have one. */
 
@@ -1042,7 +1042,7 @@
 	estFreq = 10000000 * ( perfCounter - workPCSample )
 	    / ( fileTime - workFTSample );
 	timeInfo.perfCounterSample[ timeInfo.sampleNo ] = perfCounter;
-	timeInfo.fileTimeSample[ timeInfo.sampleNo ] = (LONGLONG) fileTime;
+	timeInfo.fileTimeSample[ timeInfo.sampleNo ] = (Tcl_WideInt) fileTime;
 	
 	/* Advance the sample number */