interim commit

This commit is contained in:
hyung-hwan 2008-12-21 08:38:19 +00:00
parent 3d9fbd489f
commit 2aa72ba49b
2 changed files with 11 additions and 11 deletions

View File

@ -39,14 +39,14 @@ typedef struct ase_btime_t ase_btime_t;
struct ase_btime_t struct ase_btime_t
{ {
int sec; int sec;
int min; int min; /* 0 to 59 */
int hour; int hour; /* 0 to 23 */
int mday; int mday; /* 1 to 31 */
int mon; int mon; /* 0 to 11 */
int year; int year; /* the number of years since 1900 */
int wday; int wday; /* 0(sunday) to 6(saturday) */
int yday; int yday; /* 0 to 365 */
int isdst; int isdst;
}; };

View File

@ -26,7 +26,7 @@
#define EPOCH_DIFF_MSECS (EPOCH_DIFF_SECS*ASE_MSEC_IN_SEC) #define EPOCH_DIFF_MSECS (EPOCH_DIFF_SECS*ASE_MSEC_IN_SEC)
#endif #endif
static int ytab[2][12] = static int mdays[2][ASE_MON_IN_YEAR] =
{ {
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
@ -121,9 +121,9 @@ void ase_gmtime (ase_ntime_t nt, ase_btime_t* bt)
bt->yday = days; bt->yday = days;
bt->mon = 0; bt->mon = 0;
while (days >= ytab[ASE_IS_LEAPYEAR(year)][bt->mon]) while (days >= mdays[ASE_IS_LEAPYEAR(year)][bt->mon])
{ {
days -= ytab[ASE_IS_LEAPYEAR(year)][bt->mon]; days -= mdays[ASE_IS_LEAPYEAR(year)][bt->mon];
bt->mon++; bt->mon++;
} }