Misc cleanup and improvements for src/joystick/hidapi/SDL_report_descriptor.c#15959
Open
ao2 wants to merge 8 commits into
Open
Misc cleanup and improvements for src/joystick/hidapi/SDL_report_descriptor.c#15959ao2 wants to merge 8 commits into
src/joystick/hidapi/SDL_report_descriptor.c#15959ao2 wants to merge 8 commits into
Conversation
The size of the HID report descriptors in the SDL_COMPILE_TIME_ASSERT checks is specified sometimes in decimal and sometimes in octal. Always used decimal for consistency. Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
Author
|
I took the And I have no idea how to solve it. |
Unconditionally include "SDL_internal.h" for robustness, since it's needed in any case for embedding SDL's internal API aftre disabling SDL_DYNAMIC_API, as per the Hacks libsdl-org#1-libsdl-org#3 at the top of the file. Also include "SDL_internal.h" without prepending src/ because add_sdl_test_executable(... BUILD_DEPENDENT ...) already adds src/ to the include path. Do the same for "dynapi/SDL_dynapi.h". Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
Add support for building SDL_report_descriptor as an executable to make it easier to experiment with HID report descriptor parsing. Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
Fix compiler warning:
-----------------------------------------------------------------------
.../src/joystick/hidapi/SDL_report_descriptor.c:621:17: warning: unused variable ‘file’ [-Wunused-variable]
621 | const char *file = argv[1];
| ^~~~
-----------------------------------------------------------------------
Use the declared variable.
Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
For correctness clean up the descriptor parsing context before exiting, even though this is not a problem in practice for a standalone executable. Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
Fix some ignored return values resulting in incomplete error checking.
For instance:
- ParseMainItem() was always returning true because the return value of
AddInputFields() was not handled.
- ParseLocalItem() was always returning true because the return value of
AddUsage() was not handled.
Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
This gives some more coverage when launching the executable. Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
bebc7b1 to
037f2f5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
here are some cleanups and improvements for
src/joystick/hidapi/SDL_report_descriptor.cin preparation for future changes.cc @smcv