Add and use a function to get string_view lengths as an int
commit700b4dcf03b34da0ff37a079555359ca6deb840d
authorChris Robinson <chris.kcat@gmail.com>
Sun, 28 Jan 2024 06:08:58 +0000 (27 22:08 -0800)
committerChris Robinson <chris.kcat@gmail.com>
Sun, 28 Jan 2024 06:08:58 +0000 (27 22:08 -0800)
tree26ed06798fd7a4e208a5a7c5821d5f325e5d32cc
parentd7cafac10654e1724503d1efed8bbe3331aa2e20
Add and use a function to get string_view lengths as an int

The .*s formatter needs the length of the subsequent string as a (signed) int,
but a string_view uses size_t for the length, which is an unsigned integer and
(potentially) larger. So the length has to be clamped to not overflow the int
and wrap to negative when cast.
24 files changed:
al/debug.cpp
al/eax/utils.cpp
al/effect.cpp
alc/alc.cpp
alc/alconfig.cpp
alc/backends/alsa.cpp
alc/backends/coreaudio.cpp
alc/backends/dsound.cpp
alc/backends/jack.cpp
alc/backends/null.cpp
alc/backends/oboe.cpp
alc/backends/opensl.cpp
alc/backends/oss.cpp
alc/backends/pipewire.cpp
alc/backends/portaudio.cpp
alc/backends/pulseaudio.cpp
alc/backends/sndio.cpp
alc/backends/solaris.cpp
alc/backends/wasapi.cpp
alc/backends/wave.cpp
alc/backends/winmm.cpp
common/alstring.h
common/strutils.cpp
core/helpers.cpp