diff options
author | Kevin B Kenny <kennykb@acm.org> | 2004-05-17 14:26:31 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2004-05-17 14:26:31 (GMT) |
commit | 02328b407284a12dc2109146c3f29cae15d45a28 (patch) | |
tree | 636791149a751acb57bd43a77003dc5fe427a49f /unix | |
parent | aeeb2dda569d75a5f5162a97de263878e7136478 (diff) | |
download | tcl-02328b407284a12dc2109146c3f29cae15d45a28.zip tcl-02328b407284a12dc2109146c3f29cae15d45a28.tar.gz tcl-02328b407284a12dc2109146c3f29cae15d45a28.tar.bz2 |
* generic/tclInt.decls: Restored TclpTime_t kludge to all
* generic/tclIntPlatDecls.h: places where it appeared before the
* unix/tclUnixPort.h changes of 14 May, because use of
* unix/tclUnixTime.h native time_t in its place requires
* win/tclWinTime.h: the 8.5 header reforms. [Bug #955146]
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixPort.h | 6 | ||||
-rw-r--r-- | unix/tclUnixTime.c | 35 |
2 files changed, 21 insertions, 20 deletions
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index c183985..0c1d9b7 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -19,7 +19,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixPort.h,v 1.27.2.3 2004/05/14 21:41:12 kennykb Exp $ + * RCS: @(#) $Id: tclUnixPort.h,v 1.27.2.4 2004/05/17 14:26:50 kennykb Exp $ */ #ifndef _TCLUNIXPORT @@ -565,10 +565,10 @@ EXTERN void TclpMutexLock _ANSI_ARGS_((TclpMutex *mPtr)); EXTERN void TclpMutexUnlock _ANSI_ARGS_((TclpMutex *mPtr)); EXTERN Tcl_DirEntry * TclpReaddir(DIR *); #ifndef TclpLocaltime -EXTERN struct tm * TclpLocaltime(CONST time_t *); +EXTERN struct tm * TclpLocaltime(CONST TclpTime_t); #endif #ifndef TclpGmtime -EXTERN struct tm * TclpGmtime(CONST time_t *); +EXTERN struct tm * TclpGmtime(CONST TclpTime_t); #endif EXTERN char * TclpInetNtoa(struct in_addr); #define readdir(x) TclpReaddir(x) diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index 4f99801..47492e9 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.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: tclUnixTime.c,v 1.15.2.1 2004/05/14 21:41:12 kennykb Exp $ + * RCS: @(#) $Id: tclUnixTime.c,v 1.15.2.2 2004/05/17 14:26:50 kennykb Exp $ */ #include "tclInt.h" @@ -149,7 +149,7 @@ TclpGetTimeZone (currentTime) /* Struct tm contains tm_tzadj - that value may be used. */ time_t curTime = (time_t) currentTime; - struct tm *timeDataPtr = TclpLocaltime(&curTime); + struct tm *timeDataPtr = TclpLocaltime((TclpTime_t) &curTime); int timeZone; timeZone = timeDataPtr->tm_tzadj / 60; @@ -167,7 +167,7 @@ TclpGetTimeZone (currentTime) /* Struct tm contains tm_gmtoff - that value may be used. */ time_t curTime = (time_t) currentTime; - struct tm *timeDataPtr = TclpLocaltime(&curTime); + struct tm *timeDataPtr = TclpLocaltime((TclpTime_t) &curTime); int timeZone; timeZone = -(timeDataPtr->tm_gmtoff / 60); @@ -208,7 +208,7 @@ TclpGetTimeZone (currentTime) time_t tt; struct tm *stm; tt = 849268800L; /* 1996-11-29 12:00:00 GMT */ - stm = TclpLocaltime(&tt); /* eg 1996-11-29 6:00:00 CST6CDT */ + stm = TclpLocaltime((TclpTime_t) &tt); /* eg 1996-11-29 6:00:00 CST6CDT */ /* The calculation below assumes a max of +12 or -12 hours from GMT */ timeZone = (12 - stm->tm_hour)*60 + (0 - stm->tm_min); if ( stm -> tm_isdst ) { @@ -280,12 +280,10 @@ TclpGetDate(time, useGMT) TclpTime_t time; int useGMT; { - CONST time_t *tp = (CONST time_t *)time; - if (useGMT) { - return TclpGmtime(tp); + return TclpGmtime(time); } else { - return TclpLocaltime(tp); + return TclpLocaltime(time); } } @@ -345,11 +343,13 @@ TclpStrftime(s, maxsize, format, t, useGMT) */ struct tm * -TclpGmtime( timePtr ) - CONST time_t *timePtr; /* Pointer to the number of seconds +TclpGmtime( tt ) + TclpTime_t tt; +{ + CONST time_t *timePtr = (CONST time_t *) tt; + /* Pointer to the number of seconds * since the local system's epoch */ -{ /* * Get a thread-local buffer to hold the returned time. */ @@ -371,7 +371,7 @@ TclpGmtime( timePtr ) */ struct tm* TclpGmtime_unix( timePtr ) - CONST time_t* timePtr; + TclpTime_t timePtr; { return TclpGmtime( timePtr ); } @@ -394,11 +394,12 @@ TclpGmtime_unix( timePtr ) */ struct tm * -TclpLocaltime(timePtr) - CONST time_t *timePtr; /* Pointer to the number of seconds - * since the local system's epoch */ - +TclpLocaltime( tt ) + TclpTime_t tt; { + CONST time_t *timePtr = (CONST time_t *) tt; + /* Pointer to the number of seconds + * since the local system's epoch */ /* * Get a thread-local buffer to hold the returned time. */ @@ -421,7 +422,7 @@ TclpLocaltime(timePtr) */ struct tm* TclpLocaltime_unix( timePtr ) - CONST time_t* timePtr; + TclpTime_t timePtr; { return TclpLocaltime( timePtr ); } |