SDL_GetSensors() follows the SDL_GetStringRule

This commit is contained in:
Sam Lantinga
2024-07-18 22:10:29 -07:00
parent 4f8c348402
commit 856d598d6e
6 changed files with 10 additions and 15 deletions

View File

@@ -1564,7 +1564,7 @@ Rather than iterating over sensors using device index, there is a new function S
{
if (SDL_InitSubSystem(SDL_INIT_SENSOR) == 0) {
int i, num_sensors;
SDL_SensorID *sensors = SDL_GetSensors(&num_sensors);
const SDL_SensorID *sensors = SDL_GetSensors(&num_sensors);
if (sensors) {
for (i = 0; i < num_sensors; ++i) {
SDL_Log("Sensor %" SDL_PRIu32 ": %s, type %d, platform type %d\n",
@@ -1573,7 +1573,6 @@ Rather than iterating over sensors using device index, there is a new function S
SDL_GetSensorTypeForID(sensors[i]),
SDL_GetSensorNonPortableTypeForID(sensors[i]));
}
SDL_free(sensors);
}
SDL_QuitSubSystem(SDL_INIT_SENSOR);
}