Use new parameter validation macro

This commit is contained in:
Sam Lantinga
2025-09-16 21:51:03 -07:00
parent ee1c90a358
commit 25b2d2c821
60 changed files with 1113 additions and 1133 deletions

View File

@@ -57,11 +57,11 @@ static int SDL_sensors_locked;
static bool SDL_sensors_initialized;
static SDL_Sensor *SDL_sensors SDL_GUARDED_BY(SDL_sensor_lock) = NULL;
#define CHECK_SENSOR_MAGIC(sensor, result) \
if (!SDL_ObjectValid(sensor, SDL_OBJECT_TYPE_SENSOR)) { \
SDL_InvalidParamError("sensor"); \
SDL_UnlockSensors(); \
return result; \
#define CHECK_SENSOR_MAGIC(sensor, result) \
CHECK_PARAM(!SDL_ObjectValid(sensor, SDL_OBJECT_TYPE_SENSOR)) { \
SDL_InvalidParamError("sensor"); \
SDL_UnlockSensors(); \
return result; \
}
bool SDL_SensorsInitialized(void)