(svn r5918) -Cleanup: rename ConvertDayToYMD/ConvertYMDToDay as they really convert a Date to/from a YearMonthDay.

-Cleanup: swap ConvertDateToYMD's parameters to make the order consistent with the name of the function.
This commit is contained in:
rubidium
2006-08-15 16:49:48 +00:00
parent 08fd0bed1f
commit 1cc6e186f0
10 changed files with 19 additions and 19 deletions

10
date.c
View File

@@ -23,7 +23,7 @@ void SetDate(Date date)
YearMonthDay ymd;
_date = date;
ConvertDayToYMD(&ymd, date);
ConvertDateToYMD(date, &ymd);
_cur_year = ymd.year;
_cur_month = ymd.month;
#ifdef ENABLE_NETWORK
@@ -71,7 +71,7 @@ static const uint16 _accum_days_for_month[] = {
};
void ConvertDayToYMD(YearMonthDay *ymd, Date date)
void ConvertDateToYMD(Date date, YearMonthDay *ymd)
{
uint yr = date / (365 + 365 + 365 + 366);
uint rem = date % (365 + 365 + 365 + 366);
@@ -101,7 +101,7 @@ void ConvertDayToYMD(YearMonthDay *ymd, Date date)
* @param month is a number between 0..11
* @param day is a number between 1..31
*/
uint ConvertYMDToDay(Year year, Month month, Day day)
Date ConvertYMDToDate(Year year, Month month, Day day)
{
uint rem;
@@ -147,7 +147,7 @@ Date ConvertIntDate(uint date)
/* invalid ranges? */
if (month >= 12 || !IS_INT_INSIDE(day, 1, 31 + 1)) return (Date)-1;
return ConvertYMDToDay(year, month, day);
return ConvertYMDToDate(year, month, day);
}
@@ -246,7 +246,7 @@ void IncreaseDate(void)
}
/* check if we entered a new month? */
ConvertDayToYMD(&ymd, _date);
ConvertDateToYMD(_date, &ymd);
if (ymd.month == _cur_month) return;
_cur_month = ymd.month;