From 2a2630edc95a23db911ccb154ad6517a130f0b49 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sat, 22 Aug 2020 20:50:48 +0200 Subject: [PATCH] Meta: Fix wrong 'using namespace X' usages Apart from causing All AK:: and Crypto:: symbols being suddenly visible even though they might not be supposed to be, the style guide also says this is wrong: https://github.com/SerenityOS/serenity/blob/master/Documentation/CodingStyle.md#using-statements --- AK/NumberFormat.h | 4 ++-- Libraries/LibTLS/TLSv12.cpp | 2 +- Libraries/LibTLS/TLSv12.h | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/AK/NumberFormat.h b/AK/NumberFormat.h index 2b69c168581..7a2d1a681a7 100644 --- a/AK/NumberFormat.h +++ b/AK/NumberFormat.h @@ -38,7 +38,7 @@ static String number_string_with_one_decimal(float number, const char* suffix) return String::format("%d.%d %s", (int)number, (int)(decimals * 10), suffix); } -static String human_readable_size(size_t size) +static inline String human_readable_size(size_t size) { if (size < 1 * KiB) return String::format("%zu B", size); @@ -51,4 +51,4 @@ static String human_readable_size(size_t size) } -using namespace AK; +using AK::human_readable_size; diff --git a/Libraries/LibTLS/TLSv12.cpp b/Libraries/LibTLS/TLSv12.cpp index 7d219bca6ad..7924762b991 100644 --- a/Libraries/LibTLS/TLSv12.cpp +++ b/Libraries/LibTLS/TLSv12.cpp @@ -727,7 +727,7 @@ bool TLSv12::add_client_key(const ByteBuffer& certificate_pem_buffer, const Byte if (certificate_pem_buffer.is_empty() || rsa_key.is_empty()) { return true; } - auto decoded_certificate = decode_pem(certificate_pem_buffer, 0); + auto decoded_certificate = Crypto::decode_pem(certificate_pem_buffer, 0); if (decoded_certificate.is_empty()) { dbg() << "Certificate not PEM"; return false; diff --git a/Libraries/LibTLS/TLSv12.h b/Libraries/LibTLS/TLSv12.h index 5a082376370..9b358758b18 100644 --- a/Libraries/LibTLS/TLSv12.h +++ b/Libraries/LibTLS/TLSv12.h @@ -515,5 +515,4 @@ static constexpr const u8 RSA_SIGN_SHA512_OID[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7 } -using namespace Crypto; }