From 767d68ec6d958a72ef767196d7efbd8d9b9f387d Mon Sep 17 00:00:00 2001 From: rmax Date: Thu, 18 Mar 2004 18:50:40 +0000 Subject: * generic/tclIntDecls.h: Removed TclpTime_t. It wasn't really needed, * generic/tclInt.h: but caused warnings related to * generic/tclInt.decls: strict aliasing with GCC 3.3. * generic/tclClock.c: * generic/tclDate.c: * generic/tclGetDate.y: * win/tclWinTime.c: * unix/tclUnixTime.c: --- generic/tclClock.c | 4 ++-- generic/tclDate.c | 15 +++++++-------- generic/tclGetDate.y | 16 ++++++++-------- generic/tclInt.decls | 4 ++-- generic/tclInt.h | 8 +------- generic/tclIntDecls.h | 6 +++--- 6 files changed, 23 insertions(+), 30 deletions(-) diff --git a/generic/tclClock.c b/generic/tclClock.c index 25e3d62..82d4f1f 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclClock.c,v 1.24 2003/10/30 22:46:42 dkf Exp $ + * RCS: @(#) $Id: tclClock.c,v 1.25 2004/03/18 18:50:40 rmax Exp $ */ #include "tcl.h" @@ -323,7 +323,7 @@ FormatClock(interp, clockVal, useGMT, format) #endif tclockVal = clockVal; - timeDataPtr = TclpGetDate((TclpTime_t) &tclockVal, useGMT); + timeDataPtr = TclpGetDate(&tclockVal, useGMT); /* * Make a guess at the upper limit on the substituted string size diff --git a/generic/tclDate.c b/generic/tclDate.c index 8b2c379..bd923f1 100644 --- a/generic/tclDate.c +++ b/generic/tclDate.c @@ -42,7 +42,6 @@ typedef struct _TABLE { time_t value; } TABLE; - /* * Daylight-savings mode: on, off, or not yet known. */ @@ -566,7 +565,7 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode, TimePtr) /* Perform a preliminary DST compensation ?? */ if (DSTmode == DSTon - || (DSTmode == DSTmaybe && TclpGetDate((TclpTime_t)&Julian, 0)->tm_isdst)) + || (DSTmode == DSTmaybe && TclpGetDate(&Julian, 0)->tm_isdst)) Julian -= 60 * 60; *TimePtr = Julian; return 0; @@ -580,8 +579,8 @@ DSTcorrect(Start, Future) { time_t StartDay; time_t FutureDay; - StartDay = (TclpGetDate((TclpTime_t)&Start, 0)->tm_hour + 1) % 24; - FutureDay = (TclpGetDate((TclpTime_t)&Future, 0)->tm_hour + 1) % 24; + StartDay = (TclpGetDate(&Start, 0)->tm_hour + 1) % 24; + FutureDay = (TclpGetDate(&Future, 0)->tm_hour + 1) % 24; return (Future - Start) + (StartDay - FutureDay) * 60L * 60L; } @@ -596,7 +595,7 @@ NamedDay(Start, DayOrdinal, DayNumber) time_t now; now = Start; - tm = TclpGetDate((TclpTime_t)&now, 0); + tm = TclpGetDate(&now, 0); now += SECSPERDAY * ((DayNumber - tm->tm_wday + 7) % 7); now += 7 * SECSPERDAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1); return DSTcorrect(Start, now); @@ -613,7 +612,7 @@ NamedMonth(Start, MonthOrdinal, MonthNumber) int result; now = Start; - tm = TclpGetDate((TclpTime_t)&now, 0); + tm = TclpGetDate(&now, 0); /* To compute the next n'th month, we use this alg: * add n to year value * if currentMonth < requestedMonth decrement year value by 1 (so that @@ -648,7 +647,7 @@ RelativeMonth(Start, RelMonth, TimePtr) *TimePtr = 0; return 0; } - tm = TclpGetDate((TclpTime_t)&Start, 0); + tm = TclpGetDate(&Start, 0); Month = 12 * (tm->tm_year + TM_YEAR_BASE) + tm->tm_mon + RelMonth; Year = Month / 12; Month = Month % 12 + 1; @@ -921,7 +920,7 @@ TclGetDate(p, now, zone, timePtr) TclDateInput = p; /* now has to be cast to a time_t for 64bit compliance */ Start = now; - tm = TclpGetDate((TclpTime_t) &Start, (zone == -50000)); + tm = TclpGetDate(&Start, (zone == -50000)); thisyear = tm->tm_year + TM_YEAR_BASE; TclDateYear = thisyear; TclDateMonth = tm->tm_mon + 1; diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y index 924390e..1a8ed83 100644 --- a/generic/tclGetDate.y +++ b/generic/tclGetDate.y @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclGetDate.y,v 1.21 2004/03/17 18:14:13 das Exp $ + * RCS: @(#) $Id: tclGetDate.y,v 1.22 2004/03/18 18:51:12 rmax Exp $ */ %{ @@ -785,7 +785,7 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode, TimePtr) /* Perform a preliminary DST compensation ?? */ if (DSTmode == DSTon - || (DSTmode == DSTmaybe && TclpGetDate((TclpTime_t)&Julian, 0)->tm_isdst)) + || (DSTmode == DSTmaybe && TclpGetDate(Julian, 0)->tm_isdst)) Julian -= 60 * 60; *TimePtr = Julian; return 0; @@ -799,8 +799,8 @@ DSTcorrect(Start, Future) { time_t StartDay; time_t FutureDay; - StartDay = (TclpGetDate((TclpTime_t)&Start, 0)->tm_hour + 1) % 24; - FutureDay = (TclpGetDate((TclpTime_t)&Future, 0)->tm_hour + 1) % 24; + StartDay = (TclpGetDate(Start, 0)->tm_hour + 1) % 24; + FutureDay = (TclpGetDate(Future, 0)->tm_hour + 1) % 24; return (Future - Start) + (StartDay - FutureDay) * 60L * 60L; } @@ -815,7 +815,7 @@ NamedDay(Start, DayOrdinal, DayNumber) time_t now; now = Start; - tm = TclpGetDate((TclpTime_t)&now, 0); + tm = TclpGetDate(now, 0); now += SECSPERDAY * ((DayNumber - tm->tm_wday + 7) % 7); now += 7 * SECSPERDAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1); return DSTcorrect(Start, now); @@ -832,7 +832,7 @@ NamedMonth(Start, MonthOrdinal, MonthNumber) int result; now = Start; - tm = TclpGetDate((TclpTime_t)&now, 0); + tm = TclpGetDate(now, 0); /* To compute the next n'th month, we use this alg: * add n to year value * if currentMonth < requestedMonth decrement year value by 1 (so that @@ -867,7 +867,7 @@ RelativeMonth(Start, RelMonth, TimePtr) *TimePtr = 0; return 0; } - tm = TclpGetDate((TclpTime_t)&Start, 0); + tm = TclpGetDate(Start, 0); Month = 12 * (tm->tm_year + TM_YEAR_BASE) + tm->tm_mon + RelMonth; Year = Month / 12; Month = Month % 12 + 1; @@ -1140,7 +1140,7 @@ TclGetDate(p, now, zone, timePtr) yyInput = p; /* now has to be cast to a time_t for 64bit compliance */ Start = now; - tm = TclpGetDate((TclpTime_t) &Start, (zone == -50000)); + tm = TclpGetDate(Start, (zone == -50000)); thisyear = tm->tm_year + TM_YEAR_BASE; yyYear = thisyear; yyMonth = tm->tm_mon + 1; diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 5262c6d..cebb661 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tclInt.decls,v 1.69 2004/03/17 18:14:13 das Exp $ +# RCS: @(#) $Id: tclInt.decls,v 1.70 2004/03/18 18:53:41 rmax Exp $ library tcl @@ -522,7 +522,7 @@ declare 132 generic { int TclpHasSockets(Tcl_Interp *interp) } declare 133 generic { - struct tm *TclpGetDate(TclpTime_t time, int useGMT) + struct tm *TclpGetDate(time_t *time, int useGMT) } declare 134 generic { size_t TclpStrftime(char *s, size_t maxsize, CONST char *format, diff --git a/generic/tclInt.h b/generic/tclInt.h index c97d68a..a0043dd 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.147 2004/03/17 18:14:13 das Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.148 2004/03/18 18:54:02 rmax Exp $ */ #ifndef _TCLINT @@ -1525,12 +1525,6 @@ typedef struct TclFileAttrProcs { typedef struct TclFile_ *TclFile; /* - * Opaque names for platform specific types. - */ - -typedef struct TclpTime_t_ *TclpTime_t; - -/* * The "globParameters" argument of the function TclGlob is an * or'ed combination of the following values: */ diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index cc160d2..c46e389 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIntDecls.h,v 1.57 2004/03/17 18:14:13 das Exp $ + * RCS: @(#) $Id: tclIntDecls.h,v 1.58 2004/03/18 18:54:42 rmax Exp $ */ #ifndef _TCLINTDECLS @@ -691,7 +691,7 @@ EXTERN int TclpHasSockets _ANSI_ARGS_((Tcl_Interp * interp)); #ifndef TclpGetDate_TCL_DECLARED #define TclpGetDate_TCL_DECLARED /* 133 */ -EXTERN struct tm * TclpGetDate _ANSI_ARGS_((TclpTime_t time, int useGMT)); +EXTERN struct tm * TclpGetDate _ANSI_ARGS_((CONST time_t *time, int useGMT)); #endif #ifndef TclpStrftime_TCL_DECLARED #define TclpStrftime_TCL_DECLARED @@ -1104,7 +1104,7 @@ typedef struct TclIntStubs { int (*tcl_RemoveInterpResolvers) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 130 */ void (*tcl_SetNamespaceResolvers) _ANSI_ARGS_((Tcl_Namespace * namespacePtr, Tcl_ResolveCmdProc * cmdProc, Tcl_ResolveVarProc * varProc, Tcl_ResolveCompiledVarProc * compiledVarProc)); /* 131 */ int (*tclpHasSockets) _ANSI_ARGS_((Tcl_Interp * interp)); /* 132 */ - struct tm * (*tclpGetDate) _ANSI_ARGS_((TclpTime_t time, int useGMT)); /* 133 */ + struct tm * (*tclpGetDate) _ANSI_ARGS_((CONST time_t *time, int useGMT)); /* 133 */ size_t (*tclpStrftime) _ANSI_ARGS_((char * s, size_t maxsize, CONST char * format, CONST struct tm * t, int useGMT)); /* 134 */ void *reserved135; void *reserved136; -- cgit v0.12