diff options
author | kennykb <kennykb@noemail.net> | 2005-03-15 16:29:50 (GMT) |
---|---|---|
committer | kennykb <kennykb@noemail.net> | 2005-03-15 16:29:50 (GMT) |
commit | 160cda07ad378f09512c87d928f617ee95141c5d (patch) | |
tree | c0ceec939fa665f6e04a9c562e0e7a6bd8cd7f6d /generic/tclClock.c | |
parent | 6044ec62cd3fffa58df217e83ef5589a9923c49e (diff) | |
download | tcl-160cda07ad378f09512c87d928f617ee95141c5d.zip tcl-160cda07ad378f09512c87d928f617ee95141c5d.tar.gz tcl-160cda07ad378f09512c87d928f617ee95141c5d.tar.bz2 |
replaced 'long' times with wides, to cope with Win64
FossilOrigin-Name: d41af48065dcbcbd65ee57cb1b1a013bfa8abad8
Diffstat (limited to 'generic/tclClock.c')
-rw-r--r-- | generic/tclClock.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c index 9683abb..d476795 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.20.2.1 2004/05/14 21:41:11 kennykb Exp $ + * RCS: @(#) $Id: tclClock.c,v 1.20.2.2 2005/03/15 16:29:53 kennykb Exp $ */ #include "tcl.h" @@ -29,7 +29,7 @@ TCL_DECLARE_MUTEX(clockMutex) */ static int FormatClock _ANSI_ARGS_((Tcl_Interp *interp, - unsigned long clockVal, int useGMT, + Tcl_WideInt clockVal, int useGMT, char *format)); /* @@ -62,7 +62,7 @@ Tcl_ClockObjCmd (client, interp, objc, objv) int useGMT = 0; char *format = "%a %b %d %X %Z %Y"; int dummy; - unsigned long baseClock, clockVal; + Tcl_WideInt baseClock, clockVal; long zone; Tcl_Obj *baseObjPtr = NULL; char *scanStr; @@ -128,7 +128,7 @@ Tcl_ClockObjCmd (client, interp, objc, objv) return TCL_ERROR; } - if (Tcl_GetLongFromObj(interp, objv[2], (long*) &clockVal) + if (Tcl_GetWideIntFromObj(interp, objv[2], &clockVal) != TCL_OK) { return TCL_ERROR; } @@ -157,7 +157,7 @@ Tcl_ClockObjCmd (client, interp, objc, objv) if (objc != 0) { goto wrongFmtArgs; } - return FormatClock(interp, (unsigned long) clockVal, useGMT, + return FormatClock(interp, clockVal, useGMT, format); case COMMAND_SCAN: /* scan */ @@ -194,8 +194,8 @@ Tcl_ClockObjCmd (client, interp, objc, objv) } if (baseObjPtr != NULL) { - if (Tcl_GetLongFromObj(interp, baseObjPtr, - (long*) &baseClock) != TCL_OK) { + if (Tcl_GetWideIntFromObj(interp, baseObjPtr, + &baseClock) != TCL_OK) { return TCL_ERROR; } } else { @@ -205,13 +205,13 @@ Tcl_ClockObjCmd (client, interp, objc, objv) if (useGMT) { zone = -50000; /* Force GMT */ } else { - zone = TclpGetTimeZone((unsigned long) baseClock); + zone = TclpGetTimeZone(baseClock); } scanStr = Tcl_GetStringFromObj(objv[2], &dummy); Tcl_MutexLock(&clockMutex); - if (TclGetDate(scanStr, (unsigned long) baseClock, zone, - (unsigned long *) &clockVal) < 0) { + if (TclGetDate(scanStr, baseClock, zone, + &clockVal) < 0) { Tcl_MutexUnlock(&clockMutex); Tcl_AppendStringsToObj(resultPtr, "unable to convert date-time string \"", @@ -220,7 +220,7 @@ Tcl_ClockObjCmd (client, interp, objc, objv) } Tcl_MutexUnlock(&clockMutex); - Tcl_SetLongObj(resultPtr, (long) clockVal); + Tcl_SetWideIntObj(resultPtr, clockVal); return TCL_OK; case COMMAND_SECONDS: /* seconds */ @@ -255,7 +255,7 @@ Tcl_ClockObjCmd (client, interp, objc, objv) static int FormatClock(interp, clockVal, useGMT, format) Tcl_Interp *interp; /* Current interpreter. */ - unsigned long clockVal; /* Time in seconds. */ + Tcl_WideInt clockVal; /* Time in seconds. */ int useGMT; /* Boolean */ char *format; /* Format string */ { @@ -317,7 +317,7 @@ FormatClock(interp, clockVal, useGMT, format) } #endif - tclockVal = clockVal; + tclockVal = (time_t) clockVal; timeDataPtr = TclpGetDate((TclpTime_t) &tclockVal, useGMT); /* |