Commit Graph
38 Commits
Author SHA1 Message Date
LibretroAdmin c83441dfdd vulkan_common: two real C89 violations, and the pass that could not see them
gfx/common/vulkan_common.c has been failing the linux-c89 flags on
master: a declaration after a statement at the top of
vulkan_destroy_swapchain(), where the Win32 exclusive-mode release
sits above `unsigned i`, and two VkSurfaceFullScreenExclusive*
structs initialised from settings read earlier in the same function,
which C89 will not compute at load time. The declaration moves above
the #ifdef and the two structs are assigned rather than initialised;
no behaviour changes on any path.

Neither would have been caught by tools/mingw_syntax_check.sh even
when run over the whole tree, because the C89 pass did not define
HAVE_VULKAN: the file's settings members did not exist, so it failed
on those instead and the real violations never got that far. The
define joins that pass, which is what made both visible.

The decl gate added last commit then found six more files at the top
level using strlcpy through a transitive declaration - the core
option manager, the core updater list, both disk-control files, the
manual scanner and runahead - and they now include <compat/strl.h>
themselves.
2026-09-11 08:49:48 +02:00
libretroadmin d26fe536ce Do not report a failed disc restore when a core has no discs
Loading any non-disc content on a core that registers the disk control
interface pops up "Failed to set last used disc". A ZX Spectrum snapshot
through fuse does it every time.

disk_control_set_initial_index() enables the index record for any content
with a path, because disk_index_file_init() only fails when it cannot build
one. disk_control_verify_initial_index() then requires
get_image_path(get_image_index()) to succeed. A core with no images has to
fail that call - libretro.h defines get_image_path as returning false when
index >= get_num_images() - so success stays false and the error is pushed
to the message queue.

The assumption underneath is that a core exposing set_initial_image only
ever gets disc content. That does not hold. The interface is registered in
retro_set_environment(), long before the core is handed anything, and a
computer core cannot know at that point whether the content will be a disk
image, a tape or a snapshot. fuse registers it because it supports +3 disk
images and M3U playlists, and then spends most of its life loading .tzx and
.z80 files.

Skip the check when the core reports no images. There is no disc state to
restore and nothing to verify.

This also stops the failure branch writing a disk index file for content
that has no discs: disk_index_file_init() sets modified on a new record, so
the disk_index_file_set()/disk_index_file_save() pair at the end of that
branch created a .ldci for every tape and snapshot loaded.

