Commit Graph

588 Commits

Author SHA1 Message Date
Ozkan Sezer
5e35309913 fix bad merge of sizeof style patch 2023-03-10 08:32:24 +03:00
Sam Lantinga
0d76380042 Code style: changed "sizeof foo" to "sizeof(foo)" (thanks @sezero!)
(cherry picked from commit c6443d86c92e962683a1efe5f123a144988875b5)
2023-03-09 15:23:59 -08:00
Ozkan Sezer
bc87983310 tests: added -DHAVE_SIGNAL_H to CFLAGS in watcom makefiles 2023-03-08 18:56:50 +03:00
Sylvain
17515f4aef Backport simplify flags PR #7220 2023-02-09 17:19:46 -08:00
Sam Lantinga
0479df53ca Updated copyright for 2023 2023-01-09 09:48:21 -08:00
Sam Lantinga
b8d5fa4aef Improved handling of binding buttons and axes
(cherry picked from commit 71f3bf90edce26083056215124e65881f6c6ad26)
2023-01-03 12:50:20 -08:00
Sylvain
8e72be3117
testime.c: fix wrong {} in switch 2022-12-15 14:39:05 +01:00
Pierre Wendling
e580e087ff N3DS: Backport semaphore fixes from #6776. 2022-12-11 17:09:28 -08:00
Ozkan Sezer
bcccbbd894 tests: avoid redefinition warnings for MSVC _CRT_???_NO_DEPRECATE macros 2022-12-05 00:35:32 +03:00
Pierre Wendling
d0bbfdbfb8 Clang-Tidy fixes (#6725)
(cherry picked from commit 3c501b963dd8f0605a6ce7978882df39ba76f9cd)
2022-12-01 13:08:50 -08:00
Sam Lantinga
b8d85c6939 Update for SDL3 coding style (#6717)
I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base.

In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted.

The script I ran for the src directory is added as build-scripts/clang-format-src.sh

This fixes:
#6592
#6593
#6594

(cherry picked from commit 5750bcb174300011b91d1de20edb288fcca70f8c)
2022-11-30 12:57:41 -08:00
Sylvain Becker
fb0ce375f0 Cleanup add brace (#6545)
* Add braces after if conditions

* More add braces after if conditions

* Add braces after while() conditions

* Fix compilation because of macro being modified

* Add braces to for loop

* Add braces after if/goto

* Move comments up

* Remove extra () in the 'return ...;' statements

* More remove extra () in the 'return ...;' statements

* More remove extra () in the 'return ...;' statements after merge

* Fix inconsistent patterns are xxx == NULL vs !xxx

* More "{}" for "if() break;"  and "if() continue;"

* More "{}" after if() short statement

* More "{}" after "if () return;" statement

* More fix inconsistent patterns are xxx == NULL vs !xxx

* Revert some modificaion on SDL_RLEaccel.c

* SDL_RLEaccel: no short statement

* Cleanup 'if' where the bracket is in a new line

* Cleanup 'while' where the bracket is in a new line

* Cleanup 'for' where the bracket is in a new line

* Cleanup 'else' where the bracket is in a new line

(cherry picked from commit 6a2200823c66e53bd3cda4a25f0206b834392652 to reduce conflicts merging between SDL2 and SDL3)
2022-11-28 12:33:03 -08:00
Sylvain
3e70553c48 Unneed test before calling SDL_FreeSurface 2022-11-18 06:58:34 -08:00
Sylvain
71f2864b3a
Fix usage of sizeof() in test/testgles*.c files 2022-11-17 14:55:49 +01:00
Sylvain
ddad901c0d
Remove unneeded semicolon 2022-11-17 10:43:45 +01:00
Sylvain
b7358e47d5
Don't compare pointer against '0', but NULL 2022-11-17 09:18:49 +01:00
Sylvain
4192d1a1c7
Fix compilation. It needs to be casted to 'int' type 2022-11-16 21:56:19 +01:00
Sylvain
ce5da5d579
Don't compare pointer against '0', but NULL 2022-11-16 21:47:43 +01:00
Anonymous Maarten
55534e277e cmake: add time out to tests to avoid ci timeouts 2022-11-16 15:42:08 +01:00
Anonymous Maarten
a22fcf77fd cmake: older emscripten releases have a broken FindOpenGL.cmake
This is fixed since 3.1.10: 485a7b4d6f (diff-034f4d123f23ec5493d0fbf28cba1c36e404a991f286c8d031a22799e4e8b0e5)
2022-11-16 15:42:08 +01:00
Anonymous Maarten
d8884b845e emscripten: fix warnings in tests 2022-11-16 15:42:08 +01:00
Anonymous Maarten
a71e558d85 cmake: testshader needs -sLEGACY_GL_EMULATION on Emscripten 2022-11-16 15:42:08 +01:00
Anonymous Maarten
cfa76973ff cmake: FindOpenGL.cmake shipped by emscripten does not have OpenGL::GL 2022-11-16 15:42:08 +01:00
Anonymous Maarten
76e3cf3840 cmake: use custom add_sdl_test_executable macro to add test 2022-11-16 15:42:08 +01:00
Pierre Wendling
d080e3bf3a Silence -Wmaybe-uninitialized warnings in tests. 2022-11-14 21:23:08 -08:00
Sam Lantinga
0dfc829a6b Added simple BLE Steam Controller support on all platforms
This is still disabled by default via the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM
2022-11-10 19:17:04 -08:00
Ozkan Sezer
db01016dd6 revert replace AM_PATH_SDL2 usage with corresponding PKG_CHECK_MODULES.
Reference issue: https://github.com/libsdl-org/SDL/issues/6494 .
2022-11-07 21:15:30 +03:00
Ozkan Sezer
64c93f7804 replace AM_PATH_SDL2 usage with corresponding PKG_CHECK_MODULES. 2022-11-06 23:51:04 +03:00
Sam Lantinga
da478d1f66 Fixed build 2022-10-25 10:30:56 -07:00
Simon McVittie
2dc788cb9f build: Expand version info in SDL_REVISION and SDL_GetRevision()
Instead of using a URL and git sha1, this uses `git describe` to
describe the version relative to the nearest previous git tag, which
gives a better indication of whether this is a release, a prerelease,
a slightly patched prerelease, or a long way after the last release
during active development.

This serves two purposes: it makes those APIs more informative, and it
also puts this information into the binary in a form that is easy to
screen-scrape using strings(1). For instance, if the bundled version of
SDL in a game has this, we can see at a glance what version it is.

It's also shorter than using the web address of the origin git
repository and the full git commit sha1.

Also write the computed version into a file ./VERSION in `make dist`
tarballs, so that when we build from a tarball on a system that doesn't
have git available, we still get the version details.

For the Perforce code path in showrev.sh, output the version number
followed by the Perforce revision, in a format reminiscent of
`git describe` (with p instead of g to indicate Perforce).

For the code path with no VCS available at all, put a suffix on the
version number to indicate that this is just a guess (we can't know
whether this SDL version is actually a git snapshot or has been
patched locally or similar).

Resolves: https://github.com/libsdl-org/SDL/issues/6418
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-22 09:27:10 -07:00
Brad Smith
f4e3af15a1 Simplify OSS test by removing OpenBSD specific location of the soundcard.h header
OpenBSD has long since stopped using OSS. Remove checking for OpenBSD specific header.
2022-10-17 07:18:47 -07:00
Simon McVittie
7d230af51d testevdev: Explain why the test data is encoded the way it is
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-12 19:20:40 +03:00
Simon McVittie
81dee31949 testevdev: Add a static assertion for supported sizeof(long)
If this assertion fails on some platform (unlikely), we will need a
third implementation for SwapLongLE().

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-12 19:20:40 +03:00
Helge Deller
fb32effd15 testevdev: Fix detection of word size
The check for whether to use a 32- or 64-bit swap for an array of long
values always took the 64-bit path, because <limits.h> wasn't included
and therefore ULONG_MAX wasn't defined. Turn this into a runtime check,
which a reasonable compiler will optimize into a constant.

This fixes testevdev failures on 32-bit big-endian platforms such as hppa
and older powerpc. Little-endian and/or 64-bit platforms are unaffected.

[smcv: Added commit message]
Bug-Debian: https://bugs.debian.org/1021310
Co-authored-by: Simon McVittie <smcv@collabora.com>
2022-10-11 14:33:34 -07:00
Pierre Wendling
c1317175b4 PSP: Fix Wformat warnings. 2022-10-10 22:31:16 -07:00
Pierre Wendling
6784d84c9d N3DS: Fix -Wformat warnings in tests.
All warnings were about invalid specifiers. Since U/Sint32 is a long,
using `%d` emits a -Wformat warning.
2022-10-10 08:50:59 -07:00
Pierre Wendling
655275378d N3DS port (squashed)
A dedicated renderer using Citro3D would likely allow for better
much better graphical performances.
2022-10-10 08:50:59 -07:00
Cameron Gutman
ec1137dfbd cmake: Apply CETCOMPAT fix from ef988fe1 to tests 2022-10-09 15:19:47 -05:00
Ozkan Sezer
d022039529 testhaptic: fix watcom "&array may not produce intended result" warning 2022-10-09 12:01:02 +03:00
Anonymous Maarten
b8a4b8d1cd testautomation_mouse: fix format '%i' expecting 'int' instead of 'Uint32'
Emitted by Nintendo 3DS's gcc
2022-10-08 23:41:07 +02:00
Anonymous Maarten
7ae5d8d406 testmessage: fix conversion from intptr_t to Uint32
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten
02b200ef08 testoffscreen: fix '<': signed/unsigned mismatch
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten
7a7980fafa testnative: fix conversion from time_t to unsigned int
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten
8770689525 testmouse: add explicit int-cast to avoid warning about converting float to int
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten
3c251ec41e testintersections: fix conversion from time_t to unsigned int
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten
b771d9beec tests: avoid MSVC preaching about unsafe functions 2022-10-08 23:41:07 +02:00
Anonymous Maarten
ebae142aa4 testhaptic: fix conversion from size_t to int
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten
18c776e155 testspriteminimal: fix conversion from time_t to unsigned int
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten
f3389f13ef testgeometry: fix conversion from 'double' to 'float', possible loss of data
emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten
45da133999 cmake: don't error on apple when using deprecated declarations 2022-10-08 23:41:07 +02:00