summaryrefslogtreecommitdiffstats
path: root/src/time64.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/time64.c')
-rw-r--r--src/time64.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/time64.c b/src/time64.c
index f1cffd4..db571d8 100644
--- a/src/time64.c
+++ b/src/time64.c
@@ -1,4 +1,4 @@
1/* 1/*
2 2
3Copyright (c) 2007-2010 Michael G Schwern 3Copyright (c) 2007-2010 Michael G Schwern
4 4
@@ -30,7 +30,7 @@ THE SOFTWARE.
30 30
31Programmers who have available to them 64-bit time values as a 'long 31Programmers who have available to them 64-bit time values as a 'long
32long' type can use localtime64_r() and gmtime64_r() which correctly 32long' type can use localtime64_r() and gmtime64_r() which correctly
33converts the time even on 32-bit systems. Whether you have 64-bit time 33converts the time even on 32-bit systems. Whether you have 64-bit time
34values will depend on the operating system. 34values will depend on the operating system.
35 35
36localtime64_r() is a 64-bit equivalent of localtime_r(). 36localtime64_r() is a 64-bit equivalent of localtime_r().
@@ -293,7 +293,7 @@ static int check_tm(struct TM *tm)
293 293
294 assert(tm->tm_wday >= 0); 294 assert(tm->tm_wday >= 0);
295 assert(tm->tm_wday <= 6); 295 assert(tm->tm_wday <= 6);
296 296
297 assert(tm->tm_yday >= 0); 297 assert(tm->tm_yday >= 0);
298 assert(tm->tm_yday <= length_of_year[IS_LEAP(tm->tm_year)]); 298 assert(tm->tm_yday <= length_of_year[IS_LEAP(tm->tm_year)]);
299 299
@@ -368,7 +368,7 @@ static int safe_year(const Year year)
368 year_cycle += 17; 368 year_cycle += 17;
369 369
370 year_cycle %= SOLAR_CYCLE_LENGTH; 370 year_cycle %= SOLAR_CYCLE_LENGTH;
371 if( year_cycle < 0 ) 371 if( year_cycle < 0 )
372 year_cycle = SOLAR_CYCLE_LENGTH + year_cycle; 372 year_cycle = SOLAR_CYCLE_LENGTH + year_cycle;
373 373
374 assert( year_cycle >= 0 ); 374 assert( year_cycle >= 0 );
@@ -674,7 +674,7 @@ struct TM *gmtime64_r (const Time64_T *in_time, struct TM *p)
674 p->tm_hour = v_tm_hour; 674 p->tm_hour = v_tm_hour;
675 p->tm_mon = v_tm_mon; 675 p->tm_mon = v_tm_mon;
676 p->tm_wday = v_tm_wday; 676 p->tm_wday = v_tm_wday;
677 677
678 assert(check_tm(p)); 678 assert(check_tm(p));
679 679
680 return p; 680 return p;
@@ -756,7 +756,7 @@ struct TM *localtime64_r (const Time64_T *timev, struct TM *local_tm)
756 local_tm->tm_year++; 756 local_tm->tm_year++;
757 } 757 }
758 758
759 /* GMT is Jan 1st, xx01 year, but localtime is still Dec 31st 759 /* GMT is Jan 1st, xx01 year, but localtime is still Dec 31st
760 in a non-leap xx00. There is one point in the cycle 760 in a non-leap xx00. There is one point in the cycle
761 we can't account for which the safe xx00 year is a leap 761 we can't account for which the safe xx00 year is a leap
762 year. So we need to correct for Dec 31st comming out as 762 year. So we need to correct for Dec 31st comming out as
@@ -766,7 +766,7 @@ struct TM *localtime64_r (const Time64_T *timev, struct TM *local_tm)
766 local_tm->tm_yday--; 766 local_tm->tm_yday--;
767 767
768 assert(check_tm(local_tm)); 768 assert(check_tm(local_tm));
769 769
770 return local_tm; 770 return local_tm;
771} 771}
772 772