From 0f326c606771ce9a21495df705d37408e2b5af90 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 22 Mar 2023 01:21:33 -0400 Subject: [PATCH] Common: Move FixedSizeQueue into Common namespace Gets this out of the global namespace. --- Source/Core/AudioCommon/SurroundDecoder.h | 2 +- Source/Core/Common/FixedSizeQueue.h | 3 +++ Source/Core/DolphinQt/Config/LogWidget.h | 2 +- Source/UnitTests/Common/FixedSizeQueueTest.cpp | 6 +++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/Core/AudioCommon/SurroundDecoder.h b/Source/Core/AudioCommon/SurroundDecoder.h index 9d18ee6060..06d4cf5500 100644 --- a/Source/Core/AudioCommon/SurroundDecoder.h +++ b/Source/Core/AudioCommon/SurroundDecoder.h @@ -29,7 +29,7 @@ private: std::unique_ptr m_fsdecoder; std::array m_float_conversion_buffer; - FixedSizeQueue m_decoded_fifo; + Common::FixedSizeQueue m_decoded_fifo; }; } // namespace AudioCommon diff --git a/Source/Core/Common/FixedSizeQueue.h b/Source/Core/Common/FixedSizeQueue.h index dc58aab865..63799e81f6 100644 --- a/Source/Core/Common/FixedSizeQueue.h +++ b/Source/Core/Common/FixedSizeQueue.h @@ -13,6 +13,8 @@ // // Not fully featured, no safety checking yet. Add features as needed. +namespace Common +{ template class FixedSizeQueue { @@ -84,3 +86,4 @@ private: // Sacrifice 4 bytes for a simpler implementation. may optimize away in the future. int count = 0; }; +} // namespace Common diff --git a/Source/Core/DolphinQt/Config/LogWidget.h b/Source/Core/DolphinQt/Config/LogWidget.h index 44f36c8834..ecaf9ea824 100644 --- a/Source/Core/DolphinQt/Config/LogWidget.h +++ b/Source/Core/DolphinQt/Config/LogWidget.h @@ -52,5 +52,5 @@ private: static constexpr int MAX_LOG_LINES = 5000; std::mutex m_log_mutex; - FixedSizeQueue m_log_ring_buffer; + Common::FixedSizeQueue m_log_ring_buffer; }; diff --git a/Source/UnitTests/Common/FixedSizeQueueTest.cpp b/Source/UnitTests/Common/FixedSizeQueueTest.cpp index 8c3009cb78..40e7c479cf 100644 --- a/Source/UnitTests/Common/FixedSizeQueueTest.cpp +++ b/Source/UnitTests/Common/FixedSizeQueueTest.cpp @@ -7,7 +7,7 @@ TEST(FixedSizeQueue, Simple) { - FixedSizeQueue q; + Common::FixedSizeQueue q; EXPECT_EQ(0u, q.size()); @@ -34,7 +34,7 @@ TEST(FixedSizeQueue, Simple) TEST(FixedSizeQueue, RingBuffer) { // Testing if queue works when used as a ring buffer - FixedSizeQueue q; + Common::FixedSizeQueue q; EXPECT_EQ(0u, q.size()); @@ -84,7 +84,7 @@ public: TEST(FixedSizeQueue, NonTrivialTypes) { // Testing if construction/destruction of non-trivial types happens as expected - FixedSizeQueue q; + Common::FixedSizeQueue q; EXPECT_EQ(0u, q.size());