From 39e163b7cecc2f21e79dff9557542e5519c92e47 Mon Sep 17 00:00:00 2001 From: tgsm Date: Mon, 18 Feb 2019 20:34:18 -0500 Subject: [PATCH] core: use nested namespaces --- src/core/file_sys/archive_ncch.h | 6 ++---- src/core/hle/applets/applet.cpp | 6 ++---- src/core/hle/applets/applet.h | 6 ++---- src/core/hle/applets/erreula.cpp | 6 ++---- src/core/hle/applets/erreula.h | 6 ++---- src/core/hle/applets/mii_selector.cpp | 6 ++---- src/core/hle/applets/mii_selector.h | 6 ++---- src/core/hle/applets/mint.cpp | 6 ++---- src/core/hle/applets/mint.h | 6 ++---- src/core/hle/applets/swkbd.cpp | 6 ++---- src/core/hle/applets/swkbd.h | 6 ++---- src/core/hw/aes/arithmetic128.cpp | 6 ++---- src/core/hw/aes/arithmetic128.h | 6 ++---- src/core/hw/aes/ccm.cpp | 6 ++---- src/core/hw/aes/ccm.h | 6 ++---- src/core/hw/aes/key.cpp | 6 ++---- src/core/hw/aes/key.h | 6 ++---- src/core/hw/y2r.cpp | 6 ++---- src/core/hw/y2r.h | 12 ++++-------- 19 files changed, 40 insertions(+), 80 deletions(-) diff --git a/src/core/file_sys/archive_ncch.h b/src/core/file_sys/archive_ncch.h index 864b569f2..53df08b9d 100644 --- a/src/core/file_sys/archive_ncch.h +++ b/src/core/file_sys/archive_ncch.h @@ -14,11 +14,9 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace -namespace Service { -namespace FS { +namespace Service::FS { enum class MediaType : u32; -} -} // namespace Service +} // namespace Service::FS namespace FileSys { diff --git a/src/core/hle/applets/applet.cpp b/src/core/hle/applets/applet.cpp index f41157d2f..3c85687cc 100644 --- a/src/core/hle/applets/applet.cpp +++ b/src/core/hle/applets/applet.cpp @@ -34,8 +34,7 @@ struct hash { }; } // namespace std -namespace HLE { -namespace Applets { +namespace HLE::Applets { static std::unordered_map> applets; /// The CoreTiming event identifier for the Applet update callback. @@ -136,5 +135,4 @@ void Init() { void Shutdown() { Core::System::GetInstance().CoreTiming().RemoveEvent(applet_update_event); } -} // namespace Applets -} // namespace HLE +} // namespace HLE::Applets diff --git a/src/core/hle/applets/applet.h b/src/core/hle/applets/applet.h index 87ecd7b68..2ed410bdc 100644 --- a/src/core/hle/applets/applet.h +++ b/src/core/hle/applets/applet.h @@ -8,8 +8,7 @@ #include "core/hle/result.h" #include "core/hle/service/apt/applet_manager.h" -namespace HLE { -namespace Applets { +namespace HLE::Applets { class Applet { public: @@ -86,5 +85,4 @@ void Init(); /// Shuts down the HLE applets void Shutdown(); -} // namespace Applets -} // namespace HLE +} // namespace HLE::Applets diff --git a/src/core/hle/applets/erreula.cpp b/src/core/hle/applets/erreula.cpp index ef9da4989..91d168a14 100644 --- a/src/core/hle/applets/erreula.cpp +++ b/src/core/hle/applets/erreula.cpp @@ -7,8 +7,7 @@ #include "core/hle/applets/erreula.h" #include "core/hle/service/apt/apt.h" -namespace HLE { -namespace Applets { +namespace HLE::Applets { ResultCode ErrEula::ReceiveParameter(const Service::APT::MessageParameter& parameter) { if (parameter.signal != Service::APT::SignalType::Request) { @@ -67,5 +66,4 @@ ResultCode ErrEula::StartImpl(const Service::APT::AppletStartupParameter& parame void ErrEula::Update() {} -} // namespace Applets -} // namespace HLE +} // namespace HLE::Applets diff --git a/src/core/hle/applets/erreula.h b/src/core/hle/applets/erreula.h index 0350a04b1..627b0f0d8 100644 --- a/src/core/hle/applets/erreula.h +++ b/src/core/hle/applets/erreula.h @@ -7,8 +7,7 @@ #include "core/hle/applets/applet.h" #include "core/hle/kernel/shared_memory.h" -namespace HLE { -namespace Applets { +namespace HLE::Applets { class ErrEula final : public Applet { public: @@ -26,5 +25,4 @@ private: Kernel::SharedPtr framebuffer_memory; }; -} // namespace Applets -} // namespace HLE +} // namespace HLE::Applets diff --git a/src/core/hle/applets/mii_selector.cpp b/src/core/hle/applets/mii_selector.cpp index c75e3e397..58311902d 100644 --- a/src/core/hle/applets/mii_selector.cpp +++ b/src/core/hle/applets/mii_selector.cpp @@ -15,8 +15,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -namespace HLE { -namespace Applets { +namespace HLE::Applets { ResultCode MiiSelector::ReceiveParameter(const Service::APT::MessageParameter& parameter) { if (parameter.signal != Service::APT::SignalType::Request) { @@ -110,5 +109,4 @@ ResultCode MiiSelector::StartImpl(const Service::APT::AppletStartupParameter& pa } void MiiSelector::Update() {} -} // namespace Applets -} // namespace HLE +} // namespace HLE::Applets diff --git a/src/core/hle/applets/mii_selector.h b/src/core/hle/applets/mii_selector.h index bef711f6a..fb853baaf 100644 --- a/src/core/hle/applets/mii_selector.h +++ b/src/core/hle/applets/mii_selector.h @@ -12,8 +12,7 @@ #include "core/hle/result.h" #include "core/hle/service/apt/apt.h" -namespace HLE { -namespace Applets { +namespace HLE::Applets { struct MiiConfig { u8 enable_cancel_button; @@ -126,5 +125,4 @@ private: MiiConfig config; }; -} // namespace Applets -} // namespace HLE +} // namespace HLE::Applets diff --git a/src/core/hle/applets/mint.cpp b/src/core/hle/applets/mint.cpp index 1986961bf..0bedfdd85 100644 --- a/src/core/hle/applets/mint.cpp +++ b/src/core/hle/applets/mint.cpp @@ -7,8 +7,7 @@ #include "core/hle/applets/mint.h" #include "core/hle/service/apt/apt.h" -namespace HLE { -namespace Applets { +namespace HLE::Applets { ResultCode Mint::ReceiveParameter(const Service::APT::MessageParameter& parameter) { if (parameter.signal != Service::APT::SignalType::Request) { @@ -67,5 +66,4 @@ ResultCode Mint::StartImpl(const Service::APT::AppletStartupParameter& parameter void Mint::Update() {} -} // namespace Applets -} // namespace HLE +} // namespace HLE::Applets diff --git a/src/core/hle/applets/mint.h b/src/core/hle/applets/mint.h index dfe233399..08d2adb67 100644 --- a/src/core/hle/applets/mint.h +++ b/src/core/hle/applets/mint.h @@ -7,8 +7,7 @@ #include "core/hle/applets/applet.h" #include "core/hle/kernel/shared_memory.h" -namespace HLE { -namespace Applets { +namespace HLE::Applets { class Mint final : public Applet { public: @@ -26,5 +25,4 @@ private: Kernel::SharedPtr framebuffer_memory; }; -} // namespace Applets -} // namespace HLE +} // namespace HLE::Applets diff --git a/src/core/hle/applets/swkbd.cpp b/src/core/hle/applets/swkbd.cpp index fc185bd7b..cdceccb1a 100644 --- a/src/core/hle/applets/swkbd.cpp +++ b/src/core/hle/applets/swkbd.cpp @@ -19,8 +19,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -namespace HLE { -namespace Applets { +namespace HLE::Applets { ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter const& parameter) { if (parameter.signal != Service::APT::SignalType::Request) { @@ -188,5 +187,4 @@ Frontend::KeyboardConfig SoftwareKeyboard::ToFrontendConfig( static_cast(config.filter_flags & SoftwareKeyboardFilter::Callback); return frontend_config; } -} // namespace Applets -} // namespace HLE +} // namespace HLE::Applets diff --git a/src/core/hle/applets/swkbd.h b/src/core/hle/applets/swkbd.h index 246d2f4c5..88a4d4ed5 100644 --- a/src/core/hle/applets/swkbd.h +++ b/src/core/hle/applets/swkbd.h @@ -13,8 +13,7 @@ #include "core/hle/result.h" #include "core/hle/service/apt/apt.h" -namespace HLE { -namespace Applets { +namespace HLE::Applets { /// Maximum number of buttons that can be in the keyboard. constexpr int MAX_BUTTON = 3; @@ -210,5 +209,4 @@ private: std::shared_ptr frontend_applet; }; -} // namespace Applets -} // namespace HLE +} // namespace HLE::Applets diff --git a/src/core/hw/aes/arithmetic128.cpp b/src/core/hw/aes/arithmetic128.cpp index 55b954a52..6a1308f2d 100644 --- a/src/core/hw/aes/arithmetic128.cpp +++ b/src/core/hw/aes/arithmetic128.cpp @@ -6,8 +6,7 @@ #include #include "core/hw/aes/arithmetic128.h" -namespace HW { -namespace AES { +namespace HW::AES { AESKey Lrot128(const AESKey& in, u32 rot) { AESKey out; @@ -43,5 +42,4 @@ AESKey Xor128(const AESKey& a, const AESKey& b) { return out; } -} // namespace AES -} // namespace HW +} // namespace HW::AES diff --git a/src/core/hw/aes/arithmetic128.h b/src/core/hw/aes/arithmetic128.h index 1cec365c8..62d110e16 100644 --- a/src/core/hw/aes/arithmetic128.h +++ b/src/core/hw/aes/arithmetic128.h @@ -7,11 +7,9 @@ #include "common/common_types.h" #include "core/hw/aes/key.h" -namespace HW { -namespace AES { +namespace HW::AES { AESKey Lrot128(const AESKey& in, u32 rot); AESKey Add128(const AESKey& a, const AESKey& b); AESKey Xor128(const AESKey& a, const AESKey& b); -} // namespace AES -} // namespace HW +} // namespace HW::AES diff --git a/src/core/hw/aes/ccm.cpp b/src/core/hw/aes/ccm.cpp index 5074daa89..fca260a96 100644 --- a/src/core/hw/aes/ccm.cpp +++ b/src/core/hw/aes/ccm.cpp @@ -12,8 +12,7 @@ #include "core/hw/aes/ccm.h" #include "core/hw/aes/key.h" -namespace HW { -namespace AES { +namespace HW::AES { namespace { @@ -91,5 +90,4 @@ std::vector DecryptVerifyCCM(const std::vector& cipher, const CCMNonce& return pdata; } -} // namespace AES -} // namespace HW +} // namespace HW::AES diff --git a/src/core/hw/aes/ccm.h b/src/core/hw/aes/ccm.h index 36ccea126..605a5f3aa 100644 --- a/src/core/hw/aes/ccm.h +++ b/src/core/hw/aes/ccm.h @@ -9,8 +9,7 @@ #include #include "common/common_types.h" -namespace HW { -namespace AES { +namespace HW::AES { constexpr std::size_t CCM_NONCE_SIZE = 12; constexpr std::size_t CCM_MAC_SIZE = 16; @@ -37,5 +36,4 @@ std::vector EncryptSignCCM(const std::vector& pdata, const CCMNonce& non std::vector DecryptVerifyCCM(const std::vector& cipher, const CCMNonce& nonce, std::size_t slot_id); -} // namespace AES -} // namespace HW +} // namespace HW::AES diff --git a/src/core/hw/aes/key.cpp b/src/core/hw/aes/key.cpp index 7f034f9a3..37a547e5c 100644 --- a/src/core/hw/aes/key.cpp +++ b/src/core/hw/aes/key.cpp @@ -18,8 +18,7 @@ #include "core/hw/aes/arithmetic128.h" #include "core/hw/aes/key.h" -namespace HW { -namespace AES { +namespace HW::AES { namespace { @@ -475,5 +474,4 @@ void SelectCommonKeyIndex(u8 index) { key_slots[KeySlotID::TicketCommonKey].SetKeyY(common_key_y_slots.at(index)); } -} // namespace AES -} // namespace HW +} // namespace HW::AES diff --git a/src/core/hw/aes/key.h b/src/core/hw/aes/key.h index 3d6664fd2..865c42c20 100644 --- a/src/core/hw/aes/key.h +++ b/src/core/hw/aes/key.h @@ -8,8 +8,7 @@ #include #include "common/common_types.h" -namespace HW { -namespace AES { +namespace HW::AES { enum KeySlotID : std::size_t { @@ -50,5 +49,4 @@ AESKey GetNormalKey(std::size_t slot_id); void SelectCommonKeyIndex(u8 index); -} // namespace AES -} // namespace HW +} // namespace HW::AES diff --git a/src/core/hw/y2r.cpp b/src/core/hw/y2r.cpp index a613bbed5..896a9364c 100644 --- a/src/core/hw/y2r.cpp +++ b/src/core/hw/y2r.cpp @@ -15,8 +15,7 @@ #include "core/hw/y2r.h" #include "core/memory.h" -namespace HW { -namespace Y2R { +namespace HW::Y2R { using namespace Service::Y2R; @@ -377,5 +376,4 @@ void PerformConversion(ConversionConfiguration& cvt) { cvt.output_format, (u8)cvt.alpha); } } -} // namespace Y2R -} // namespace HW +} // namespace HW::Y2R diff --git a/src/core/hw/y2r.h b/src/core/hw/y2r.h index 061879dd4..b3345faa0 100644 --- a/src/core/hw/y2r.h +++ b/src/core/hw/y2r.h @@ -4,14 +4,10 @@ #pragma once -namespace Service { -namespace Y2R { +namespace Service::Y2R { struct ConversionConfiguration; -} -} // namespace Service +} // namespace Service::Y2R -namespace HW { -namespace Y2R { +namespace HW::Y2R { void PerformConversion(Service::Y2R::ConversionConfiguration& cvt); -} -} // namespace HW +} // namespace HW::Y2R