From ce6a01bd418913f41d87b3c6a7edf76239aad656 Mon Sep 17 00:00:00 2001 From: IndecisiveTurtle <47210458+raphaelthegreat@users.noreply.github.com> Date: Mon, 15 Jul 2024 03:47:10 +0300 Subject: [PATCH] clang format --- src/core/file_sys/fs.h | 11 ++++------- src/core/libraries/kernel/event_flag/event_flag_obj.h | 2 +- src/core/libraries/kernel/event_queues.cpp | 3 +-- src/core/libraries/save_data/savedata.cpp | 2 +- src/core/tls.cpp | 8 ++++---- src/shader_recompiler/ir/breadth_first_search.h | 4 ++-- src/shader_recompiler/ir/opcodes.h | 2 +- 7 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/core/file_sys/fs.h b/src/core/file_sys/fs.h index 10fd10c4..ede386e5 100644 --- a/src/core/file_sys/fs.h +++ b/src/core/file_sys/fs.h @@ -27,18 +27,15 @@ public: explicit MntPoints() = default; ~MntPoints() = default; - void Mount(const std::filesystem::path& host_folder, - const std::string& guest_folder); - void Unmount(const std::filesystem::path& host_folder, - const std::string& guest_folder); + void Mount(const std::filesystem::path& host_folder, const std::string& guest_folder); + void Unmount(const std::filesystem::path& host_folder, const std::string& guest_folder); void UnmountAll(); std::filesystem::path GetHostPath(const std::string& guest_directory); const MntPair* GetMount(const std::string& guest_path) { - const auto it = std::ranges::find_if(m_mnt_pairs, [&](const auto& mount) { - return guest_path.starts_with(mount.mount); - }); + const auto it = std::ranges::find_if( + m_mnt_pairs, [&](const auto& mount) { return guest_path.starts_with(mount.mount); }); return it == m_mnt_pairs.end() ? nullptr : &*it; } diff --git a/src/core/libraries/kernel/event_flag/event_flag_obj.h b/src/core/libraries/kernel/event_flag/event_flag_obj.h index fe50be69..99ae1981 100644 --- a/src/core/libraries/kernel/event_flag/event_flag_obj.h +++ b/src/core/libraries/kernel/event_flag/event_flag_obj.h @@ -20,7 +20,7 @@ public: EventFlagInternal(const std::string& name, ThreadMode thread_mode, QueueMode queue_mode, uint64_t bits) - : m_name(name), m_thread_mode(thread_mode), m_queue_mode(queue_mode), m_bits(bits){}; + : m_name(name), m_thread_mode(thread_mode), m_queue_mode(queue_mode), m_bits(bits) {}; int Wait(u64 bits, WaitMode wait_mode, ClearMode clear_mode, u64* result, u32* ptr_micros); int Poll(u64 bits, WaitMode wait_mode, ClearMode clear_mode, u64* result); diff --git a/src/core/libraries/kernel/event_queues.cpp b/src/core/libraries/kernel/event_queues.cpp index e42cc60d..bb3d8ba7 100644 --- a/src/core/libraries/kernel/event_queues.cpp +++ b/src/core/libraries/kernel/event_queues.cpp @@ -134,8 +134,7 @@ s32 PS4_SYSV_ABI sceKernelAddHRTimerEvent(SceKernelEqueue eq, int id, timespec* event.timer = std::make_unique( io_context, std::chrono::microseconds(total_us - HrTimerSpinlockThresholdUs)); - event.timer->async_wait( - std::bind(SmallTimerCallback, std::placeholders::_1, eq, event.event)); + event.timer->async_wait(std::bind(SmallTimerCallback, std::placeholders::_1, eq, event.event)); if (!eq->AddEvent(event)) { return ORBIS_KERNEL_ERROR_ENOMEM; diff --git a/src/core/libraries/save_data/savedata.cpp b/src/core/libraries/save_data/savedata.cpp index 2a2855cc..9f3564e8 100644 --- a/src/core/libraries/save_data/savedata.cpp +++ b/src/core/libraries/save_data/savedata.cpp @@ -536,7 +536,7 @@ int PS4_SYSV_ABI sceSaveDataSaveIcon(const OrbisSaveDataMountPoint* mountPoint, const auto mount_dir = mnt->GetHostPath(mountPoint->data); LOG_INFO(Lib_SaveData, "called = {}", mount_dir.native()); - if (icon != nullptr) { + if (icon != nullptr) { Common::FS::IOFile file(mount_dir / "save_data.png", Common::FS::FileAccessMode::Write); file.WriteRaw(icon->buf, icon->bufSize); } diff --git a/src/core/tls.cpp b/src/core/tls.cpp index 2afa5896..0c2d973b 100644 --- a/src/core/tls.cpp +++ b/src/core/tls.cpp @@ -9,8 +9,8 @@ #ifdef _WIN32 #include #else -#include /* Definition of ARCH_* constants */ -#include /* Definition of SYS_* constants */ +#include /* Definition of ARCH_* constants */ +#include /* Definition of SYS_* constants */ #endif namespace Core { @@ -93,12 +93,12 @@ static void PatchFsAccess(u8* code, const TLSPattern& tls_pattern, Xbyak::CodeGe static u32 slot = 0; void SetTcbBase(void* image_address) { - asm volatile("wrgsbase %0" :: "r" (image_address) : "memory"); + asm volatile("wrgsbase %0" ::"r"(image_address) : "memory"); } Tcb* GetTcbBase() { Tcb* tcb; - asm volatile("rdgsbase %0" : "=r" (tcb) :: "memory"); + asm volatile("rdgsbase %0" : "=r"(tcb)::"memory"); return tcb; } diff --git a/src/shader_recompiler/ir/breadth_first_search.h b/src/shader_recompiler/ir/breadth_first_search.h index 21a34a90..be46b48c 100644 --- a/src/shader_recompiler/ir/breadth_first_search.h +++ b/src/shader_recompiler/ir/breadth_first_search.h @@ -12,8 +12,8 @@ namespace Shader::IR { template -auto BreadthFirstSearch(const Value& value, Pred&& pred) - -> std::invoke_result_t { +auto BreadthFirstSearch(const Value& value, + Pred&& pred) -> std::invoke_result_t { if (value.IsImmediate()) { // Nothing to do with immediates return std::nullopt; diff --git a/src/shader_recompiler/ir/opcodes.h b/src/shader_recompiler/ir/opcodes.h index 66b60221..22cc8c2b 100644 --- a/src/shader_recompiler/ir/opcodes.h +++ b/src/shader_recompiler/ir/opcodes.h @@ -52,7 +52,7 @@ constexpr Type F64x2{Type::F64x2}; constexpr Type F64x3{Type::F64x3}; constexpr Type F64x4{Type::F64x4}; -constexpr OpcodeMeta META_TABLE[]{ +constexpr OpcodeMeta META_TABLE[] { #define OPCODE(name_token, type_token, ...) \ { \ .name{#name_token}, \