Bläddra i källkod

Clang Format.

Fernando Sahmkow 6 år sedan
förälder
incheckning
467d43570e

+ 7 - 7
src/common/atomic_ops.cpp

@@ -35,26 +35,26 @@ bool AtomicCompareAndSwap(u64 volatile* pointer, u64 value, u64 expected) {
 }
 
 bool AtomicCompareAndSwap(u64 volatile* pointer, u128 value, u128 expected) {
-    return _InterlockedCompareExchange128((__int64*)pointer, value[1], value[0], (__int64*)expected.data()) != 0;
+    return _InterlockedCompareExchange128((__int64*)pointer, value[1], value[0],
+                                          (__int64*)expected.data()) != 0;
 }
 
-
 #else
 
 bool AtomicCompareAndSwap(u8 volatile* pointer, u8 value, u8 expected) {
-    return __sync_bool_compare_and_swap (pointer, value, expected);
+    return __sync_bool_compare_and_swap(pointer, value, expected);
 }
 
 bool AtomicCompareAndSwap(u16 volatile* pointer, u16 value, u16 expected) {
-    return __sync_bool_compare_and_swap (pointer, value, expected);
+    return __sync_bool_compare_and_swap(pointer, value, expected);
 }
 
 bool AtomicCompareAndSwap(u32 volatile* pointer, u32 value, u32 expected) {
-    return __sync_bool_compare_and_swap (pointer, value, expected);
+    return __sync_bool_compare_and_swap(pointer, value, expected);
 }
 
 bool AtomicCompareAndSwap(u64 volatile* pointer, u64 value, u64 expected) {
-    return __sync_bool_compare_and_swap (pointer, value, expected);
+    return __sync_bool_compare_and_swap(pointer, value, expected);
 }
 
 bool AtomicCompareAndSwap(u64 volatile* pointer, u128 value, u128 expected) {
@@ -62,7 +62,7 @@ bool AtomicCompareAndSwap(u64 volatile* pointer, u128 value, u128 expected) {
     unsigned __int128 expected_a;
     std::memcpy(&value_a, value.data(), sizeof(u128));
     std::memcpy(&expected_a, expected.data(), sizeof(u128));
-    return __sync_bool_compare_and_swap ((unsigned __int128*)pointer, value_a, expected_a);
+    return __sync_bool_compare_and_swap((unsigned __int128*)pointer, value_a, expected_a);
 }
 
 #endif

+ 1 - 1
src/common/atomic_ops.h

@@ -8,7 +8,7 @@
 
 namespace Common {
 
-bool AtomicCompareAndSwap(u8 volatile * pointer, u8 value, u8 expected);
+bool AtomicCompareAndSwap(u8 volatile* pointer, u8 value, u8 expected);
 bool AtomicCompareAndSwap(u16 volatile* pointer, u16 value, u16 expected);
 bool AtomicCompareAndSwap(u32 volatile* pointer, u32 value, u32 expected);
 bool AtomicCompareAndSwap(u64 volatile* pointer, u64 value, u64 expected);

+ 15 - 15
src/common/thread.cpp

@@ -31,21 +31,21 @@ void SetCurrentThreadPriority(ThreadPriority new_priority) {
     auto handle = GetCurrentThread();
     int windows_priority = 0;
     switch (new_priority) {
-        case ThreadPriority::Low:
-            windows_priority = THREAD_PRIORITY_BELOW_NORMAL;
-            break;
-        case ThreadPriority::Normal:
-            windows_priority = THREAD_PRIORITY_NORMAL;
-            break;
-        case ThreadPriority::High:
-            windows_priority = THREAD_PRIORITY_ABOVE_NORMAL;
-            break;
-        case ThreadPriority::VeryHigh:
-            windows_priority = THREAD_PRIORITY_HIGHEST;
-            break;
-        default:
-            windows_priority = THREAD_PRIORITY_NORMAL;
-            break;
+    case ThreadPriority::Low:
+        windows_priority = THREAD_PRIORITY_BELOW_NORMAL;
+        break;
+    case ThreadPriority::Normal:
+        windows_priority = THREAD_PRIORITY_NORMAL;
+        break;
+    case ThreadPriority::High:
+        windows_priority = THREAD_PRIORITY_ABOVE_NORMAL;
+        break;
+    case ThreadPriority::VeryHigh:
+        windows_priority = THREAD_PRIORITY_HIGHEST;
+        break;
+    default:
+        windows_priority = THREAD_PRIORITY_NORMAL;
+        break;
     }
     SetThreadPriority(handle, windows_priority);
 }

+ 2 - 2
src/core/arm/unicorn/arm_unicorn.cpp

@@ -63,8 +63,8 @@ static bool UnmappedMemoryHook(uc_engine* uc, uc_mem_type type, u64 addr, int si
     return false;
 }
 
-ARM_Unicorn::ARM_Unicorn(System& system, CPUInterrupts& interrupt_handlers,
-                         bool uses_wall_clock, Arch architecture, std::size_t core_index)
+ARM_Unicorn::ARM_Unicorn(System& system, CPUInterrupts& interrupt_handlers, bool uses_wall_clock,
+                         Arch architecture, std::size_t core_index)
     : ARM_Interface{system, interrupt_handlers, uses_wall_clock}, core_index{core_index} {
     const auto arch = architecture == Arch::AArch32 ? UC_ARCH_ARM : UC_ARCH_ARM64;
     CHECKED(uc_open(arch, UC_MODE_ARM, &uc));

+ 2 - 2
src/core/arm/unicorn/arm_unicorn.h

@@ -20,8 +20,8 @@ public:
         AArch64, // 64-bit ARM
     };
 
-    explicit ARM_Unicorn(System& system, CPUInterrupts& interrupt_handlers,
-                         bool uses_wall_clock, Arch architecture, std::size_t core_index);
+    explicit ARM_Unicorn(System& system, CPUInterrupts& interrupt_handlers, bool uses_wall_clock,
+                         Arch architecture, std::size_t core_index);
     ~ARM_Unicorn() override;
 
     void SetPC(u64 pc) override;

+ 0 - 2
src/core/core.h

@@ -148,8 +148,6 @@ public:
      */
     ResultStatus Pause();
 
-
-
     /**
      * Step the CPU one instruction
      * @return Result status, indicating whether or not the operation succeeded.

+ 5 - 6
src/core/hle/kernel/mutex.cpp

@@ -9,7 +9,6 @@
 #include "common/assert.h"
 #include "common/logging/log.h"
 #include "core/core.h"
-#include "core/core.h"
 #include "core/hle/kernel/errors.h"
 #include "core/hle/kernel/handle_table.h"
 #include "core/hle/kernel/kernel.h"
@@ -126,11 +125,11 @@ ResultCode Mutex::TryAcquire(VAddr address, Handle holding_thread_handle,
 
 std::pair<ResultCode, std::shared_ptr<Thread>> Mutex::Unlock(std::shared_ptr<Thread> owner,
                                                              VAddr address) {
-     // The mutex address must be 4-byte aligned
-     if ((address % sizeof(u32)) != 0) {
-         LOG_ERROR(Kernel, "Address is not 4-byte aligned! address={:016X}", address);
-         return {ERR_INVALID_ADDRESS, nullptr};
-     }
+    // The mutex address must be 4-byte aligned
+    if ((address % sizeof(u32)) != 0) {
+        LOG_ERROR(Kernel, "Address is not 4-byte aligned! address={:016X}", address);
+        return {ERR_INVALID_ADDRESS, nullptr};
+    }
 
     auto [new_owner, num_waiters] = GetHighestPriorityMutexWaitingThread(owner, address);
     if (new_owner == nullptr) {

+ 2 - 1
src/core/hle/kernel/mutex.h

@@ -29,7 +29,8 @@ public:
                           Handle requesting_thread_handle);
 
     /// Unlocks a mutex for owner at address
-    std::pair<ResultCode, std::shared_ptr<Thread>> Unlock(std::shared_ptr<Thread> owner, VAddr address);
+    std::pair<ResultCode, std::shared_ptr<Thread>> Unlock(std::shared_ptr<Thread> owner,
+                                                          VAddr address);
 
     /// Releases the mutex at the specified address.
     ResultCode Release(VAddr address);

+ 3 - 4
src/core/hle/kernel/physical_core.h

@@ -10,7 +10,7 @@
 #include "core/arm/cpu_interrupt_handler.h"
 
 namespace Common {
-    class SpinLock;
+class SpinLock;
 }
 
 namespace Kernel {
@@ -27,9 +27,8 @@ namespace Kernel {
 
 class PhysicalCore {
 public:
-    PhysicalCore(Core::System& system, std::size_t id,
-                               Kernel::Scheduler& scheduler,
-                               Core::CPUInterruptHandler& interrupt_handler);
+    PhysicalCore(Core::System& system, std::size_t id, Kernel::Scheduler& scheduler,
+                 Core::CPUInterruptHandler& interrupt_handler);
     ~PhysicalCore();
 
     PhysicalCore(const PhysicalCore&) = delete;

+ 1 - 1
src/core/hle/kernel/server_session.cpp

@@ -17,9 +17,9 @@
 #include "core/hle/kernel/hle_ipc.h"
 #include "core/hle/kernel/kernel.h"
 #include "core/hle/kernel/process.h"
+#include "core/hle/kernel/scheduler.h"
 #include "core/hle/kernel/server_session.h"
 #include "core/hle/kernel/session.h"
-#include "core/hle/kernel/scheduler.h"
 #include "core/hle/kernel/thread.h"
 #include "core/memory.h"
 

+ 0 - 1
src/yuzu/bootmanager.cpp

@@ -71,7 +71,6 @@ void EmuThread::run() {
 
     gpu.ReleaseContext();
 
-
     // Holds whether the cpu was running during the last iteration,
     // so that the DebugModeLeft signal can be emitted before the
     // next execution step

+ 2 - 1
src/yuzu/bootmanager.h

@@ -62,7 +62,8 @@ public:
         if (!running) {
             running_wait.Set();
             /// Wait until effectively paused
-            while (running_guard);
+            while (running_guard)
+                ;
         }
     }
 

+ 3 - 2
src/yuzu/debugger/wait_tree.cpp

@@ -127,11 +127,12 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeCallstack::GetChildren() cons
         return list;
     }
 
-    auto backtrace = Core::ARM_Interface::GetBacktraceFromContext(Core::System::GetInstance(), thread.GetContext64());
+    auto backtrace = Core::ARM_Interface::GetBacktraceFromContext(Core::System::GetInstance(),
+                                                                  thread.GetContext64());
 
     for (auto& entry : backtrace) {
         std::string s = fmt::format("{:20}{:016X} {:016X} {:016X} {}", entry.module, entry.address,
-                  entry.original_address, entry.offset, entry.name);
+                                    entry.original_address, entry.offset, entry.name);
         list.push_back(std::make_unique<WaitTreeText>(QString::fromStdString(s)));
     }
 

+ 6 - 3
src/yuzu/main.cpp

@@ -534,7 +534,8 @@ void GMainWindow::InitializeWidgets() {
         if (emulation_running) {
             return;
         }
-        bool is_async = !Settings::values.use_asynchronous_gpu_emulation || Settings::values.use_multi_core;
+        bool is_async =
+            !Settings::values.use_asynchronous_gpu_emulation || Settings::values.use_multi_core;
         Settings::values.use_asynchronous_gpu_emulation = is_async;
         async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation);
         Settings::Apply();
@@ -552,7 +553,8 @@ void GMainWindow::InitializeWidgets() {
             return;
         }
         Settings::values.use_multi_core = !Settings::values.use_multi_core;
-        bool is_async = Settings::values.use_asynchronous_gpu_emulation || Settings::values.use_multi_core;
+        bool is_async =
+            Settings::values.use_asynchronous_gpu_emulation || Settings::values.use_multi_core;
         Settings::values.use_asynchronous_gpu_emulation = is_async;
         async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation);
         multicore_status_button->setChecked(Settings::values.use_multi_core);
@@ -1958,7 +1960,8 @@ void GMainWindow::OnConfigure() {
 
     dock_status_button->setChecked(Settings::values.use_docked_mode);
     multicore_status_button->setChecked(Settings::values.use_multi_core);
-    Settings::values.use_asynchronous_gpu_emulation = Settings::values.use_asynchronous_gpu_emulation || Settings::values.use_multi_core;
+    Settings::values.use_asynchronous_gpu_emulation =
+        Settings::values.use_asynchronous_gpu_emulation || Settings::values.use_multi_core;
     async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation);
 
 #ifdef HAS_VULKAN