Multi-disc content is unaffected - initial_num_images is only 0 when the
core reports no images at all.
2026-07-31 17:41:02 +02:00
U-DESKTOP-SPFP6AQ\twistedtechre 6603fe2369 Replace string_is_empty 2026-04-07 03:35:23 +02:00
sonninnos b1546681c8 Disc Control menu refactor (#18613) 2026-01-16 04:56:17 +01:00
sonninnos 64c15f545f Use 'generic message' widget style in Disc Control 2025-08-06 15:29:02 +03:00
libretroadmin 8181583298 Try to reserve 'error' keyword for goto labels, use 'err' for
variables and arguments instead
2025-08-05 21:02:49 +02:00
sonninnos 419007c1ca Smaller regular widget notification option (#18085) 2025-07-12 04:37:38 +03:00
sonninnos b2ca569521 Logging unification cleanups 2025-07-10 05:59:06 +03:00
pstef 83e974077f Guarantee space for string characters after strlcpy
to silence a couple of stringop-overflow warnings (3DS).
2025-03-28 11:11:09 +00:00
LibretroAdmin 366612fb82 Revert "Fix some string appending"
This reverts commit 65b9ea4e76.
2025-02-11 23:48:12 +01:00
LibretroAdmin 65b9ea4e76 Fix some string appending 2025-02-11 23:08:55 +01:00
LibretroAdmin 0b329018ee Less string buffers and less string copies 2025-01-16 23:59:22 +01:00
LibretroAdmin 7e7224196a Avoid some strlens, and also return size_t in more string
modification functions
2025-01-12 23:39:29 +01:00
LibretroAdmin 18c85b5ccd Cleanups -
* Less string copies
* Some general cleanups
* Add extra param to runloop_message_queue_push so we can pass size_t
of the message
* Consistent conventions for local variable usage for certain things
2024-12-27 15:13:45 +01:00
libretroadmin 7f87a46744 More downsizing of variables 2024-09-09 16:18:32 +02:00
sonninnos 9dfa1df39e Remove some unneeded logging (#16298) 2024-02-26 20:59:01 -08:00
zoltanvb d88d0d5219 Option for disabling initial disc change (#16197)
Loading the last used disc for multi-disc content was automatic.
However, in some cases it is not wanted, as described in #16018
Option is added for controlling the function. Disabling the
option will also implicitly disable index saving.
2024-02-04 11:58:16 -08:00
libretroadmin c699e47534 Small style nits and plain sense cleanups 2023-08-16 01:14:50 +02:00
libretroadmin bdc398d79f - Safer code - use strlcpy where possible instead of manual character
assignments for strings longer than 2 chars
- Use strlcpy concatenation instead of strlcat
- Make sure that what remains of iteration of the '_len' variable
for manual char assignment
is done in a safer way so mistakes are less possible
2023-06-20 16:33:55 +02:00
libretroadmin 8a3686df58 Revert "Header cleanups - don't include retroarch.h everywhere"
This reverts commit 0e3b478f8c.
2023-01-08 09:05:46 +01:00
libretroadmin 0e3b478f8c Header cleanups - don't include retroarch.h everywhere 2023-01-08 08:56:57 +01:00
LibretroAdmin 60030e373e Reduce snprintfs + assorted cleanups (#14369)
* Reduce snprintf and/or use them only for concatenating the
string formatting of numbers/values
* Reduce snprintfs
* Use snprintf for concatenation at parts
* * We don't need to NULL-terminate strings that get passed to strlcpy/strlcat
and friends
* Use snprintf for concatenation in certain instances
* Do away with some string intermediary copies where we can avoid it
* Fix warning unused variable
* * Reduce snprintf calls
* Rewrite snprintf calls into strlcpy where possible
* Use snprintf for concatenation when necessary
* Do away with some string intermediary copies in task_translation.c
* run_translation_service - make switch slightly smaller
2022-09-01 04:17:07 +02:00
LibretroAdmin 5b56ff145f Refine documentation 2022-08-01 15:46:08 +02:00
Jamiras e3b59fd36d upgrade to rcheevos 10.4 (#13908) 2022-05-04 04:46:47 +02:00
Tony 8cc423e036 Logging cleanups (#13370) 2021-12-17 18:04:24 +01:00
Jamiras 99a1ffdb89 validate hashes for secondary discs in multi-disc games (#13283) 2021-11-25 07:15:37 +01:00
twinaphex 619398bbe4 Backport parts of https://github.com/neil4/RetroArch-Lite/commit/73c07602362471f2c82d866250e4b2015edafc07 2021-11-09 23:12:57 +01:00
Michael Burgardt d8db234df0 Concatinate some previously truncated strings for easier translation (#12120) 2021-09-16 19:00:14 +02:00
jdgleaver 230c1cdde2 Add option to show/hide 'last used disc restored' notifications 2020-07-17 12:52:28 +01:00
jdgleaver 0c18da5d49 (Disk Control Interface) Enable 'Load New Disc' while disk tray is open 2020-06-17 11:43:54 +01:00
twinaphex 941c3b9678 Cleanups 2020-05-29 12:46:18 +02:00
twinaphex 2518ad47d9 Reduce size of image_label 2020-05-23 03:11:35 +02:00
twinaphex be39981ba3 (MSVC 2003 Debug) Fix build 2020-03-05 18:29:48 +01:00
jdgleaver 35977efe43 Prevent improper display of (old style) OSD text when widgets are enabled 2020-03-05 12:28:38 +00:00
twinaphex 3b207990ce Cleanups 2020-02-23 06:34:41 +01:00
twinaphex 880391d0c5 (libnx) Try to silence warnings 2020-02-10 12:36:11 +01:00
jdgleaver 9de9a79925 (Disk Control) Add disk labels to 'disk inserted' notifications 2020-02-04 15:45:00 +00:00
jdgleaver 00397a33f0 (Disk Control Interface) Add support for saving/restoring last used disk in playlists + code overhaul 2020-01-22 17:09:12 +00:00