From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- src/core/core_timing.cpp | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'src/core/core_timing.cpp') diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index aba22cdd1..b7b988cf1 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -21,14 +21,13 @@ int g_clock_rate_arm11 = 268123480; #define INITIAL_SLICE_LENGTH 20000 #define MAX_SLICE_LENGTH 100000000 -namespace CoreTiming -{ -struct EventType -{ - EventType() {} +namespace CoreTiming { +struct EventType { + EventType() { + } - EventType(TimedCallback cb, const char* n) - : callback(cb), name(n) {} + EventType(TimedCallback cb, const char* n) : callback(cb), name(n) { + } TimedCallback callback; const char* name; @@ -36,8 +35,7 @@ struct EventType static std::vector event_types; -struct BaseEvent -{ +struct BaseEvent { s64 time; u64 userdata; int type; @@ -200,7 +198,6 @@ u64 GetIdleTicks() { return (u64)idled_cycles; } - // This is to be called when outside threads, such as the graphics thread, wants to // schedule things to be executed on the main thread. void ScheduleEvent_Threadsafe(s64 cycles_into_future, int event_type, u64 userdata) { @@ -222,12 +219,11 @@ void ScheduleEvent_Threadsafe(s64 cycles_into_future, int event_type, u64 userda // Same as ScheduleEvent_Threadsafe(0, ...) EXCEPT if we are already on the CPU thread // in which case the event will get handled immediately, before returning. void ScheduleEvent_Threadsafe_Immediate(int event_type, u64 userdata) { - if (false) //Core::IsCPUThread()) + if (false) // Core::IsCPUThread()) { std::lock_guard lock(external_event_section); event_types[event_type].callback(userdata, 0); - } - else + } else ScheduleEvent_Threadsafe(0, event_type, userdata); } @@ -317,8 +313,7 @@ s64 UnscheduleThreadsafeEvent(int event_type, u64 userdata) { } } - if (!ts_first) - { + if (!ts_first) { ts_last = nullptr; return result; } @@ -369,7 +364,7 @@ void RemoveEvent(int event_type) { return; while (first) { if (first->type == event_type) { - Event *next = first->next; + Event* next = first->next; FreeEvent(first); first = next; } else { @@ -509,7 +504,8 @@ void Advance() { void LogPendingEvents() { Event* event = first; while (event) { - //LOG_TRACE(Core_Timing, "PENDING: Now: %lld Pending: %lld Type: %d", globalTimer, next->time, next->type); + // LOG_TRACE(Core_Timing, "PENDING: Now: %lld Pending: %lld Type: %d", globalTimer, + // next->time, next->type); event = event->next; } } @@ -531,7 +527,8 @@ void Idle(int max_idle) { } } - LOG_TRACE(Core_Timing, "Idle for %" PRId64 " cycles! (%f ms)", cycles_down, cycles_down / (float)(g_clock_rate_arm11 * 0.001f)); + LOG_TRACE(Core_Timing, "Idle for %" PRId64 " cycles! (%f ms)", cycles_down, + cycles_down / (float)(g_clock_rate_arm11 * 0.001f)); idled_cycles += cycles_down; Core::g_app_core->down_count -= cycles_down; @@ -551,7 +548,7 @@ std::string GetScheduledEventsSummary() { if (!name) name = "[unknown]"; text += Common::StringFromFormat("%s : %i %08x%08x\n", name, (int)event->time, - (u32)(event->userdata >> 32), (u32)(event->userdata)); + (u32)(event->userdata >> 32), (u32)(event->userdata)); event = event->next; } return text; -- cgit v1.2.3 From 396a8d91a4423d9c793eeff0798d544613647511 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sun, 18 Sep 2016 18:01:46 -0700 Subject: Manually tweak source formatting and then re-run clang-format --- src/core/core_timing.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/core/core_timing.cpp') diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index b7b988cf1..fb88ecaf2 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -23,11 +23,9 @@ int g_clock_rate_arm11 = 268123480; namespace CoreTiming { struct EventType { - EventType() { - } + EventType() {} - EventType(TimedCallback cb, const char* n) : callback(cb), name(n) { - } + EventType(TimedCallback cb, const char* n) : callback(cb), name(n) {} TimedCallback callback; const char* name; -- cgit v1.2.3 From ebdae19fd226104baec712b9da9939ff82ef3c3a Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 21 Sep 2016 00:21:23 +0900 Subject: Remove empty newlines in #include blocks. This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation. --- src/core/core_timing.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/core/core_timing.cpp') diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index fb88ecaf2..4f38403e3 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -2,17 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/core.h" #include #include #include #include - #include "common/chunk_file.h" #include "common/logging/log.h" #include "common/string_util.h" - #include "core/arm/arm_interface.h" -#include "core/core.h" #include "core/core_timing.h" int g_clock_rate_arm11 = 268123480; -- cgit v1.2.3 From 84fbbe26297652d994d203bde543ec252c2d801a Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Tue, 20 Sep 2016 23:52:38 -0700 Subject: Use negative priorities to avoid special-casing the self-include --- src/core/core_timing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/core_timing.cpp') diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 4f38403e3..5220b55ea 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/core.h" #include #include #include @@ -11,6 +10,7 @@ #include "common/logging/log.h" #include "common/string_util.h" #include "core/arm/arm_interface.h" +#include "core/core.h" #include "core/core_timing.h" int g_clock_rate_arm11 = 268123480; -- cgit v1.2.3