update sdl to 2.32.6

This commit is contained in:
AzaezelX 2025-05-24 13:39:03 -05:00
parent e557f5962b
commit ddc1f8c1e2
1339 changed files with 53966 additions and 19207 deletions

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -27,7 +27,7 @@
#include "SDL_events.h"
#include "SDL_syssensor.h"
#if !SDL_EVENTS_DISABLED
#ifndef SDL_EVENTS_DISABLED
#include "../events/SDL_events_c.h"
#endif
@ -75,7 +75,7 @@ int SDL_SensorInit(void)
SDL_sensor_lock = SDL_CreateMutex();
}
#if !SDL_EVENTS_DISABLED
#ifndef SDL_EVENTS_DISABLED
if (SDL_InitSubSystem(SDL_INIT_EVENTS) < 0) {
return -1;
}
@ -108,7 +108,7 @@ int SDL_NumSensors(void)
* Return the next available sensor instance ID
* This may be called by drivers from multiple threads, unprotected by any locks
*/
SDL_SensorID SDL_GetNextSensorInstanceID()
SDL_SensorID SDL_GetNextSensorInstanceID(void)
{
return SDL_AtomicIncRef(&SDL_next_sensor_instance_id);
}
@ -237,7 +237,7 @@ SDL_Sensor *SDL_SensorOpen(int device_index)
/* Create and initialize the sensor */
sensor = (SDL_Sensor *)SDL_calloc(sizeof(*sensor), 1);
if (sensor == NULL) {
if (!sensor) {
SDL_OutOfMemory();
SDL_UnlockSensors();
return NULL;
@ -297,7 +297,7 @@ static int SDL_PrivateSensorValid(SDL_Sensor *sensor)
{
int valid;
if (sensor == NULL) {
if (!sensor) {
SDL_SetError("Sensor hasn't been opened yet");
valid = 0;
} else {
@ -454,7 +454,7 @@ void SDL_SensorQuit(void)
SDL_UnlockSensors();
#if !SDL_EVENTS_DISABLED
#ifndef SDL_EVENTS_DISABLED
SDL_QuitSubSystem(SDL_INIT_EVENTS);
#endif
@ -479,7 +479,7 @@ int SDL_PrivateSensorUpdate(SDL_Sensor *sensor, Uint64 timestamp_us, float *data
/* Post the event, if desired */
posted = 0;
#if !SDL_EVENTS_DISABLED
#ifndef SDL_EVENTS_DISABLED
if (SDL_GetEventState(SDL_SENSORUPDATE) == SDL_ENABLE) {
SDL_Event event;
event.type = SDL_SENSORUPDATE;

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -54,14 +54,14 @@ static int SDL_ANDROID_SensorInit(void)
ASensorList sensors;
SDL_sensor_manager = ASensorManager_getInstance();
if (SDL_sensor_manager == NULL) {
if (!SDL_sensor_manager) {
return SDL_SetError("Couldn't create sensor manager");
}
SDL_sensor_looper = ALooper_forThread();
if (SDL_sensor_looper == NULL) {
if (!SDL_sensor_looper) {
SDL_sensor_looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
if (SDL_sensor_looper == NULL) {
if (!SDL_sensor_looper) {
return SDL_SetError("Couldn't create sensor event loop");
}
}
@ -70,7 +70,7 @@ static int SDL_ANDROID_SensorInit(void)
sensors_count = ASensorManager_getSensorList(SDL_sensor_manager, &sensors);
if (sensors_count > 0) {
SDL_sensors = (SDL_AndroidSensor *)SDL_calloc(sensors_count, sizeof(*SDL_sensors));
if (SDL_sensors == NULL) {
if (!SDL_sensors) {
return SDL_OutOfMemory();
}
@ -125,7 +125,7 @@ static int SDL_ANDROID_SensorOpen(SDL_Sensor *sensor, int device_index)
int delay_us, min_delay_us;
hwdata = (struct sensor_hwdata *)SDL_calloc(1, sizeof(*hwdata));
if (hwdata == NULL) {
if (!hwdata) {
return SDL_OutOfMemory();
}
@ -161,7 +161,7 @@ static void SDL_ANDROID_SensorUpdate(SDL_Sensor *sensor)
ASensorEvent event;
struct android_poll_source *source;
if (ALooper_pollAll(0, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
if (ALooper_pollOnce(0, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
SDL_zero(event);
while (ASensorEventQueue_getEvents(sensor->hwdata->eventqueue, &event, 1) > 0) {
SDL_PrivateSensorUpdate(sensor, 0, event.data, SDL_arraysize(event.data));

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -54,7 +54,7 @@ static int SDL_VITA_SensorInit(void)
SDL_sensors_count = 2;
SDL_sensors = (SDL_VitaSensor *)SDL_calloc(SDL_sensors_count, sizeof(*SDL_sensors));
if (SDL_sensors == NULL) {
if (!SDL_sensors) {
return SDL_OutOfMemory();
}
@ -121,7 +121,7 @@ static int SDL_VITA_SensorOpen(SDL_Sensor *sensor, int device_index)
struct sensor_hwdata *hwdata;
hwdata = (struct sensor_hwdata *)SDL_calloc(1, sizeof(*hwdata));
if (hwdata == NULL) {
if (!hwdata) {
return SDL_OutOfMemory();
}
sensor->hwdata = hwdata;

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -67,7 +67,7 @@ static int DisconnectSensor(ISensor *sensor);
static HRESULT STDMETHODCALLTYPE ISensorManagerEventsVtbl_QueryInterface(ISensorManagerEvents *This, REFIID riid, void **ppvObject)
{
if (ppvObject == NULL) {
if (!ppvObject) {
return E_INVALIDARG;
}
@ -107,7 +107,7 @@ static ISensorManagerEvents sensor_manager_events = {
static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_QueryInterface(ISensorEvents *This, REFIID riid, void **ppvObject)
{
if (ppvObject == NULL) {
if (!ppvObject) {
return E_INVALIDARG;
}
@ -286,13 +286,13 @@ static int ConnectSensor(ISensor *sensor)
if (bstr_name != NULL) {
SysFreeString(bstr_name);
}
if (name == NULL) {
if (!name) {
return SDL_OutOfMemory();
}
SDL_LockSensors();
new_sensors = (SDL_Windows_Sensor *)SDL_realloc(SDL_sensors, (SDL_num_sensors + 1) * sizeof(SDL_Windows_Sensor));
if (new_sensors == NULL) {
if (!new_sensors) {
SDL_UnlockSensors();
SDL_free(name);
return SDL_OutOfMemory();

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages