Use new parameter validation macro
This commit is contained in:
@@ -168,13 +168,13 @@ bool SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks)
|
||||
static const Sint64 min_seconds = SDL_NS_TO_SECONDS(SDL_MIN_TIME) + 1;
|
||||
bool result = true;
|
||||
|
||||
if (!dt) {
|
||||
CHECK_PARAM(!dt) {
|
||||
return SDL_InvalidParamError("dt");
|
||||
}
|
||||
if (!ticks) {
|
||||
CHECK_PARAM(!ticks) {
|
||||
return SDL_InvalidParamError("ticks");
|
||||
}
|
||||
if (!SDL_DateTimeIsValid(dt)) {
|
||||
CHECK_PARAM(!SDL_DateTimeIsValid(dt)) {
|
||||
// The validation function sets the error string.
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf)
|
||||
|
||||
bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
{
|
||||
if (!ticks) {
|
||||
CHECK_PARAM(!ticks) {
|
||||
return SDL_InvalidParamError("ticks");
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
|
||||
bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime)
|
||||
{
|
||||
if (!dt) {
|
||||
CHECK_PARAM(!dt) {
|
||||
return SDL_InvalidParamError("dt");
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf)
|
||||
|
||||
bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
{
|
||||
if (!ticks) {
|
||||
CHECK_PARAM(!ticks) {
|
||||
return SDL_InvalidParamError("ticks");
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf)
|
||||
|
||||
bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
{
|
||||
if (!ticks) {
|
||||
CHECK_PARAM(!ticks) {
|
||||
return SDL_InvalidParamError("ticks");
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
|
||||
bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime)
|
||||
{
|
||||
if (!dt) {
|
||||
CHECK_PARAM(!dt) {
|
||||
return SDL_InvalidParamError("dt");
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
{
|
||||
u64 sceTicks;
|
||||
|
||||
if (!ticks) {
|
||||
CHECK_PARAM(!ticks) {
|
||||
return SDL_InvalidParamError("ticks");
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime)
|
||||
u64 local;
|
||||
int ret = 0;
|
||||
|
||||
if (!dt) {
|
||||
CHECK_PARAM(!dt) {
|
||||
return SDL_InvalidParamError("dt");
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ found_date:
|
||||
|
||||
bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
{
|
||||
if (!ticks) {
|
||||
CHECK_PARAM(!ticks) {
|
||||
return SDL_InvalidParamError("ticks");
|
||||
}
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
@@ -158,7 +158,7 @@ bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime)
|
||||
#endif
|
||||
struct tm *tm = NULL;
|
||||
|
||||
if (!dt) {
|
||||
CHECK_PARAM(!dt) {
|
||||
return SDL_InvalidParamError("dt");
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
{
|
||||
SceRtcTick sceTicks;
|
||||
|
||||
if (!ticks) {
|
||||
CHECK_PARAM(!ticks) {
|
||||
return SDL_InvalidParamError("ticks");
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime)
|
||||
SceRtcTick sceTicks, sceLocalTicks;
|
||||
int ret = 0;
|
||||
|
||||
if (!dt) {
|
||||
CHECK_PARAM(!dt) {
|
||||
return SDL_InvalidParamError("dt");
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
{
|
||||
FILETIME ft;
|
||||
|
||||
if (!ticks) {
|
||||
CHECK_PARAM(!ticks) {
|
||||
return SDL_InvalidParamError("ticks");
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime)
|
||||
SYSTEMTIME *st = NULL;
|
||||
Uint32 low, high;
|
||||
|
||||
if (!dt) {
|
||||
CHECK_PARAM(!dt) {
|
||||
return SDL_InvalidParamError("dt");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user