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.
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.
* 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
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.
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
* 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