summaryrefslogtreecommitdiffstats
path: root/win/tclWinTime.c
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2005-11-03 00:17:30 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2005-11-03 00:17:30 (GMT)
commit2ac3a08a98a293de62ed6ae01aa7a7d139660207 (patch)
tree86fab92b7dc7b1f3c9f8d9b9a0ead95a215fd1cd /win/tclWinTime.c
parent4299352915cf05025553108f48b7bf58f48a8353 (diff)
downloadtcl-2ac3a08a98a293de62ed6ae01aa7a7d139660207.zip
tcl-2ac3a08a98a293de62ed6ae01aa7a7d139660207.tar.gz
tcl-2ac3a08a98a293de62ed6ae01aa7a7d139660207.tar.bz2
Applied patch #1096916 to support building with MSVC 8.
* generic/regerror.c: Avoid use of reserved word. * generic/tcl.h: Select the right Tcl_Stat structure * generic/tclDate.c: Casts to handle 64 bit time_t case. * tests/env.test: Include essential envvar on Win32 * win/nmakehlp.c: Handle new return codes. * win/makefile.vc: Use the selected options. * win/rules.vc: Check options are applicable * win/tclWinPort.h: Disable deprecated function warnings * win/tclWinSock.c: Provide default value to avoid warning. * win/tclWinTime.c: Add casts to handle 64bit time_t type.
Diffstat (limited to 'win/tclWinTime.c')
-rw-r--r--win/tclWinTime.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/win/tclWinTime.c b/win/tclWinTime.c
index fc91e2b..0b8ebfa 100644
--- a/win/tclWinTime.c
+++ b/win/tclWinTime.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: tclWinTime.c,v 1.31 2005/07/24 22:56:51 dkf Exp $
+ * RCS: @(#) $Id: tclWinTime.c,v 1.32 2005/11/03 00:17:31 patthoyts Exp $
*/
#include "tclInt.h"
@@ -464,7 +464,7 @@ NativeGetTime(timePtr, clientData)
timeInfo.fileTimeLastCall.QuadPart = curFileTime;
timeInfo.perfCounterLastCall.QuadPart = curCounter.QuadPart;
usecSincePosixEpoch = (curFileTime - posixEpoch.QuadPart) / 10;
- timePtr->sec = (time_t) (usecSincePosixEpoch / 1000000);
+ timePtr->sec = (long) (usecSincePosixEpoch / 1000000);
timePtr->usec = (unsigned long) (usecSincePosixEpoch % 1000000);
useFtime = 0;
}
@@ -478,7 +478,7 @@ NativeGetTime(timePtr, clientData)
*/
ftime(&t);
- timePtr->sec = t.time;
+ timePtr->sec = (long)t.time;
timePtr->usec = t.millitm * 1000;
}
}
@@ -701,9 +701,9 @@ TclpGetDate(t, useGMT)
}
time /= 24;
- tmPtr->tm_mday += time;
- tmPtr->tm_yday += time;
- tmPtr->tm_wday = (tmPtr->tm_wday + time) % 7;
+ tmPtr->tm_mday += (int)time;
+ tmPtr->tm_yday += (int)time;
+ tmPtr->tm_wday = (tmPtr->tm_wday + (int)time) % 7;
}
} else {
tmPtr = ComputeGMT(t);
@@ -744,8 +744,8 @@ ComputeGMT(tp)
* Compute the 4 year span containing the specified time.
*/
- tmp = *tp / SECSPER4YEAR;
- rem = *tp % SECSPER4YEAR;
+ tmp = (long)(*tp / SECSPER4YEAR);
+ rem = (long)(*tp % SECSPER4YEAR);
/*
* Correct for weird mod semantics so the remainder is always positive.
@@ -812,7 +812,7 @@ ComputeGMT(tp)
* Compute day of week. Epoch started on a Thursday.
*/
- tmPtr->tm_wday = (*tp / SECSPERDAY) + 4;
+ tmPtr->tm_wday = (long)(*tp / SECSPERDAY) + 4;
if ((*tp % SECSPERDAY) < 0) {
tmPtr->tm_wday--;
}