Commit Graph

120 Commits

Author SHA1 Message Date
libretroadmin
3fbcde000c (string_list) Silence warning 2022-11-23 05:10:35 +01:00
libretroadmin
1c9d3ad0bf Silence some warnings 2022-11-21 20:56:28 +01:00
LibretroAdmin
1e035b9385 (file_list) Get rid of superfluous small functions 2022-09-04 17:52:06 +02:00
LibretroAdmin
dfb4b603e4 Get rid of superfluous wrapper function file_list_get_at_offset 2022-09-04 07:30:21 +02:00
LibretroAdmin
1a24bfe60c (file_list) Get rid of useless wrapper functions 2022-09-04 05:39:16 +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
107c69ab9e (libretro-common) More documentation refinement 2022-08-01 11:03:58 +02:00
libretroadmin
8d12918243 (libretro-common) Small cleanups - don't NULL-terminate string
if we pass it off to fill_pathname_join (or another function that
uses strlcpy under the hood)
2022-07-22 19:33:30 +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
83655420f6 file_list_prepend just a thin wrapper around file_list_insert - get
rid of it and just pass 0 as the last argument instead
2022-07-12 16:56:44 +02:00
libretroadmin
0e85113eb3 (libretro-common) Style nits/cleanups 2022-07-10 18:13:49 +02:00
jdgleaver
f58c7f69d9 (nested_list) Fix heap-use-after-free errors due to pointer invalidation when resizing internal RBUF arrays 2021-08-09 23:08:17 +01:00
jdgleaver
fe1f311a35 Add core option category support 2021-08-06 15:33:47 +01:00
Norman Jordan
528af55abd Adding a generic queue and linked list.
Both accept (void *) values. Also added some unit tests using CHECK.
2021-05-05 10:41:13 -07:00
twinaphex
a772eb550d file_list_get_size - list can be NULL, in which case return 0 2021-01-21 00:24:32 +01:00
twinaphex
7867c4b70e Get rid of file_list_get_size calls - one line wrapper function 2021-01-20 08:31:05 +01:00
twinaphex
044209bc5a Create string_separate_noalloc 2020-08-26 23:46:16 +02:00
twinaphex
61c94fe248 Simplify string_list_new/string_list_initialize 2020-08-26 17:50:18 +02:00
jdgleaver
7a07cc1305 Fix 'Set Core Association' regression 2020-08-26 15:18:39 +01:00
twinaphex
662e37f670 Replace more instances of string_split 2020-08-26 13:35:05 +02:00
twinaphex
6df62bbccc Create string_split_noalloc 2020-08-26 03:20:42 +02:00
twinaphex
a32d027f76 string_list_initialize - call deinitialize when function fails 2020-08-26 02:28:10 +02:00
jdgleaver
179e77c8b0 (string_list_join_concat) Prevent undefined behaviour if input string buffer is unterminated 2020-08-25 15:54:18 +01:00
twinaphex
8a479e6006 Create dir_list_initialize/dir_list_deinitialize 2020-08-24 18:56:25 +02:00
twinaphex
91cfcd1b83 Improve string_list_deinitialize 2020-08-24 15:11:38 +02:00
twinaphex
7a6b9fd1b2 (Ozone) Horizontal list - put on stack - it's already on heap-allocated
struct as is
2020-08-24 10:22:32 +02:00
twinaphex
93fa9a0194 Add file_list_deinitialize - does everything that file_list_free
does except for freeing the passed struct pointer
2020-08-24 01:45:45 +02:00
twinaphex
0a69d14b11 Reimplement slang_preprocess_parse_parameters 2020-08-24 00:54:24 +02:00
twinaphex
cd6e1cf3fa (libretro-common) string_list - add string_list_initialize
and string_list_deinitialize - takes a pointer to initialize
and deinitialize a string list, but importantly does not
implicitly allocate and deallocate the string list pointer
itself. This way, string lists can be put on the stack instead
of always implicitly being put on heap - the struct itself is
small enough to fit on stack
2020-08-24 00:43:55 +02:00
twinaphex
c1c3f75804 dir_list_read - avoid two strcmps 2020-06-27 22:26:20 +02:00
twinaphex
7cac61e5eb Use malloc instead of calloc when possible 2020-06-24 18:52:42 +02:00
twinaphex
cd9ca691ca (libretro-common) Update copyright 2020-01-31 15:43:42 +01:00
twinaphex
d8860104d3 Get rid of file_list_get_alt_at_offset 2019-08-20 06:13:33 +02:00
jdgleaver
5ac152a5f3 (glslang_util) Remove C++ 'isms' (where possible) 2019-08-12 13:10:50 +01:00
twinaphex
ce37405d29 (DirectSound) Add audio device selection - can set audio_device
either by name or by index
2019-07-26 02:36:41 +02:00
Brad Parker
9a52595ce3 cdrom: add function to get list of available drives (initial linux implementation), show list in "Dump Drive" menu entry 2019-07-03 14:19:32 -04:00
twinaphex
77e7bc7a1c Move stirng_list_clone to libretro-common 2019-06-09 06:10:28 +02:00
twinaphex
15e7078361 string_list_free - try to be safer 2019-05-22 05:28:41 +02:00
twinaphex
bcb474b3a3 (runahead) Cleanups - create core_free_game_info and move it to
core_impl.c - get rid of free_string_list and just reuse
string_list_free
2019-05-22 04:04:58 +02:00
twinaphex
9f297f5f7c Cleanups 2019-05-19 05:50:28 +02:00
twinaphex
63d9d4e2d3 (menu entries) Cleanups 2019-05-13 04:05:11 +02:00
twinaphex
bae73a0ccc Revert "(dir_list) Use string_is_equal_memcmp_fast"
This reverts commit c8ad747a46.
2019-04-29 04:03:57 +02:00
twinaphex
c8ad747a46 (dir_list) Use string_is_equal_memcmp_fast 2019-04-28 19:05:51 +02:00
twinaphex
e1b11593fc (file_list.c) Cleanups/optimizations 2019-04-27 07:32:40 +02:00
twinaphex
890e1eb064 (file_list.c) file_list_expand_if_needed - unroll this function 2019-04-27 07:21:50 +02:00
twinaphex
cec858748f (dir_list) Optimize dir_list_read 2019-04-26 08:23:56 +02:00
twinaphex
1433a587b2 (dir_list) Simplify parse_dir_entry 2019-04-26 07:54:37 +02:00
twinaphex
ad03ac055d dir_list - simplify dir_list_append 2019-04-26 06:36:55 +02:00
Twinaphex
076a0d2f56 (OSX) Code analysis cleanups 2019-04-08 23:13:39 +02:00
twinaphex
45b1ed33b2 (MSVC) Silence warning 2019-02-06 23:42:13 +01:00