From eb482d45256bc2cbd79a7a1b72c2b5395d638818 Mon Sep 17 00:00:00 2001 From: rmax Date: Thu, 18 Mar 2004 18:55:55 +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: --- unix/tclUnixTime.c | 10 ++++------ win/tclWinTime.c | 19 +++++++++---------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index 4f10312..aec0185 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.18 2003/05/19 17:25:37 kennykb Exp $ + * RCS: @(#) $Id: tclUnixTime.c,v 1.19 2004/03/18 18:55:55 rmax Exp $ */ #include "tclInt.h" @@ -287,15 +287,13 @@ Tcl_GetTime(timePtr) struct tm * TclpGetDate(time, useGMT) - TclpTime_t time; + CONST time_t *time; int useGMT; { - CONST time_t *tp = (CONST time_t *)time; - if (useGMT) { - return ThreadSafeGMTime(tp); + return ThreadSafeGMTime(time); } else { - return ThreadSafeLocalTime(tp); + return ThreadSafeLocalTime(time); } } diff --git a/win/tclWinTime.c b/win/tclWinTime.c index 396adfa..1ab09a8 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.21 2003/12/16 02:55:38 davygrvy Exp $ + * RCS: @(#) $Id: tclWinTime.c,v 1.22 2004/03/18 18:56:04 rmax Exp $ */ #include "tclWinInt.h" @@ -545,10 +545,9 @@ TclpGetTZName(int dst) struct tm * TclpGetDate(t, useGMT) - TclpTime_t t; + CONST time_t t; int useGMT; { - const time_t *tp = (const time_t *) t; struct tm *tmPtr; time_t time; @@ -571,14 +570,14 @@ TclpGetDate(t, useGMT) H. Giese, June 2003 */ #ifdef __BORLANDC__ - if (*tp >= SECSPERDAY) { + if (t >= SECSPERDAY) { #else - if (*tp >= 0) { + if (t >= 0) { #endif return localtime(tp); } - time = *tp - timezone; + time = t - timezone; /* * If we aren't near to overflowing the long, just add the bias and @@ -586,11 +585,11 @@ TclpGetDate(t, useGMT) * the result at the end. */ - if (*tp < (LONG_MAX - 2 * SECSPERDAY) - && *tp > (LONG_MIN + 2 * SECSPERDAY)) { + if (t < (LONG_MAX - 2 * SECSPERDAY) + && t > (LONG_MIN + 2 * SECSPERDAY)) { tmPtr = ComputeGMT(&time); } else { - tmPtr = ComputeGMT(tp); + tmPtr = ComputeGMT(&t); tzset(); @@ -626,7 +625,7 @@ TclpGetDate(t, useGMT) tmPtr->tm_wday = (tmPtr->tm_wday + time) % 7; } } else { - tmPtr = ComputeGMT(tp); + tmPtr = ComputeGMT(&t); } return tmPtr; } -- cgit v0.12