Files
SDL/src/core
Simon McVittie c13e74be6b progress: Correct calls to dbus_message_iter_open_container with variants
As documented, the contained_signature is to be passed in as a
nul-terminated C string.

For basic types that are represented by a single character, on
little-endian platforms, putting the type in the least significant
byte of an int and casting its address to `char *` happens to result in
a valid string, because the int's in-memory representation looks like
`(char []){ 'b', 0, 0, 0 }`. However, on big-endian platforms, the int's
in-memory representation is `(char []){ 0, 0, 0, 'b' }` which is not
a valid type for a D-Bus variant to hold (it is interpreted as an empty
string, and variants are not allowed to be empty).

Instead, do this the straightforward way, with a mnemonic string and
no casts (in the same style used in `SDL_portaldialog`).

Fixes: 3f2226a9 "Add progress bar support for Linux"
Resolves: https://github.com/libsdl-org/SDL/issues/13953
Bug-Debian: https://bugs.debian.org/1115705
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-09-23 08:19:25 -07:00
..
2025-08-08 12:47:09 -07:00