Commit Graph

2084 Commits

Author SHA1 Message Date
LibretroAdmin
7507e20703 Revert "(RJSON) Combine multiple consecutive rjsonwriter_raw calls into one"
This reverts commit 82efa5a3d6.
2022-08-26 14:44:29 +02:00
LibretroAdmin
82efa5a3d6 (RJSON) Combine multiple consecutive rjsonwriter_raw calls into one
- significantly reduces the amount of function calls
2022-08-26 13:55:52 +02:00
LibretroAdmin
575e331fd1 If we already know the length of the string, use strldup instead.
Avoids the internal strlen call inside strdup, and strdup is a deprecated
function starting from MSVC2005 anyways.

NOTE: Do NOT pass STRLEN_CONST as n parameter to strldup, it needs to
be at least +1 character higher than the strlen return value of the same
string
2022-08-25 16:31:54 +02:00
LibretroAdmin
5bb3fbab93 Fix mistake in prior commit - should be concatenated to string 2022-08-25 15:17:31 +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
LibretroAdmin
f5ac33c0b6 Simplify task_database_cue.c code -
* Was copying pre_game_id into several memory buffers for no real reason,
gets rid of some unnecessary strncpy calls this way too
2022-08-25 07:15:27 +02:00
LibretroAdmin
88187e7ef2 * Start getting rid of strncpy
* steam.c - cleanups:
  * Use string_to_lower from libretro-common/stdstring.c instead of
    its own version
  * Some stylistic changes
  * Rewrite strncpy calls into strlcpy/strlcat/manual assignment
  * Make it C89 compliant
  * Some unused variables
2022-08-25 06:51:39 +02:00
LibretroAdmin
8017410098 task_database_cue_get_token - correct to 'if (rv < 0)' instead 2022-08-25 05:52:42 +02:00
LibretroAdmin
c841e191f7 (task_database_cue.c) Put this conditional back 2022-08-25 05:36:48 +02: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
39241699a0 Drop errno dependency in database_cue_get_token - was some legacy
code that is probably not needed
2022-08-25 04:51:00 +02:00
lucasmr
808fc7f389
Refactor task_database_cue.c (#14349) 2022-08-25 04:42:23 +02:00
LibretroAdmin
56a6c50728 (task_database_cue.c) Get rid of some strcmps 2022-08-24 16:32:55 +02:00
LibretroAdmin
c79904f8b3 (task_database_cue.c) More simplifications 2022-08-24 16:21:45 +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
6126a86259 Try to avoid sprintf/strcat/strcpy calls as much as possible in
RetroArch codebase
2022-08-24 13:49:05 +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
c04201927b
Don't make libretrodb dependent on errno anymore (#14340)
* Don't make libretrodb dependent on errno anymore
2022-08-23 19:36:52 +02:00
Jamiras
85c44f9245
more thread-awareness in task callbacks (#14337)
* more thread-awareness in task callbacks
2022-08-23 15:11:11 +02:00
LibretroAdmin
10a351228b * Rewrite some snprintfs
* task_steam.c - add license header
2022-08-20 19:17:28 +02:00
LibretroAdmin
4c4bec11f7 NULL termination already happens in strlcpy 2022-08-10 02:45:27 +02:00
LibretroAdmin
a6e210e9db Get rid of some strlcats 2022-08-08 22:41:32 +02:00
LibretroAdmin
0594df8cce Remove some unused variables 2022-08-04 22:41:17 +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
Cthulhu-throwaway
3aa1811ca9
(Network) Add getnameinfo_retro (#14278) 2022-08-04 13:22:49 +02:00
LibretroAdmin
e7f3432e48 Replace some trivial strlcat usage - use return value of preceding
strlcpy then simply append the extension to it at this location
2022-08-04 03:45:09 +02:00
LibretroAdmin
e4bff7c12c Move rjsonwriter helper inline functions over to separate file rjson_helpers.h 2022-08-01 17:41:34 +02:00
LibretroAdmin
f79875536a (libretro-common) Move file_crc32 out of encoding_crc32.c - we don't want file I/O
code in encodings/encoding_crc32.c
2022-08-01 14:04:01 +02:00
Cthulhu-throwaway
20c4407928
Add HAVE_IFINFO macro (#14265) 2022-08-01 07:51:02 +02:00
LibretroAdmin
f711940339 (task_database_cue.c) Use STRLEN_CONST macro for last param to
string_is_equal_fast instead of hardcoded magic numbers - sizeof
is compile-time so should be at no detriment to performance
2022-07-30 18:31:05 +02:00
kikmon
44f5cb2935
Improved success rate of Serial scanning on PS1 by adding support for the xx.xxx format (#14256)
Co-authored-by: papa <papa>
2022-07-30 18:22:04 +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
4afe0c55d5 (autoconfig) Go back to prior behavior 2022-07-28 18:21:06 +02:00
Cthulhu-throwaway
29f0ba2e71
(Network/Vita) Add net_ifinfo support (#14225) 2022-07-26 16:10:23 +01:00
Cthulhu-throwaway
8d4a64ab96
(Netplay) Disallow netplay start when content is not loaded for static core platforms (#14220) 2022-07-26 07:21:57 +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
kikmon
45d78f2a60
[PS1 Serial Scanning] (#14219)
Changed return value of detect_ps1_game function to actuially return a
failure when the Serial couldn't be extracted.
Scanner will then fallback on crc check, and usually ends up finding the
games in the database.

Co-authored-by: papa <papa>
2022-07-25 22:41:32 +02:00
libretroadmin
69a2d124c0 Don't do NULL termination on string if we pass it off to strlcpy
and/or a file_path function that uses strlcpy under the hood
2022-07-24 05:39:51 +02:00
Cthulhu-throwaway
cc7c310aa1
(Netplay) Refactor fork arguments (#14208) 2022-07-24 04:26:50 +02:00
Cthulhu-throwaway
eb36c35ebf
(Netplay) Fix content reload deadlocks on static core platforms #2 (#14202) 2022-07-23 03:08:26 +02:00
Cthulhu-throwaway
09d9366bc0
(Netplay) Fix content reload deadlocks on static core platforms (#14196) 2022-07-22 02:36:24 +02:00
libretroadmin
3cf7e881ec Get rid of unnecessary log spam about non-required/non-essential files/directories 2022-07-21 03:48:11 +02:00
libretroadmin
2cf6f6ce8f * Don't do NULL termination on string if we pass it to strlcpy
* Cleanups in connmanctl.c - abuse of strlcat, strlcpy should
precede it first and/or other more optimal ways of setting the path
2022-07-21 01:47:34 +02:00
libretroadmin
4b5c7856e6 Remove some more explicit NULL-termination when we're calling a
string function that calls strlcpy under the hood
2022-07-19 20:43:12 +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
c4fb055fdb Cleanups:
* Combine early return and assignment lines
* use path_basename_nocompression when possible
* Move variables to proper scope
2022-07-12 20:44:00 +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