Commit Graph

27 Commits

Author SHA1 Message Date
nishinji 97039b55b6 util: Use contains instead of find for strings (#3961)
* Update BUILDING.md

* util: Use contains instead of find for strings

also removed custom 'bit_cast'

Co-authored-by: 双子叶植物 <149964080+Dicot0721@users.noreply.github.com>

---------

Co-authored-by: nishinji <nishinji@users.noreply.github.com>
Co-authored-by: 双子叶植物 <149964080+Dicot0721@users.noreply.github.com>
2026-05-27 10:30:25 -03:00
bookmist 345d807488 Tick Tick Tick, thats the sound of 2025 flying by 2026-01-18 01:58:45 +03:00
bookmist 5aa398be89 vita3k: code cleanup and minor bugfixes
Fix bugs
* gui/disassembly_dialog: fix bug. Can't enter addresses >= 0x80000000
* utils/vc_runtime_checker: fix almost impossible AV in vc_runtime_checker
* util/net_utils: fix warning and error in parseHeaders function
* patch: fix almost impossible bug, also drop unused var
* modules/SceAvPlayer: fix error (wrong mutex)
* kernel: more correct value of export variable __sce_libcparam (NID:0xDF084DFA)
* interface.cpp/get_contents_path (Looks like mistype in duplicate search)

Needs recheck of refactoring. I found something strange, but I'm not sure if it's intended or not.
* renderer::vulkan/VKContext::VKContext (Looks like mistype in variable name)
* spirv_recompiler/create_fragment_inputs (Variable anonimous is always false here. It's not static and reinit every loop iteration)
* renderer/transfer: fix strange (and maybe never run) code if pixel format is unknown
* renderer/vulkan/replacement: fix some type to type converson

Refactoring and enhancements
* codec/atrac9: better error logs
* util/fs_utils: Function read_data which read file to vector. Also use it if possible
* util/log: custom formatter for Ptr<> type (it simplifies logging)
* util/tracy: set tracy_module_id variable static
* util/warning.h : header to cross-platform disable warnings
* renderer/transfer: fix strange (and maybe never run) code if pixel format is unknown
* nids: typo fix
* modules/module_parent: remove link to nids.inc from header
* modules/module_parent: move macro to other such macros in bridge.h
* kernel: refactoring use get_thread instead of lock_and_find
* mem/ptr: set type Ptr<T> trivial (trivially copiable, movable and so on)

Fix warnings:
* some retype in BitmapAllocator (mem-tests are OK)
* typecasts
* remove unused variables and fields
* push_back->emplace_back
* rename duplicate variables (usually in nested loops)
* drop excessive brackets
* remove some unused includes
* set 'static' for functions if possible
* gui:home_screen/draw_home_screen: same values around ? operator.
* convert declare SCE_*_ERROR_* to enums
* bracket initialisation instead of memset
* other compiler warnings
2025-04-16 23:03:10 +03:00
Pedro Montes Alcalde 4a14d546ba Tick Tick Tick, thats the sound of 2024 flying by (#3503) 2025-01-19 18:51:43 -03:00
oltolm c61895e6f4 vita3k: Add support for mingw-w64 (#3406)
* make the code compile on mingw-w64

* make compile with Clang 19

* make compile with GCC
2024-10-26 23:41:51 +02:00
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 c3e5707f48 modules/SceHttp: fix crash on HLE of creating https connection 2024-02-09 10:07:42 +03:00
Pedro Montes Alcalde 34565e3ef4 Vita2024K: Happy 2024 2024-01-01 12:36:32 -03:00
scribam 34310c6087 vita3k: Prefer contains() instead of find() + end() 2023-09-14 13:05:23 +02:00
Macdu e64fa370c7 modules: cleanup 2023-09-10 23:35:12 +02:00
bookmist 9c41b8a900 utils: implement stoi_def and use it instead of std::stoi 2023-07-17 15:09:15 +03:00
Pedro Montes Alcalde 3adf4642b5 http: Allow for responses bigger than 5KB and better accuracy (#2659) 2023-07-10 11:39:29 -03:00
bookmist befe57b3f2 modules/SceHttp: fix crash at HLE http on connection closing 2023-05-27 20:45:58 +03:00
bookmist 4ba2e086cc Vita3K: code cleanup and optimisations 2023-05-10 15:31:55 +03:00
Pedro Montes Alcalde 68e46369f4 net/http: Some improvements 2023-04-13 16:08:20 -03:00
EXtremeExploit 41a17e79c7 Planet Earth Season 2023 2023-01-02 10:46:20 +01:00
bookmist ac115990f0 modules/SceHttp: improved hard to understand check in sceHttpUriParse 2022-11-25 21:34:07 +03:00
bookmist 5b925f8fdc modules/SceHttp: fix memory errors in sceHttpUriParse 2022-11-22 15:40:16 +01:00
bookmist 8edd333400 Fix compiler warnings 2022-11-16 21:39:55 +03:00
bookmist f03c257a33 modules: Add Tracy to all implemented functions in implemented modules.
modules/tracy: module name macro
Remove unused hack from SceMp4, mark ScePgf/sceFontNewLib unimplemented
2022-10-29 20:35:17 +03:00
Pedro Montes Alcalde 660425bd93 renderer: Add tracy support to all commands 2022-10-22 23:42:31 -03:00
Pedro Montes Alcalde 38085cb158 tracy: Transfer the old implementations to new 2022-10-08 11:59:01 -03:00
Pedro Montes Alcalde 0a6ef4d903 http: Also return 0 on connection when disabled 2022-10-01 19:26:21 -03:00
Pedro Montes Alcalde b6e0a0e274 modules: Implement HTTP (#1676) 2022-09-25 17:23:26 -03:00
Macdu 9e6f279a33 modules/SceHttp: Fail on sceHttpInit 2022-05-10 01:08:09 +02:00
hobyst 168dfb19ca Add license notice on source files which didn't have one
- Also updated the copyright notice year on all files to 2021
2021-08-19 23:14:27 +02:00
Nicolas Jallamion 06299de242 emulator: Refactor file structure (#557)
Also:
- external: update some submodules.
2019-08-28 16:52:07 +03:00