Procházet zdrojové kódy

Everywhere: Use nested namespace qualifiers

Nico Weber před 2 roky
rodič
revize
66e210e406
27 změnil soubory, kde provedl 30 přidání a 91 odebrání
  1. 1 3
      Userland/Libraries/LibCrypto/Authentication/GHash.cpp
  2. 1 4
      Userland/Libraries/LibCrypto/Authentication/GHash.h
  3. 1 3
      Userland/Libraries/LibCrypto/Authentication/HMAC.h
  4. 1 3
      Userland/Libraries/LibCrypto/Cipher/AES.cpp
  5. 1 3
      Userland/Libraries/LibCrypto/Cipher/AES.h
  6. 1 3
      Userland/Libraries/LibCrypto/Cipher/Cipher.h
  7. 1 4
      Userland/Libraries/LibCrypto/Cipher/Mode/CBC.h
  8. 1 3
      Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h
  9. 1 4
      Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h
  10. 1 4
      Userland/Libraries/LibCrypto/Cipher/Mode/Mode.h
  11. 1 3
      Userland/Libraries/LibCrypto/Hash/HashManager.h
  12. 1 3
      Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp
  13. 1 3
      Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.h
  14. 1 3
      Userland/Libraries/LibCrypto/PK/Code/Code.h
  15. 1 3
      Userland/Libraries/LibCrypto/PK/Code/EMSA_PKCS1_V1_5.h
  16. 1 3
      Userland/Libraries/LibCrypto/PK/Code/EMSA_PSS.h
  17. 1 3
      Userland/Libraries/LibCrypto/PK/PK.h
  18. 1 3
      Userland/Libraries/LibCrypto/PK/RSA.cpp
  19. 2 3
      Userland/Libraries/LibCrypto/PK/RSA.h
  20. 1 3
      Userland/Libraries/LibEDID/Definitions.h
  21. 2 6
      Userland/Libraries/LibGUI/Layout.h
  22. 2 6
      Userland/Libraries/LibGUI/Widget.h
  23. 1 3
      Userland/Libraries/LibLine/VT.h
  24. 1 3
      Userland/Libraries/LibWeb/HTML/AttributeNames.cpp
  25. 1 3
      Userland/Libraries/LibWeb/HTML/AttributeNames.h
  26. 1 3
      Userland/Libraries/LibWeb/HTML/Parser/Entities.cpp
  27. 1 3
      Userland/Libraries/LibWeb/HTML/Parser/Entities.h

+ 1 - 3
Userland/Libraries/LibCrypto/Authentication/GHash.cpp

@@ -25,8 +25,7 @@ static void to_u8s(u8* b, u32 const* w)
 
 }
 
