New environment set call to enable a bit more sensible handling of
absolute pointing devices (pointer and lightgun). With the
confinement enabled, pointing devices will not return neither
-0x8000 nor (0,0), which was anyway dependent on the input driver,
instead they will stay at the extreme edge.
* Silence GCC 14 warning [-Warray-bounds=]
GCC reports a couple of warnings like this example:
libretro-common/cdrom/cdrom.c:395:14: warning: array subscript 6 is outside array bounds of 'unsigned char[6]' [-Warray-bounds=]
395 | cmd[6] = cmd[3];
| ~~~~~~~^~~~~~~~
libretro-common/cdrom/cdrom.c: In function 'cdrom_unlock':
libretro-common/cdrom/cdrom.c:1268:18: note: at offset 6 into object 'cdb' of size 6
1268 | unsigned char cdb[] = {0x1E, 0, 0, 0, 0x2, 0};
The static analysis heuristic doesn't consider the fact that the writes to cmd[6] and later only happen under the condition that `if (cmd[0] == 0xBE || cmd[0] == 0xB9)` and that in all of those cases the array passed is wide enough. So this is a false positive.
Nevertheless, there seems to be an easy way to silence the warning without disabling it: just require all arrays passed to be at least 9 bytes long and explicitly set the size of those arrays that have been shorter to 9.
* Work around the requirement of C89
I used a C99 construct, but this is easy to work around
with a run-time check.
* Restore the check for non-null cmd
It was obsoleted in a previous version, but is needed back now.
---------
Co-authored-by: pstef <3462925+pstef@users.noreply.github.com>
This commit imports a series of patches from the FreeBSD port of RetroArch to
improve build compatibility and address specific issues encountered in the
FreeBSD environment. These patches, sourced from the FreeBSD Ports collection
(https://cgit.freebsd.org/ports/tree/games/retroarch/files), have been adapted
and tested to ensure they integrate seamlessly with the current build process.
* sort remaps by connected controller if option is enabled
* ensure dir name is valid based on input device name
* Fix comments
* Fix forbidden mixed declarations and code
* fixing build errors
* fix additional build warning/error
* Resolved code review change requests
* Changed strlcat to strlcpy as per recommendation
* Retrigger checks
* Use proper path separator.
* Ensure default value is toggled off.
* Ensure that gamepad device name is valid.
* Massive reduction in heap space allocation, going from settings struct
264kb to 119Kb
* Use NAME_MAX_LENGTH for base paths/names, etc
* Use DIR_MAX_LENGTH for directory sizes
This puts the code into the binary's .text section, which is needed
for platforms without the ability to map it as RWX (WiiU). Using
GNU/AT&T syntax for the assembly here.
Will return 0 for non-file streams. I didn't want to mess around with
memory_stream (which could in theory have a truncate impl that sets
size) because there were globals and stuff and I got nervous (also
truncate might *grow* a file if the new length is longer than the old
one and then I'd have to think about realloc, etc).
<compat/posix_string.h> gets included which should redefine strtok_r
for MSVC usage but it just doesn't work and fails at linking stage, will have to figure this out
later
This fixes a warning of the `include_hidden` parameter not being used outside of `_WIN32`.
```
vfs/vfs_implementation.c:1063:30: error: unused parameter ‘include_hidden’ [-Werror=unused-parameter]
1063 | const char *name, bool include_hidden)
| ^
cc1: all warnings being treated as error
```