SDL/src/audio
Jessica Clarke 8f38ba4d68 Fix casts that should be using uintptr_t
This is needed to support CHERI, and thus Arm's experimental Morello
prototype, where pointers are implemented using unforgeable capabilities
that include bounds and permissions metadata to provide fine-grained
spatial and referential memory safety, as well as revocation by sweeping
memory to provide heap temporal memory safety.

On most systems (anything with a flat memory hierarchy rather than using
segment-based addressing), size_t and uintptr_t are the same type.
However, on CHERI, size_t is just an integer offset, whereas uintptr_t
is still a capability as described above. Casting a pointer to size_t
will strip the metadata and validity tag, and casting from size_t to a
pointer will result in a null-derived capability whose validity tag is
not set, and thus cannot be dereferenced without faulting.

The audio and cursor casts were harmless as they intend to stuff an
integer into a pointer, but using uintptr_t is the idiomatic way to do
that and silences our compiler warnings (which our build tool makes
fatal by default as they often indicate real problems). The iconv and
egl casts were true positives as SDL_iconv_t and iconv_t are pointer
types, as is NativeDisplayType on most OSes, so this would have trapped
at run time when using the round-tripped pointers. The gles2 casts were
also harmless; the OpenGL API defines this argument to be a pointer type
(and uses the argument name "pointer"), but it in fact represents an
integer offset, so like audio and cursor the additional idiomatic cast
is needed to silence the warning.
2021-07-29 14:42:15 -07:00
..
aaudio AAudio: make sure stream is not null to prevent crash in RequestStop (see #3710) 2021-04-28 21:04:47 +02:00
alsa Add SDL_GetAudioDeviceSpec. 2021-03-05 12:03:07 -08:00
android Updated copyright for 2021 2021-01-02 10:25:38 -08:00
arts Updated copyright for 2021 2021-01-02 10:25:38 -08:00
coreaudio Removed duplicate SDL_AtomicGet() 2021-05-28 12:29:54 -04:00
directsound Add SDL_GetAudioDeviceSpec. 2021-03-05 12:03:07 -08:00
disk audio: Changed a disk and dummy backends to use _this instead of this. 2021-04-06 18:35:20 -04:00
dsp dsp: Refuse to initialize if there aren't any Open Sound System devices. 2021-03-17 13:04:05 -04:00
dummy audio: Fixed assertion failure if trying to use dummy backend. 2021-04-06 18:35:20 -04:00
emscripten emscripten: Automatically resume audio contexts 2021-02-13 11:56:01 -05:00
esd Updated copyright for 2021 2021-01-02 10:25:38 -08:00
fusionsound Updated copyright for 2021 2021-01-02 10:25:38 -08:00
haiku Updated copyright for 2021 2021-01-02 10:25:38 -08:00
jack Updated copyright for 2021 2021-01-02 10:25:38 -08:00
nacl Updated copyright for 2021 2021-01-02 10:25:38 -08:00
nas Updated copyright for 2021 2021-01-02 10:25:38 -08:00
netbsd netbsdaudio: Handle ioctls failing 2021-03-13 18:37:21 -08:00
openslES OpenSLES: CloseDevice() is called at higher level, if OpenDevice() fails 2021-04-29 09:29:02 +02:00
os2 Add SDL_GetAudioDeviceSpec. 2021-03-05 12:03:07 -08:00
paudio Updated copyright for 2021 2021-01-02 10:25:38 -08:00
pipewire audio: pipewire: Block while waiting on stream state info 2021-03-29 08:49:25 -07:00
psp Updated copyright for 2021 2021-01-02 10:25:38 -08:00
pulseaudio pulseaudio: Optionally add "monitor" sources to device list. 2021-07-27 13:12:57 -04:00
qsa Add SDL_GetAudioDeviceSpec. 2021-03-05 12:03:07 -08:00
sndio Updated copyright for 2021 2021-01-02 10:25:38 -08:00
sun Updated copyright for 2021 2021-01-02 10:25:38 -08:00
vita Set volume on device open 2021-04-24 14:13:09 -07:00
wasapi Fixed microphone randomly stop working 2021-07-27 14:19:11 -04:00
winmm Fixed warnings building with Visual Studio 2021-05-25 10:34:04 -07:00
SDL_audio.c Support comma-separated lists in SDL_AUDIODRIVER 2021-07-26 15:14:54 -04:00
SDL_audio_c.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_audiocvt.c Fix casts that should be using uintptr_t 2021-07-29 14:42:15 -07:00
SDL_audiodev.c Fix casts that should be using uintptr_t 2021-07-29 14:42:15 -07:00
SDL_audiodev_c.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_audiotypecvt.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_mixer.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_sysaudio.h AAudio: add bootstrap in SDL_audio.c 2021-04-15 21:00:00 +02:00
SDL_wave.c Fix format string warnings for width-based integers 2021-02-11 19:41:41 -08:00
SDL_wave.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00