Commit Graph

314 Commits

Author SHA1 Message Date
libretroadmin 2770470695 Rewrite find_last_slash - use one loop, skip two strrchr calls 2025-07-16 01:31:29 +02:00
libretroadmin 047f926540 use last_slash in file_path 2025-07-16 00:31:09 +02:00
libretroadmin d37068cfb8 Move code back 2025-07-15 23:35:37 +02:00
libretroadmin 1cc0f3273f (file_path) Optimize find_last_slash:
* Do one loop iteration inside the function instead of two
strrchr(s) for finding the forward and backwards slash
2025-07-14 18:44:49 +02:00
libretroadmin 9b6641c951 (file_path) fill_pathname_join_special - small tweak 2025-07-14 17:37:33 +02:00
libretroadmin 2d632fed54 file_path changes:
* improve fill_pathname_slash, no longer call strlcat
  - strlcat call would have been done in strlcat regardless
2025-07-14 17:26:15 +02:00
libretroadmin 215219dc51 Change libretro-common code back 2025-07-14 05:50:17 +02:00
libretroadmin de76511ee7 (file_path) Cleanups / refactors 2025-07-13 08:02:28 +02:00
libretroadmin e13140ba04 Rewrite some strlcat calls into strlcpy 2025-06-26 14:47:53 +02:00
pstef 281dff8956 Silence a stringop-overflow warning
Guard against an unlikely case.
2025-03-25 16:55:39 +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 31b7812720 Function argument name standardization 2025-01-17 04:16:12 +01:00
LibretroAdmin 86c9a43b08 Use path_get_extension_mutable 2025-01-16 21:09:19 +01:00
LibretroAdmin a5c9d9520f * Use fill_pathname_basedir where possible
* Move static variable to only function where it's used
* Change signature of file_path.c function
2025-01-15 22:17:59 +01:00
LibretroAdmin 047e04ed3e Standardize local len variable naming conventions 2025-01-15 15:00:12 +01:00
Eric Warmenhoven ef1b325978
Change return types for some path functions to size_t (#17303) 2024-12-28 22:26:30 +01:00
libretroadmin 8074a833aa Cleanups/less string copies and indirection 2024-12-24 21:07:31 +01:00
libretroadmin 02bcbffbab fill_pathname - one less string copy 2024-12-24 00:08:04 +01:00
libretroadmin 2b94bccad2 (fill_pathname_join_delim) - no longer use strlen 2024-12-23 23:42:56 +01:00
libretroadmin cdef3ff9f7 strftime - write directly into string instead of using intermediary copies 2024-12-23 07:10:03 +01:00
libretroadmin 6b8466f87a menu_driver_set_thumbnail_system/menu_driver_get_thumbnail_system
just small wrapper functions, remove
2024-12-22 04:53:04 +01:00
libretroadmin c492e46d96 Change function signature of fill_pathname_parent_dir 2024-12-19 20:51:33 +01:00
libretroadmin d94cc3af72 Simplify fill_pathname_application_path 2024-12-19 20:17:09 +01:00
libretroadmin 60e5858d51 fill_pathname_application_dir - use path_basedir instead of
path_basedir_wrapper
2024-12-18 23:39:24 +01:00
libretroadmin 6b801333e7 file_path - change function signatures - output char array always
is named 's', and size of it 'len'
2024-12-18 21:43:33 +01:00
Eric Warmenhoven 2650712cb3
Small tweaks to fill_pathname_application_path (#17268) 2024-12-18 11:29:58 -08:00
libretroadmin 4521f6bcb2 Cleanups 2024-12-18 20:15:58 +01:00
Viačasłaŭ 3019b926c2
Fix typos (#17068) 2024-10-01 17:36:33 -07:00
libretroadmin 23bd9686e5 Silence unused variable warnings 2024-09-11 15:48:43 +02:00
Jay Paul e61b3ae2ba
Sort Remaps by Connected Controller (#16747)
* 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.
2024-09-10 17:39:35 -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 b8391e233f * PATH_MAX_LENGTH redefined from 4096 to 2048
* 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
2024-09-09 05:47:32 +02:00
libretroadmin 0f7a665439 Resync libretro-common 2024-09-05 11:49:08 +02:00
libretroadmin 827e631903 (libretro-common) Some functions now return len 2024-06-15 12:47:51 +02:00
libretroadmin c022e4e624 Cut down on snprintf 2024-06-15 00:56:51 +02:00
Ryunam c5c86fe5e8
Allow all systems to check for backslashes (Windows) as last slash in path. Improves portable core logic (#15612) 2023-08-17 14:15:42 -07:00
libretroadmin f1c651053f - Use VK_FALSE/VK_TRUE consistently for Vulkan structts
- Some minuscule changes to file_path.c
2023-07-17 15:27:34 +02:00
libretroadmin a5f2903253 Simplify path_basename 2023-07-17 15:13:13 +02:00
libretroadmin 4a411eb1e5 Cut down on strlcats and use strftime return value 2023-07-17 11:26:48 +02:00
libretroadmin fe1297cc33 (file_path.c) Cut down on some strlcats 2023-07-17 10:09:34 +02:00
libretroadmin 4b6bd83780 Replace some more strlcat calls 2023-07-16 18:33:34 +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 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
libretroadmin 207dfe170c Small cleanups 2023-05-03 21:10:21 +02:00
libretroadmin b951a010fd Move strftime_am_pm to libretro-common and get rid of duplicated
function
2023-05-01 19:03:11 +02:00
libretroadmin 27ad653dbd Fixed another CXX_BUILD error 2023-02-23 17:11:26 +01:00
libretroadmin 4fa19e552a CXX_BUILD buildfixes 2023-02-23 17:09:45 +01:00
LibretroAdmin da13fb0f48 Don't include errno.h in files that don't justify its use 2022-08-25 05:19:30 +02:00
LibretroAdmin c7786a45e1 Create path_get_extension_mutable and use it in menu_explore function
for trivial extension replacement in string
2022-08-06 19:06:31 +02:00