mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-09 01:14:24 +02:00
Use new parameter validation macro
This commit is contained in:
@@ -222,7 +222,7 @@ char **SDL_GetEnvironmentVariables(SDL_Environment *env)
|
||||
{
|
||||
char **result = NULL;
|
||||
|
||||
if (!env) {
|
||||
CHECK_PARAM(!env) {
|
||||
SDL_InvalidParamError("env");
|
||||
return NULL;
|
||||
}
|
||||
@@ -253,11 +253,13 @@ bool SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const ch
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (!env) {
|
||||
CHECK_PARAM(!env) {
|
||||
return SDL_InvalidParamError("env");
|
||||
} else if (!name || *name == '\0' || SDL_strchr(name, '=') != NULL) {
|
||||
}
|
||||
CHECK_PARAM(!name || *name == '\0' || SDL_strchr(name, '=') != NULL) {
|
||||
return SDL_InvalidParamError("name");
|
||||
} else if (!value) {
|
||||
}
|
||||
CHECK_PARAM(!value) {
|
||||
return SDL_InvalidParamError("value");
|
||||
}
|
||||
|
||||
@@ -292,9 +294,10 @@ bool SDL_UnsetEnvironmentVariable(SDL_Environment *env, const char *name)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (!env) {
|
||||
CHECK_PARAM(!env) {
|
||||
return SDL_InvalidParamError("env");
|
||||
} else if (!name || *name == '\0' || SDL_strchr(name, '=') != NULL) {
|
||||
}
|
||||
CHECK_PARAM(!name || *name == '\0' || SDL_strchr(name, '=') != NULL) {
|
||||
return SDL_InvalidParamError("name");
|
||||
}
|
||||
|
||||
|
||||
@@ -6419,16 +6419,16 @@ bool SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
|
||||
SDL_realloc_func realloc_func,
|
||||
SDL_free_func free_func)
|
||||
{
|
||||
if (!malloc_func) {
|
||||
CHECK_PARAM(!malloc_func) {
|
||||
return SDL_InvalidParamError("malloc_func");
|
||||
}
|
||||
if (!calloc_func) {
|
||||
CHECK_PARAM(!calloc_func) {
|
||||
return SDL_InvalidParamError("calloc_func");
|
||||
}
|
||||
if (!realloc_func) {
|
||||
CHECK_PARAM(!realloc_func) {
|
||||
return SDL_InvalidParamError("realloc_func");
|
||||
}
|
||||
if (!free_func) {
|
||||
CHECK_PARAM(!free_func) {
|
||||
return SDL_InvalidParamError("free_func");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user