From e2d8be1ca2cee27eb17964dd99c71dfd12431506 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 16 Apr 2020 22:43:33 -0400 Subject: General: Resolve warnings related to missing declarations --- src/tests/core/core_timing.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/tests/core') diff --git a/src/tests/core/core_timing.cpp b/src/tests/core/core_timing.cpp index 1e3940801..ff2d11cc8 100644 --- a/src/tests/core/core_timing.cpp +++ b/src/tests/core/core_timing.cpp @@ -14,13 +14,14 @@ #include "core/core.h" #include "core/core_timing.h" +namespace { // Numbers are chosen randomly to make sure the correct one is given. -static constexpr std::array CB_IDS{{42, 144, 93, 1026, UINT64_C(0xFFFF7FFFF7FFFF)}}; -static constexpr int MAX_SLICE_LENGTH = 10000; // Copied from CoreTiming internals +constexpr std::array CB_IDS{{42, 144, 93, 1026, UINT64_C(0xFFFF7FFFF7FFFF)}}; +constexpr int MAX_SLICE_LENGTH = 10000; // Copied from CoreTiming internals -static std::bitset callbacks_ran_flags; -static u64 expected_callback = 0; -static s64 lateness = 0; +std::bitset callbacks_ran_flags; +u64 expected_callback = 0; +s64 lateness = 0; template void CallbackTemplate(u64 userdata, s64 cycles_late) { @@ -31,7 +32,7 @@ void CallbackTemplate(u64 userdata, s64 cycles_late) { REQUIRE(lateness == cycles_late); } -static u64 callbacks_done = 0; +u64 callbacks_done = 0; void EmptyCallback(u64 userdata, s64 cycles_late) { ++callbacks_done; @@ -48,8 +49,8 @@ struct ScopeInit final { Core::Timing::CoreTiming core_timing; }; -static void AdvanceAndCheck(Core::Timing::CoreTiming& core_timing, u32 idx, u32 context = 0, - int expected_lateness = 0, int cpu_downcount = 0) { +void AdvanceAndCheck(Core::Timing::CoreTiming& core_timing, u32 idx, u32 context = 0, + int expected_lateness = 0, int cpu_downcount = 0) { callbacks_ran_flags = 0; expected_callback = CB_IDS[idx]; lateness = expected_lateness; @@ -62,6 +63,7 @@ static void AdvanceAndCheck(Core::Timing::CoreTiming& core_timing, u32 idx, u32 REQUIRE(decltype(callbacks_ran_flags)().set(idx) == callbacks_ran_flags); } +} // Anonymous namespace TEST_CASE("CoreTiming[BasicOrder]", "[core]") { ScopeInit guard; -- cgit v1.2.3