From 30698371b0fdddc2978f662905b55b61274a8512 Mon Sep 17 00:00:00 2001 From: johanknol Date: Sat, 26 Jan 2002 15:47:27 +0000 Subject: [PATCH] has been fixed a long time ago git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1840 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- device/lib/time.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/device/lib/time.c b/device/lib/time.c index 34bb60c8..5d6f45fe 100755 --- a/device/lib/time.c +++ b/device/lib/time.c @@ -25,8 +25,6 @@ #include #include -#define FIXDS390BUG (long) - // please note that the tm structure has the years since 1900, // but time returns the seconds since 1970 @@ -178,28 +176,28 @@ time_t mktime(struct tm *timeptr) { CheckTime(timeptr); // seconds from 1970 till 1 jan 00:00:00 this year - seconds= FIXDS390BUG (year-1970)*60*60*24*365; + seconds= (year-1970)*60*60*24*365; // add extra days for leap years for (i=1970; itm_mday-1)*60*60*24; - seconds+= FIXDS390BUG timeptr->tm_hour*60*60; - seconds+= FIXDS390BUG timeptr->tm_min*60; - seconds+= FIXDS390BUG timeptr->tm_sec; + seconds+= timeptr->tm_mday-1*60*60*24; + seconds+= timeptr->tm_hour*60*60; + seconds+= timeptr->tm_min*60; + seconds+= timeptr->tm_sec; return seconds; } -- 2.47.2