Codechange: Use SQInteger for generic numbers in script_date

This commit is contained in:
glx22 2023-02-10 18:40:44 +01:00 committed by Loïc Guilloux
parent 424ae74504
commit 2f40bf8097
2 changed files with 10 additions and 10 deletions

View File

@ -25,7 +25,7 @@
return (ScriptDate::Date)_date;
}
/* static */ int32 ScriptDate::GetYear(ScriptDate::Date date)
/* static */ SQInteger ScriptDate::GetYear(ScriptDate::Date date)
{
if (date < 0) return DATE_INVALID;
@ -34,7 +34,7 @@
return ymd.year;
}
/* static */ int32 ScriptDate::GetMonth(ScriptDate::Date date)
/* static */ SQInteger ScriptDate::GetMonth(ScriptDate::Date date)
{
if (date < 0) return DATE_INVALID;
@ -43,7 +43,7 @@
return ymd.month + 1;
}
/* static */ int32 ScriptDate::GetDayOfMonth(ScriptDate::Date date)
/* static */ SQInteger ScriptDate::GetDayOfMonth(ScriptDate::Date date)
{
if (date < 0) return DATE_INVALID;
@ -52,7 +52,7 @@
return ymd.day;
}
/* static */ ScriptDate::Date ScriptDate::GetDate(int32 year, int32 month, int32 day_of_month)
/* static */ ScriptDate::Date ScriptDate::GetDate(SQInteger year, SQInteger month, SQInteger day_of_month)
{
if (month < 1 || month > 12) return DATE_INVALID;
if (day_of_month < 1 || day_of_month > 31) return DATE_INVALID;
@ -61,7 +61,7 @@
return (ScriptDate::Date)::ConvertYMDToDate(year, month - 1, day_of_month);
}
/* static */ int32 ScriptDate::GetSystemTime()
/* static */ SQInteger ScriptDate::GetSystemTime()
{
time_t t;
time(&t);

View File

@ -55,21 +55,21 @@ public:
* @param date The date to get the year of.
* @return The year.
*/
static int32 GetYear(Date date);
static SQInteger GetYear(Date date);
/**
* Get the month of the given date.
* @param date The date to get the month of.
* @return The month.
*/
static int32 GetMonth(Date date);
static SQInteger GetMonth(Date date);
/**
* Get the day (of the month) of the given date.
* @param date The date to get the day of.
* @return The day.
*/
static int32 GetDayOfMonth(Date date);
static SQInteger GetDayOfMonth(Date date);
/**
* Get the date given a year, month and day of month.
@ -78,7 +78,7 @@ public:
* @param day_of_month The day of month of the to-be determined date.
* @return The date.
*/
static Date GetDate(int32 year, int32 month, int32 day_of_month);
static Date GetDate(SQInteger year, SQInteger month, SQInteger day_of_month);
/**
* Get the time of the host system.
@ -86,7 +86,7 @@ public:
* @api -ai
* @note This uses the clock of the host system, which can skew or be set back. Use with caution.
*/
static int32 GetSystemTime();
static SQInteger GetSystemTime();
};
#endif /* SCRIPT_DATE_HPP */