-namespace Crypto {
-namespace Authentication {
+namespace Crypto::Authentication {
 
 GHash::TagType GHash::process(ReadonlyBytes aad, ReadonlyBytes cipher)
 {
@@ -118,4 +117,3 @@ void galois_multiply(u32 (&z)[4], const u32 (&_x)[4], const u32 (&_y)[4])
 }
 
 }
-}

+ 1 - 4
Userland/Libraries/LibCrypto/Authentication/GHash.h

@@ -15,8 +15,7 @@
 #    include <AK/DeprecatedString.h>
 #endif
 
-namespace Crypto {
-namespace Authentication {
+namespace Crypto::Authentication {
 
 void galois_multiply(u32 (&z)[4], const u32 (&x)[4], const u32 (&y)[4]);
 
@@ -62,5 +61,3 @@ private:
 };
 
 }
-
-}

+ 1 - 3
Userland/Libraries/LibCrypto/Authentication/HMAC.h

@@ -19,8 +19,7 @@
 constexpr static auto IPAD = 0x36;
 constexpr static auto OPAD = 0x5c;
 
-namespace Crypto {
-namespace Authentication {
+namespace Crypto::Authentication {
 
 template<typename HashT>
 class HMAC {
@@ -121,4 +120,3 @@ private:
 };
 
 }
-}

+ 1 - 3
Userland/Libraries/LibCrypto/Cipher/AES.cpp

@@ -8,8 +8,7 @@
 #include <LibCrypto/Cipher/AES.h>
 #include <LibCrypto/Cipher/AESTables.h>
 
-namespace Crypto {
-namespace Cipher {
+namespace Crypto::Cipher {
 
 template<typename T>
 constexpr u32 get_key(T pt)
@@ -405,4 +404,3 @@ void AESCipherBlock::overwrite(ReadonlyBytes bytes)
 }
 
 }
-}

+ 1 - 3
Userland/Libraries/LibCrypto/Cipher/AES.h

@@ -17,8 +17,7 @@
 #    include <AK/DeprecatedString.h>
 #endif
 
-namespace Crypto {
-namespace Cipher {
+namespace Crypto::Cipher {
 
 struct AESCipherBlock : public CipherBlock {
 public:
@@ -132,4 +131,3 @@ protected:
 };
 
 }
-}

+ 1 - 3
Userland/Libraries/LibCrypto/Cipher/Cipher.h

@@ -11,8 +11,7 @@
 #include <AK/Span.h>
 #include <AK/Types.h>
 
-namespace Crypto {
-namespace Cipher {
+namespace Crypto::Cipher {
 
 enum class Intent {
     Encryption,
@@ -123,4 +122,3 @@ private:
     PaddingMode m_padding_mode;
 };
 }
-}

+ 1 - 4
Userland/Libraries/LibCrypto/Cipher/Mode/CBC.h

@@ -14,8 +14,7 @@
 #    include <AK/DeprecatedString.h>
 #endif
 
-namespace Crypto {
-namespace Cipher {
+namespace Crypto::Cipher {
 
 template<typename T>
 class CBC : public Mode<T> {
@@ -126,5 +125,3 @@ private:
 };
 
 }
-
-}

+ 1 - 3
Userland/Libraries/LibCrypto/Cipher/Mode/CTR.h

@@ -14,8 +14,7 @@
 #    include <AK/DeprecatedString.h>
 #endif
 
-namespace Crypto {
-namespace Cipher {
+namespace Crypto::Cipher {
 
 /*
  * Heads up: CTR is a *family* of modes, because the "counter" function is
@@ -194,4 +193,3 @@ protected:
 };
 
 }
-}

+ 1 - 4
Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h

@@ -18,8 +18,7 @@
 #    include <AK/DeprecatedString.h>
 #endif
 
-namespace Crypto {
-namespace Cipher {
+namespace Crypto::Cipher {
 
 using IncrementFunction = IncrementInplace;
 
@@ -148,5 +147,3 @@ private:
 };
 
 }
-
-}

+ 1 - 4
Userland/Libraries/LibCrypto/Cipher/Mode/Mode.h

@@ -10,8 +10,7 @@
 #include <AK/Span.h>
 #include <LibCrypto/Cipher/Cipher.h>
 
-namespace Crypto {
-namespace Cipher {
+namespace Crypto::Cipher {
 
 template<typename T>
 class Mode {
@@ -99,5 +98,3 @@ private:
     T m_cipher;
 };
 }
-
-}

+ 1 - 3
Userland/Libraries/LibCrypto/Hash/HashManager.h

@@ -14,8 +14,7 @@
 #include <LibCrypto/Hash/SHA1.h>
 #include <LibCrypto/Hash/SHA2.h>
 
-namespace Crypto {
-namespace Hash {
+namespace Crypto::Hash {
 
 enum class HashKind {
     Unknown,
@@ -219,4 +218,3 @@ private:
 };
 
 }
-}

+ 1 - 3
Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp

@@ -8,8 +8,7 @@
 #include <LibCrypto/BigInt/Algorithms/UnsignedBigIntegerAlgorithms.h>
 #include <LibCrypto/NumberTheory/ModularFunctions.h>
 
-namespace Crypto {
-namespace NumberTheory {
+namespace Crypto::NumberTheory {
 
 UnsignedBigInteger ModularInverse(UnsignedBigInteger const& a_, UnsignedBigInteger const& b)
 {
@@ -232,4 +231,3 @@ UnsignedBigInteger random_big_prime(size_t bits)
 }
 
 }
-}

+ 1 - 3
Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.h

@@ -9,8 +9,7 @@
 #include <AK/Random.h>
 #include <LibCrypto/BigInt/UnsignedBigInteger.h>
 
-namespace Crypto {
-namespace NumberTheory {
+namespace Crypto::NumberTheory {
 
 UnsignedBigInteger ModularInverse(UnsignedBigInteger const& a_, UnsignedBigInteger const& b);
 UnsignedBigInteger ModularPower(UnsignedBigInteger const& b, UnsignedBigInteger const& e, UnsignedBigInteger const& m);
@@ -47,4 +46,3 @@ bool is_probably_prime(UnsignedBigInteger const& p);
 UnsignedBigInteger random_big_prime(size_t bits);
 
 }
-}

+ 1 - 3
Userland/Libraries/LibCrypto/PK/Code/Code.h

@@ -9,8 +9,7 @@
 #include <LibCrypto/Hash/HashFunction.h>
 #include <LibCrypto/Verification.h>
 
-namespace Crypto {
-namespace PK {
+namespace Crypto::PK {
 
 template<typename HashFunction>
 class Code {
@@ -34,4 +33,3 @@ protected:
 };
 
 }
-}

+ 1 - 3
Userland/Libraries/LibCrypto/PK/Code/EMSA_PKCS1_V1_5.h

@@ -12,8 +12,7 @@
 #include <LibCrypto/Hash/SHA2.h>
 #include <LibCrypto/PK/Code/Code.h>
 
-namespace Crypto {
-namespace PK {
+namespace Crypto::PK {
 
 template<typename HashFunction>
 class EMSA_PKCS1_V1_5 : public Code<HashFunction> {
@@ -135,4 +134,3 @@ inline ReadonlyBytes EMSA_PKCS1_V1_5<Crypto::Hash::Manager>::hash_function_diges
 }
 
 }
-}

+ 1 - 3
Userland/Libraries/LibCrypto/PK/Code/EMSA_PSS.h

@@ -13,8 +13,7 @@
 #include <AK/Vector.h>
 #include <LibCrypto/PK/Code/Code.h>
 
-namespace Crypto {
-namespace PK {
+namespace Crypto::PK {
 
 template<typename HashFunction, size_t SaltSize>
 class EMSA_PSS : public Code<HashFunction> {
@@ -168,4 +167,3 @@ private:
 };
 
 }
-}

+ 1 - 3
Userland/Libraries/LibCrypto/PK/PK.h

@@ -12,8 +12,7 @@
 #    include <AK/DeprecatedString.h>
 #endif
 
-namespace Crypto {
-namespace PK {
+namespace Crypto::PK {
 
 // FIXME: Fixing name up for grabs
 template<typename PrivKeyT, typename PubKeyT>
@@ -50,4 +49,3 @@ protected:
 };
 
 }
-}

+ 1 - 3
Userland/Libraries/LibCrypto/PK/RSA.cpp

@@ -12,8 +12,7 @@
 #include <LibCrypto/ASN1/PEM.h>
 #include <LibCrypto/PK/RSA.h>
 
-namespace Crypto {
-namespace PK {
+namespace Crypto::PK {
 
 static constexpr Array<int, 7> pkcs8_rsa_key_oid { 1, 2, 840, 113549, 1, 1, 1 };
 
@@ -418,4 +417,3 @@ void RSA_PKCS1_EME::verify(ReadonlyBytes, Bytes&)
     dbgln("FIXME: RSA_PKCS_EME::verify");
 }
 }
-}

+ 2 - 3
Userland/Libraries/LibCrypto/PK/RSA.h

@@ -13,8 +13,8 @@
 #include <LibCrypto/PK/Code/EMSA_PSS.h>
 #include <LibCrypto/PK/PK.h>
 
-namespace Crypto {
-namespace PK {
+namespace Crypto::PK {
+
 template<typename Integer = UnsignedBigInteger>
 class RSAPublicKey {
 public:
@@ -225,4 +225,3 @@ public:
     }
 };
 }
-}

+ 1 - 3
Userland/Libraries/LibEDID/Definitions.h

@@ -8,8 +8,7 @@
 
 #include <AK/Types.h>
 
-namespace EDID {
-namespace Definitions {
+namespace EDID::Definitions {
 
 struct [[gnu::packed]] StandardTimings {
     u8 horizontal_8_pixels;
@@ -157,4 +156,3 @@ struct [[gnu::packed]] ExtensionBlock {
 static_assert(AssertSize<ExtensionBlock, 128>());
 
 }
-}

+ 2 - 6
Userland/Libraries/LibGUI/Layout.h

@@ -15,18 +15,14 @@
 #include <LibGUI/UIDimensions.h>
 #include <LibGfx/Forward.h>
 
-namespace Core {
-namespace Registration {
+namespace Core::Registration {
 extern Core::ObjectClassRegistration registration_Layout;
 }
-}
 
 #define REGISTER_LAYOUT(namespace_, class_name)                                                                                                       \
-    namespace Core {                                                                                                                                  \
-    namespace Registration {                                                                                                                          \
+    namespace Core::Registration {                                                                                                                    \
     Core::ObjectClassRegistration registration_##class_name(                                                                                          \
         #namespace_ "::" #class_name##sv, []() { return static_ptr_cast<Core::Object>(namespace_::class_name::construct()); }, &registration_Layout); \
-    }                                                                                                                                                 \
     }
 
 namespace GUI {

+ 2 - 6
Userland/Libraries/LibGUI/Widget.h

@@ -27,18 +27,14 @@
 #include <LibGfx/Rect.h>
 #include <LibGfx/StandardCursor.h>
 
-namespace Core {
-namespace Registration {
+namespace Core::Registration {
 extern Core::ObjectClassRegistration registration_Widget;
 }
-}
 
 #define REGISTER_WIDGET(namespace_, class_name)                                                                                                                                                     \
-    namespace Core {                                                                                                                                                                                \
-    namespace Registration {                                                                                                                                                                        \
+    namespace Core::Registration {                                                                                                                                                                  \
     Core::ObjectClassRegistration registration_##class_name(                                                                                                                                        \
         #namespace_ "::" #class_name##sv, []() -> ErrorOr<NonnullRefPtr<Core::Object>> { return static_ptr_cast<Core::Object>(TRY(namespace_::class_name::try_create())); }, &registration_Widget); \
-    }                                                                                                                                                                                               \
     }
 
 namespace GUI {

+ 1 - 3
Userland/Libraries/LibLine/VT.h

@@ -9,8 +9,7 @@
 #include <AK/Types.h>
 #include <LibLine/Style.h>
 
-namespace Line {
-namespace VT {
+namespace Line::VT {
 
 ErrorOr<void> save_cursor(Stream&);
 ErrorOr<void> restore_cursor(Stream&);
@@ -21,4 +20,3 @@ ErrorOr<void> move_absolute(u32 x, u32 y, Stream&);
 ErrorOr<void> apply_style(Style const&, Stream&, bool is_starting = true);
 
 }
-}

+ 1 - 3
Userland/Libraries/LibWeb/HTML/AttributeNames.cpp

@@ -6,8 +6,7 @@
 
 #include <LibWeb/HTML/AttributeNames.h>
 
-namespace Web {
-namespace HTML {
+namespace Web::HTML {
 namespace AttributeNames {
 
 #define __ENUMERATE_HTML_ATTRIBUTE(name) DeprecatedFlyString name;
@@ -73,4 +72,3 @@ bool is_boolean_attribute(DeprecatedFlyString const& attribute)
 }
 
 }
-}

+ 1 - 3
Userland/Libraries/LibWeb/HTML/AttributeNames.h

@@ -9,8 +9,7 @@
 #include <AK/DeprecatedFlyString.h>
 #include <AK/Error.h>
 
-namespace Web {
-namespace HTML {
+namespace Web::HTML {
 namespace AttributeNames {
 
 #define ENUMERATE_HTML_ATTRIBUTES                          \
@@ -250,4 +249,3 @@ ErrorOr<void> initialize_strings();
 bool is_boolean_attribute(DeprecatedFlyString const& attribute);
 
 }
-}

+ 1 - 3
Userland/Libraries/LibWeb/HTML/Parser/Entities.cpp

@@ -7,8 +7,7 @@
 #include <AK/StringView.h>
 #include <LibWeb/HTML/Parser/Entities.h>
 
-namespace Web {
-namespace HTML {
+namespace Web::HTML {
 
 Optional<EntityMatch> code_points_from_entity(StringView entity)
 {
@@ -2278,4 +2277,3 @@ Optional<EntityMatch> code_points_from_entity(StringView entity)
 }
 
 }
-}

+ 1 - 3
Userland/Libraries/LibWeb/HTML/Parser/Entities.h

@@ -9,8 +9,7 @@
 #include <AK/StringView.h>
 #include <AK/Vector.h>
 
-namespace Web {
-namespace HTML {
+namespace Web::HTML {
 
 struct EntityMatch {
     Vector<u32, 2> code_points;
@@ -20,4 +19,3 @@ struct EntityMatch {
 Optional<EntityMatch> code_points_from_entity(StringView);
 
 }
-}