Commit Graph

373 Commits

Author SHA1 Message Date
pstef 3dca8dbf66 Silence -Walloc-size-larger-than=byte-size
One of the GCC14's optimization heuristic triggered here, suggesting
that the special value of len (size_t) could potentially be lesser than
the file's size (int64_t) but greater than "maximum object size" (set by
byte-size, PTRDIFF_MAX by default).

Use the same type as the file size it's compared to, and adjust the
sentinel value to spell INT64_MAX.
2025-03-19 17:35:15 +00:00
LibretroAdmin 56d3042efd Change db_crc size back 2025-02-10 17:14:13 +01:00
LibretroAdmin 7a7c4df2a1 Settings cleanups 2025-02-10 17:12:02 +01:00
LibretroAdmin f71181d1c1 * Style nits
* task_database - db_crc allocated variable does not need to be of size PATH_MAX_LENGTH size
2025-02-09 17:49:44 +01:00
LibretroAdmin b211adaaca Function argument name standardization 2025-01-17 19:55:32 +01:00
LibretroAdmin dda78a4fc8 Use find_last_slash where possible 2025-01-17 13:26:17 +01:00
LibretroAdmin 56c63b8c19 Small cleanups - conventionalize char *s, size_t parameter usage 2024-12-30 09:44:40 +01:00
libretroadmin 700b13654c Some string cleanups 2024-12-25 19:18:45 +01:00
libretroadmin de8f979cb7 less string copies 2024-12-24 05:10:09 +01:00
LibretroAdmin 739f2ff55c
Reduce calls to path_remove_extension - use fill_pathname instead (#17270)
* Reduce calls to path_remove_extension - use fill_pathname instead

* More fill_pathname usage
2024-12-20 21:40:58 -08:00
Eric Warmenhoven e38b9ff734
Fix scanning .chd files (#16986) 2024-09-10 15:47:37 -07:00
libretroadmin 29f011acef * Inline find_last_slash
* explore_load_icons - fill_pathname_slash is equivalent to usage
of strlen here, no need to call strlen
2024-09-10 16:02:06 +02:00
libretroadmin f4ed638347 Rewrite libretro-common task_queue, use flags 2024-09-10 02:42:07 +02:00
libretroadmin 36bcbefc96 Cleanup some char variables - title variables will always be 128
in size
2024-09-10 00:15:23 +02:00
libretroadmin 13cf0fc79c Add more TODO/FIXME notes 2024-09-09 20:19:29 +02:00
libretroadmin 73e5d955c3 Downgrade some more variables to NAME_MAX_LENGTH 2024-09-09 16:01:29 +02:00
libretroadmin e279592ce6 Cut down on some snprintf calls 2024-06-15 01:29:08 +02:00
libretroadmin a6c82df0fd (task_database) Use size_t for size to prevent narrowing issue 2024-05-24 03:33:20 +02:00
zoltanvb b37debff13 Fix for scanning PSP ISOs (and probably few others) 2024-05-19 12:23:25 -07:00
libretroadmin ba47f40487 intfstream_get_serial - use string_is_equal_fast - strlen has already
been calculated for system_name once
2024-04-06 19:53:59 +02:00
libretroadmin 46fab505b5 intfstream_get_serial - add string_starts_with conditionals 2024-04-06 19:50:33 +02:00
zoltanvb 00d01c844e
Enable serial detection from GDI files. (#16171) 2024-01-28 08:51:20 -08:00
Eric Warmenhoven 4220e5683d
Do CRC checks on PSP/PSP(PSN) content scan (#15623) 2024-01-01 21:57:44 -08: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 12e7b31633 database_info_list_iterate_found_match - use two strlcpys here instead
of snprintf
2023-06-20 07:18:44 +02:00
libretroadmin 631301b3f7 * Cut down on strlcat calls when possible and replace them with clever
usage of strlcpy (when position/offset of previous strlcpy/snprintf call
is known. strlcat implementation in libretro-common makes implicit strlen
call, using strlcpy avoids this
* Reduce a bunch of local char variables by use of said clever usage,
should save up on local stack size usage
2023-06-18 12:06:12 +02:00
sonninnos 6b9727911b
Improve scanner console output (#15345)
* Improve scanner console output

* More scanner console output coloring
2023-06-11 12:46:30 +02:00
sonninnos 8f5442da5b Improve CLI scan console output 2023-05-03 20:29:40 +02:00
sonninnos f5f1d35370 Add content import/scan via CLI 2023-05-03 20:29:40 +02:00
libretroadmin 07eddd7229 Cleanups 2023-04-23 16:09:24 +02:00
libretroadmin 4fa19e552a CXX_BUILD buildfixes 2023-02-23 17:09:45 +01:00
libretroadmin 2c42912185 More header cleanups 2022-12-05 15:15:07 +01:00
libretroadmin 04f510d503 Cleanup header includes 2022-12-05 15:10:19 +01:00
AKuHAK c3914d1c85
(database) Added serial scanning for PS2 (#14566)
reworked ps1 magic numbers
PS1 scan: fixed not scanned LSP titles, added PSX.EXE titles, extended ps1 serial variations
2022-10-30 17:21:48 +01:00
sonninnos 03c901dfb8
Playlist + database changes: (#14531)
- Cleanup 'entry_slot'
- Fallback label + logging
2022-10-18 21:32:54 +02:00
LibretroAdmin 30eb0edcf8 Use flags for some structs instead of tons of bools - less state/variables to bookkeep,
less memory used
2022-10-06 06:53:13 +02:00
Bobby Smith 82cac0f9ba
Fix Redump bin/cue scan for some DC games + add RVZ/WIA scan support for GC/Wii (#14380) 2022-09-06 01:52:01 +02:00
LibretroAdmin 6caa139700 (cheevos.c) Fix some function prototypes for C
Rewrite some snprintfs as strlcpy/strlcat/manual assignment - only
use snprintf if we actually need the formatting
2022-08-25 15:08:02 +02:00
lucasmr 808fc7f389
Refactor task_database_cue.c (#14349) 2022-08-25 04:42:23 +02:00
LibretroAdmin f2d8b67f23 (task_database_cue.c) Simplifications:
- unsafe strcpy/strcat/sprintf were used, so pass 'len' parameters
to detect_{system} functions so that we can use the safer strlcpy/strlcat
calls instead
- thanks to strlcat/strlcpy return values, we can do less string concatenations
and get the same results
- some other miscellanous cleanups
2022-08-24 16:08:06 +02:00
LibretroAdmin fdc563e6f7
Remove errno dep (task_database_cue.c) (#14341)
* (task_database_cue.c) Turn some functions static - some general cleanups

* Start removing errno dependency on task_database_cue.c
2022-08-24 15:15:21 +02:00
LibretroAdmin fc861c167c - Get rid of some strerror usage
- Get rid of errno.h include in task_audio_mixer.c
- Rename get_token so it has less chance to conflict with other symbols
2022-08-23 19:58:20 +02:00
LibretroAdmin b2634ea588 * Create fill_pathname_join_special - and specify fill_pathname_join
as deprecated.
* Use fill_pathname_join_special in the vast majority of cases where
we can ensure out_path is a new empty string
* Get rid of some extension concatenation with strlcat where encountered
* Some general cleanups with NULL termination of strings that get immediately
passed to strlcpy/strlcpy-adjacent functions
2022-08-04 14:19:38 +02:00
LibretroAdmin 19e4b8c0ca Fix DEBUG codepath 2022-07-30 12:50:59 +02:00
LibretroAdmin 592f9384b0 Silence code analysis warnings by Xcode - unused variables - nothing
done with value set - etc
2022-07-29 08:29:43 +02:00
libretroadmin 8ac1a36259 Don't do NULL termination on strings when passing to strlcpy and/or
a file_path function that calls strlcpy under the hood
2022-07-26 07:01:10 +02:00
LibretroAdmin 29774f5b7a
Small opts (#14186)
* (joypad_connection) Small optimizations -
* Turn functions static where possible
* Hose strlen call out of loop

* (input_driver.c) General cleanups:
* Some small code/style nits

task_screenshot.c:
* Move widget callback function for screenshots to task_screenshot.c

(file_path.c):
* Turn get_pathname_num_slashes into static function
* path_linked_list_free - always returns true, so get rid of return value
* path_linked_list_new - fix function signature
* path_get_archive_delim - do not NULL-terminate string, already done by strlcpy later on

General:
* Slight optimizations - use int/size_t for loop counter variable instead of unsigned
* Take advantage of fact that strlcpy already NULL-terminates, so don't do this explicitly
outside if we're just going to end up calling strlcpy/fill_pathname_join on it anyway
2022-07-19 10:01:33 +02:00
libretroadmin f7194e167f use path_basename_nocompression where it is safe to do so 2022-07-12 19:14:12 +02:00
libretroadmin b7926605f4 Remove fill_short_pathname_representation 2022-07-11 21:40:09 +02:00
libretroadmin d706c9c5bf Start deprecating trivial functions in file_path.c 2022-07-11 19:56:46 +02:00