1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:17:34 +00:00

Everywhere: Run clang-format

This commit is contained in:
Idan Horowitz 2022-04-01 20:58:27 +03:00 committed by Linus Groh
parent 0376c127f6
commit 086969277e
1665 changed files with 8479 additions and 8479 deletions

View file

@ -59,25 +59,25 @@ struct MultiHashDigestVariant {
{
}
[[nodiscard]] const u8* immutable_data() const
[[nodiscard]] u8 const* immutable_data() const
{
return m_digest.visit(
[&](const Empty&) -> const u8* { VERIFY_NOT_REACHED(); },
[&](const auto& value) { return value.immutable_data(); });
[&](Empty const&) -> u8 const* { VERIFY_NOT_REACHED(); },
[&](auto const& value) { return value.immutable_data(); });
}
[[nodiscard]] size_t data_length() const
{
return m_digest.visit(
[&](const Empty&) -> size_t { VERIFY_NOT_REACHED(); },
[&](const auto& value) { return value.data_length(); });
[&](Empty const&) -> size_t { VERIFY_NOT_REACHED(); },
[&](auto const& value) { return value.data_length(); });
}
[[nodiscard]] ReadonlyBytes bytes() const
{
return m_digest.visit(
[&](const Empty&) -> ReadonlyBytes { VERIFY_NOT_REACHED(); },
[&](const auto& value) { return value.bytes(); });
[&](Empty const&) -> ReadonlyBytes { VERIFY_NOT_REACHED(); },
[&](auto const& value) { return value.bytes(); });
}
using DigestVariant = Variant<Empty, MD5::DigestType, SHA1::DigestType, SHA256::DigestType, SHA384::DigestType, SHA512::DigestType>;
@ -93,7 +93,7 @@ public:
m_pre_init_buffer = ByteBuffer();
}
Manager(const Manager& other) // NOT a copy constructor!
Manager(Manager const& other) // NOT a copy constructor!
{
m_pre_init_buffer = ByteBuffer(); // will not be used
initialize(other.m_kind);
@ -113,15 +113,15 @@ public:
inline size_t digest_size() const
{
return m_algorithm.visit(
[&](const Empty&) -> size_t { return 0; },
[&](const auto& hash) { return hash.digest_size(); });
[&](Empty const&) -> size_t { return 0; },
[&](auto const& hash) { return hash.digest_size(); });
}
inline size_t block_size() const
{
return m_algorithm.visit(
[&](const Empty&) -> size_t { return 0; },
[&](const auto& hash) { return hash.block_size(); });
[&](Empty const&) -> size_t { return 0; },
[&](auto const& hash) { return hash.block_size(); });
}
inline void initialize(HashKind kind)
@ -154,7 +154,7 @@ public:
}
}
virtual void update(const u8* data, size_t length) override
virtual void update(u8 const* data, size_t length) override
{
auto size = m_pre_init_buffer.size();
if (size) {
@ -195,8 +195,8 @@ public:
virtual String class_name() const override
{
return m_algorithm.visit(
[&](const Empty&) -> String { return "UninitializedHashManager"; },
[&](const auto& hash) { return hash.class_name(); });
[&](Empty const&) -> String { return "UninitializedHashManager"; },
[&](auto const& hash) { return hash.class_name(); });
}
#endif