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

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

View File

@ -26,7 +26,7 @@
#define EPOCH_DIFF_MSECS (EPOCH_DIFF_SECS*ASE_MSEC_IN_SEC)
#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, 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->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++;
}