Skip to content

Commit 181dd2c

Browse files
committed
Merge tag 'release-2.32.4'
2 parents 6f426d8 + 2359383 commit 181dd2c

File tree

12 files changed

+41
-43
lines changed

12 files changed

+41
-43
lines changed

android-project/app/src/main/java/org/libsdl/app/SDLActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
6161
private static final String TAG = "SDL";
6262
private static final int SDL_MAJOR_VERSION = 2;
6363
private static final int SDL_MINOR_VERSION = 32;
64-
private static final int SDL_MICRO_VERSION = 2;
64+
private static final int SDL_MICRO_VERSION = 4;
6565
/*
6666
// Display InputType.SOURCE/CLASS of events and devices
6767
//

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub fn build(b: *std.Build) void {
77

88
const lib = b.addLibrary(.{
99
.name = "SDL2",
10-
.version = .{ .major = 2, .minor = 32, .patch = 2 },
10+
.version = .{ .major = 2, .minor = 32, .patch = 4 },
1111
.linkage = if (t.abi.isAndroid()) .dynamic else .static,
1212
.root_module = b.createModule(.{
1313
.target = target,

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.{
22
.name = .SDL,
3-
.version = "2.32.2",
3+
.version = "2.32.4",
44
.fingerprint = 0x7ac4ce41df223a25,
55
.minimum_zig_version = "0.14.0",
66
.dependencies = .{},

include/SDL_render.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window,
244244
* \since This function is available since SDL 2.0.0.
245245
*
246246
* \sa SDL_CreateRenderer
247-
* \sa SDL_CreateWindowRenderer
247+
* \sa SDL_CreateWindowAndRenderer
248248
* \sa SDL_DestroyRenderer
249249
*/
250250
extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface);
@@ -787,7 +787,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer,
787787
* Get the current render target.
788788
*
789789
* The default render target is the window for which the renderer was created,
790-
* and is reported a NULL here.
790+
* and is reported as NULL here.
791791
*
792792
* \param renderer the rendering context.
793793
* \returns the current render target or NULL for the default render target.

include/SDL_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ typedef struct SDL_version
5858
*/
5959
#define SDL_MAJOR_VERSION 2
6060
#define SDL_MINOR_VERSION 32
61-
#define SDL_PATCHLEVEL 2
61+
#define SDL_PATCHLEVEL 4
6262

6363
/**
6464
* Macro to determine SDL version program was compiled against.

src/SDL_assert.c

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,7 @@
4242
#endif
4343

4444
#if defined(__EMSCRIPTEN__)
45-
#include <emscripten.h>
46-
/* older Emscriptens don't have this, but we need to for wasm64 compatibility. */
47-
#ifndef MAIN_THREAD_EM_ASM_PTR
48-
#ifdef __wasm64__
49-
#error You need to upgrade your Emscripten compiler to support wasm64
50-
#else
51-
#define MAIN_THREAD_EM_ASM_PTR MAIN_THREAD_EM_ASM_INT
52-
#endif
53-
#endif
45+
#include <emscripten.h>
5446
#endif
5547

5648
/* The size of the stack buffer to use for rendering assert messages. */
@@ -259,34 +251,39 @@ static SDL_assert_state SDLCALL SDL_PromptAssertion(const SDL_assert_data *data,
259251
for (;;) {
260252
SDL_bool okay = SDL_TRUE;
261253
/* *INDENT-OFF* */ /* clang-format off */
262-
char *buf = (char *) MAIN_THREAD_EM_ASM_PTR({
254+
int reply = MAIN_THREAD_EM_ASM_INT({
263255
var str =
264256
UTF8ToString($0) + '\n\n' +
265257
'Abort/Retry/Ignore/AlwaysIgnore? [ariA] :';
266258
var reply = window.prompt(str, "i");
267259
if (reply === null) {
268260
reply = "i";
269261
}
270-
return allocate(intArrayFromString(reply), 'i8', ALLOC_NORMAL);
262+
return reply.length === 1 ? reply.charCodeAt(0) : -1;
271263
}, message);
272264
/* *INDENT-ON* */ /* clang-format on */
273265

274-
if (SDL_strcmp(buf, "a") == 0) {
266+
switch (reply) {
267+
case 'a':
275268
state = SDL_ASSERTION_ABORT;
276269
#if 0 /* (currently) no break functionality on Emscripten */
277-
} else if (SDL_strcmp(buf, "b") == 0) {
270+
case 'b':
278271
state = SDL_ASSERTION_BREAK;
272+
break;
279273
#endif
280-
} else if (SDL_strcmp(buf, "r") == 0) {
274+
case 'r':
281275
state = SDL_ASSERTION_RETRY;
282-
} else if (SDL_strcmp(buf, "i") == 0) {
276+
break;
277+
case 'i':
283278
state = SDL_ASSERTION_IGNORE;
284-
} else if (SDL_strcmp(buf, "A") == 0) {
279+
break;
280+
case 'A':
285281
state = SDL_ASSERTION_ALWAYS_IGNORE;
286-
} else {
282+
break;
283+
default:
287284
okay = SDL_FALSE;
285+
break;
288286
}
289-
free(buf);
290287

291288
if (okay) {
292289
break;

src/audio/pipewire/SDL_pipewire.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ static void node_event_info(void *object, const struct pw_node_info *info)
590590

591591
/* Need to parse the parameters to get the sample rate */
592592
for (i = 0; i < info->n_params; ++i) {
593-
pw_node_enum_params(node->proxy, 0, info->params[i].id, 0, 0, NULL);
593+
pw_node_enum_params((struct pw_node*)node->proxy, 0, info->params[i].id, 0, 0, NULL);
594594
}
595595

596596
hotplug_core_sync(node);

src/core/linux/SDL_udev.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,12 @@ static int device_class(struct udev_device *dev)
424424
}
425425

426426
val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_ACCELEROMETER");
427-
if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_TRUE) &&
428-
val && SDL_strcmp(val, "1") == 0) {
429-
devclass |= SDL_UDEV_DEVICE_JOYSTICK;
427+
if (val && SDL_strcmp(val, "1") == 0) {
428+
if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_FALSE)) {
429+
devclass |= SDL_UDEV_DEVICE_JOYSTICK;
430+
} else {
431+
devclass |= SDL_UDEV_DEVICE_ACCELEROMETER;
432+
}
430433
}
431434

432435
val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_MOUSE");

src/joystick/hidapi/SDL_hidapijoystick.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -890,10 +890,8 @@ static SDL_HIDAPI_Device *HIDAPI_AddDevice(const struct SDL_hid_device_info *inf
890890
return NULL;
891891
}
892892
device->magic = &SDL_HIDAPI_device_magic;
893-
device->path = SDL_strdup(info->path);
894-
if (!device->path) {
895-
SDL_free(device);
896-
return NULL;
893+
if (info->path) {
894+
device->path = SDL_strdup(info->path);
897895
}
898896
device->seen = SDL_TRUE;
899897
device->vendor_id = info->vendor_id;

src/joystick/windows/SDL_rawinputjoystick.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,9 +908,11 @@ static void RAWINPUT_AddDevice(HANDLE hDevice)
908908
char *product_string = NULL;
909909
WCHAR string[128];
910910

911+
string[0] = 0;
911912
if (SDL_HidD_GetManufacturerString(hFile, string, sizeof(string))) {
912913
manufacturer_string = WIN_StringToUTF8W(string);
913914
}
915+
string[0] = 0;
914916
if (SDL_HidD_GetProductString(hFile, string, sizeof(string))) {
915917
product_string = WIN_StringToUTF8W(string);
916918
}

0 commit comments

Comments
 (0)