summaryrefslogtreecommitdiff
path: root/date.c
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2006-08-15 16:49:48 +0000
committerrubidium <rubidium@openttd.org>2006-08-15 16:49:48 +0000
commit7d2ceb2063a4769fb92882a8851ed26267fa1e62 (patch)
treea8dc2bb9573156c15f1089772e4b388b37989f2d /date.c
parentfda8bf2a226ded4d22c9c03ec965c340768ed9bd (diff)
downloadopenttd-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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/date.c b/date.c
index 6305d5f6c..74009a38f 100644
--- a/date.c
+++ b/date.c
@@ -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;