Eddy Jansson
91b9ba8c54
Correct typo GetSlectionText -> GetSelectionText
2023-03-02 16:29:18 -05:00
Eddy Jansson
5f5abb6805
Always allocate zt in output of SDL_iconv_string()
...
Before this, the function could not be used on buffers,
as it would not account for the zero-termination unless
it was included in the input.
2023-02-28 09:26:01 -08:00
Eddy Jansson
ad0b91302d
android: Add missing entries to SDL_category_prefixes table.
...
Add static assert so this shouldn't happen in the future.
Fixes #5883
2022-07-05 17:50:19 -07:00
Eddy Jansson
d7866ffac8
assert: Check for integer overflow.
...
Move rendering of the assert message into a separate
function so we can remove the ugly loop construction.
Changes the logic such that allocation failure no longer
immediately returns SDL_ASSERTION_ABORT, instead we
fall back to the truncated message.
If an error is indicated from SDL_snprintf, then we do
abort with SDL_ASSERTION_ABORT.
2022-05-11 12:55:49 -07:00
Eddy Jansson
f7280dcebb
log: Check for integer overflow.
2022-05-10 06:47:11 -07:00
Eddy Jansson
9e5cbf034a
Disallow non-positive allocation.
...
Ensure that we're not trying to call SDL_small_alloc()
with a count of zero.
Transforming the code like this fixes a
-Wmaybe-uninitialized warning from GCC 12.0.1
2022-04-29 18:34:13 -07:00
Eddy Jansson
6c2928b4be
Switch uses of MIN() to SDL_min()
...
We're excluding files in src/hidapi to minimize the
diff against the upstream project.
2022-04-29 10:39:51 -07:00
Eddy Jansson
ca26df3404
assert: Allow messages of any length.
...
Messages are no longer truncated to SDL_MAX_LOG_MESSAGE.
2022-04-29 10:39:02 -07:00
Eddy Jansson
888899244c
log: Allow log messages of any length.
...
Log messages are no longer truncated to SDL_MAX_LOG_MESSAGE.
2022-04-29 10:39:02 -07:00
Eddy Jansson
645db217a0
log: Use malloc for long messages.
...
For short messages, use a stack buffer that is
significantly smaller than SDL_MAX_LOG_MESSAGE.
The rationale for this is that we don't want to risk
blowing the stack, while at the same time we would
like to not put pressure on the memory allocator unless
absolutely necessary.
2022-04-29 10:39:02 -07:00
Eddy Jansson
73448fe245
assert: Remove use of alloca()
...
For short messages, use a stack buffer that is
significantly smaller than SDL_MAX_LOG_MESSAGE.
For larger messages, fall back to allocation.
2022-04-29 10:39:02 -07:00
Eddy Jansson
97774cdf72
Move in va_copy() define block from stdlib.
2022-04-29 10:39:02 -07:00
Eddy Jansson
5c1f5a7306
test: Correct invalid enum length.
...
Ensure that they can't break like this again.
2022-04-28 12:58:27 -07:00
Eddy Jansson
8c1584e8e8
WhatsNew: Start block for 2.0.24
2022-04-26 09:21:40 -07:00
Eddy Jansson
0288de8529
SDL_Rect: Add \sa documentation block to SDL_FRect
2022-04-22 12:09:13 -04:00
Eddy Jansson
a40405d724
hidapi: Wrap CopyHIDDeviceInfo in define checks.
...
The purpose of this is to silence a 'defined but not used'
warning.
2022-04-20 09:33:40 -07:00
Eddy Jansson
5bc2933425
test: Basic tests for SDL_FRectEquals
...
Based on the integer version. These tests mostly check that input
isn't mangled and that invalid input gives the expected negative
result.
2022-04-20 08:38:53 -07:00
Eddy Jansson
fc944859d1
SDL_Rect: Use a default epsilon in SDL_FRectEquals()
...
Add SDL_FRectEqualsEpsilon() for when more control over
equality test is required.
2022-04-20 08:38:53 -07:00
Eddy Jansson
00feca27b0
Add SDL_FLT_EPSILON.
2022-04-20 08:38:53 -07:00
Eddy Jansson
5d4a1f8356
WhatsNew.txt: Add SDL_FRectEqualsEpsilon()
2022-04-20 08:38:53 -07:00
Eddy Jansson
24ffcbd9ad
audio: Set error message on dsp init failure.
...
if SDL_EnumUnixAudioDevices() fails to find any devices,
set an error message on the exit path. Without this,
SDL_Init() could fail without any message available
in SDL_GetError().
2022-03-20 10:31:19 -07:00
Eddy Jansson
e2ba84a532
testtimer: Be more like the C90's.
2021-11-03 00:22:06 -04:00
Eddy Jansson
4ab7ee1925
testtimer: Add basic sanity check for SDL_GetTicks*()
2021-11-03 00:22:06 -04:00