Commit Graph

10 Commits

Author SHA1 Message Date
bookmist
1fda880a94 vita3k: big code cleanup
Improvements
* lang: a bit more verbose error on wrong lang xml

Bugfixes
* kernel/sync_primitives: fix theoretically possible AV
* modules/SceAudio: a bit more correct sceAudioOutSetConfig
* fix wrong objects initialisation ({0} -> {})

Warning fixes
* clang warning: Macro argument should be enclosed in parentheses
[bugprone-macro-parentheses]
* modules: set unsigned type for Sce*ErrorCode enums
* clang warning: variable might be not be initialized
* clang warning: Function returns by const value. Consider returning by non-const value instead.
* clang warning: Prefer transparent functors [modernize-use-transparent-functors]

Refactoring
* io/device: move functions implementation from .h to .cpp file
* vita3k: fix fs::path usage
* clang warning: 'if' statement is unnecessary; deleting null pointer has no effect
* vita3k: use structured bindings and references in for-each-loops
* vita3k: simplify container operations, extract frequent operations to utility functions
* clang⚠️ 'contains' member function can be used
* kernel/sync_primitives: refactoring. drop unused parameter of handle_timeout
* vita3k: drop unused function parameters

* vita3k: fix typecasts
use static_cast instead of reinterpret casts if possible
use correct constants (1/1.0/1.0f)
correct variable types to minimise typecasts
use explicit typecasts (not everywhere)
replace c-style typecasts to c++ style typecasts (not everywhere)
* clang warning: remove redundant typecasts
* clang warning: Cast drops const qualifier

Optimisation
* vita3k: remove unused includes
* clang warning: Constness of returning variable prevents automatic move
[performance-no-automatic-move]
* clang warning: String concatenation results in allocation of unnecessary temporary strings
[performance-inefficient-string-concatenation]
* vita3k: use std::move
* vita3k: optimization. push_back -> emplace_back
* vita3k: fix datatypes to avoid unnesessary conversions
* clang warning: remove unneeded string->c_str->string conversion
* clang warning: The parameter is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
* clang warning: 'find' called with a string literal consisting of a single character
[performance-faster-string-find]
* clang warning: Result of a postfix operator is discarded, consider replacing it with a prefix operator
* clang warning: Pass value parameters by const reference

Code cleanup
* io/io: remove once used variables
* net/posixsocket: remove struct keyword
* vita3k: use raw string literals to avoid excessive escaping
* vita3k: refactoring. replace Ptr<> to pointer in Sce functions
* vita3k: drop unused variables and incorrect comments
* clang warning: readability-inconsistent-declaration-parameter-name
* clang warning: Extra ';' after member function definition
* clang warning: Possible misuse of comma operator (, is used instead of ;)
* clang warning: Algorithm accepting an iterator and a count can be used
* clang warning: Declaration and assignment can be joined
* clang warning: Type trait can be simplified using a template alias or a variable template

* vita3k: cleanup class methods
remove unimplemented (and obviously not used) methods
move deleted methods to public
change empty body to =default
remove auto constructors
set member default values
2024-03-18 15:44:56 +03:00
bookmist
d3f3038aee vita3k: set fs::path type for string paths and refactoring
avoid not need conversion string->wstring->string for linux and macos
native logging of fs::path
more correct conversion from std path to boost path
refactor pathes for shaders compiler, shorten parameters lists
crypto::hex_string: remove not needed null character as last character in string
2024-01-24 11:33:30 +03:00
Pedro Montes Alcalde
34565e3ef4
Vita2024K: Happy 2024 2024-01-01 12:36:32 -03:00
Zangetsu38
9990ea11b3 regmgr: refactor and fix int value.
- Refactor int value for get saved it in 4 byte in file.
- reworks spacing for get int same line of value name.
- Add type of value.
- No set init value if is 0 on str/bin.

Co-Authored-By: Macdu <Macdu@users.noreply.github.com>
2023-07-24 13:26:54 +02:00
Zangetsu38
2fac93d06d regmgr: fix crash when reg is missing on app try using it.
- remove loop for task on space, using vector char.
2023-07-21 14:52:02 +02:00
bookmist
9c41b8a900 utils: implement stoi_def and use it instead of std::stoi 2023-07-17 15:09:15 +03:00
Zangetsu38
8169f4ac23 regmgr: Add more id on get category and name by id.
- Fix crash when category/name is empty.
- Fix init regmgr when change pref path.
- Fix crash if value is not int for get int.
- Add Set default value if value is corrupted.
- Using vector for reg category template for keep order instead unordered map for fix broken file when switch pref path directory.
2023-07-14 13:21:29 +02:00
nishinji
37e334b3f4 regmgr: add one id missing on get gategory and name by id
Co-Authored-By: Zangetsu38 <Dante38@free.fr>
2023-07-11 23:46:23 +02:00
Zangetsu38
cccc8d46b2 regmgr: Move value from string to vector char.
- Reworks GetBin.
- Stub sceRegMgrGetKeysInfo.
2023-07-10 17:04:13 +02:00
Zangetsu38
5810acf29c modules/SceRegistryMgr: Initial implement of regmgr functions. 2023-07-09 14:03:17 +02:00