* src/SDCCval.c (cheapestVal): changed behaviour to the same as constVal()
[fw/sdcc] / device / lib / time.c
index 5d6f45fed8bf1882fa20c8a3ba609a0251af897f..8cb00d1fb281e2711e61237d877dbf132041e343 100755 (executable)
@@ -176,25 +176,25 @@ time_t mktime(struct tm *timeptr) {
     CheckTime(timeptr);
 
     // seconds from 1970 till 1 jan 00:00:00 this year
-    seconds= (year-1970)*60*60*24*365;
+    seconds= (year-1970)*(60*60*24L*365);
 
     // add extra days for leap years
     for (i=1970; i<year; i++) {
        if (LEAP_YEAR(i)) {
-           seconds+= 60*60*24;
+           seconds+= 60*60*24L;
        }
     }
 
     // add days for this year
     for (i=0; i<month; i++) {
       if (i==1 && LEAP_YEAR(year)) { 
-       seconds+= 60*60*24*29;
+       seconds+= 60*60*24L*29;
       } else {
-       seconds+= 60*60*24*monthDays[i];
+       seconds+= 60*60*24L*monthDays[i];
       }
     }
 
-    seconds+= timeptr->tm_mday-1*60*60*24;
+    seconds+= timeptr->tm_mday-1*60*60*24L;
     seconds+= timeptr->tm_hour*60*60;
     seconds+= timeptr->tm_min*60;
     seconds+= timeptr->tm_sec;