diff options
author | rubidium <rubidium@openttd.org> | 2006-08-15 16:49:48 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2006-08-15 16:49:48 +0000 |
commit | 7d2ceb2063a4769fb92882a8851ed26267fa1e62 (patch) | |
tree | a8dc2bb9573156c15f1089772e4b388b37989f2d /date.c | |
parent | fda8bf2a226ded4d22c9c03ec965c340768ed9bd (diff) | |
download | openttd-7d2ceb2063a4769fb92882a8851ed26267fa1e62.tar.xz |
(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.
Diffstat (limited to 'date.c')
-rw-r--r-- | date.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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; |