mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Everywhere: Redundant inline specifier on constexpr functions (#3807)
Problem: - `constexpr` functions are decorated with the `inline` specifier keyword. This is redundant because `constexpr` functions are implicitly `inline`. - [dcl.constexpr], §7.1.5/2 in the C++11 standard): "constexpr functions and constexpr constructors are implicitly inline (7.1.2)". Solution: - Remove the redundant `inline` keyword.
This commit is contained in:
parent
a40abd6ce3
commit
d1fe6a0b53
13 changed files with 43 additions and 43 deletions
|
@ -27,37 +27,37 @@
|
|||
#include <AK/Types.h>
|
||||
#include <LibCrypto/Hash/MD5.h>
|
||||
|
||||
static constexpr inline u32 F(u32 x, u32 y, u32 z) { return (x & y) | ((~x) & z); };
|
||||
static constexpr inline u32 G(u32 x, u32 y, u32 z) { return (x & z) | ((~z) & y); };
|
||||
static constexpr inline u32 H(u32 x, u32 y, u32 z) { return x ^ y ^ z; };
|
||||
static constexpr inline u32 I(u32 x, u32 y, u32 z) { return y ^ (x | ~z); };
|
||||
static constexpr inline u32 ROTATE_LEFT(u32 x, size_t n)
|
||||
static constexpr u32 F(u32 x, u32 y, u32 z) { return (x & y) | ((~x) & z); };
|
||||
static constexpr u32 G(u32 x, u32 y, u32 z) { return (x & z) | ((~z) & y); };
|
||||
static constexpr u32 H(u32 x, u32 y, u32 z) { return x ^ y ^ z; };
|
||||
static constexpr u32 I(u32 x, u32 y, u32 z) { return y ^ (x | ~z); };
|
||||
static constexpr u32 ROTATE_LEFT(u32 x, size_t n)
|
||||
{
|
||||
return (x << n) | (x >> (32 - n));
|
||||
}
|
||||
|
||||
static constexpr inline void round_1(u32& a, u32 b, u32 c, u32 d, u32 x, u32 s, u32 ac)
|
||||
static constexpr void round_1(u32& a, u32 b, u32 c, u32 d, u32 x, u32 s, u32 ac)
|
||||
{
|
||||
a += F(b, c, d) + x + ac;
|
||||
a = ROTATE_LEFT(a, s);
|
||||
a += b;
|
||||
}
|
||||
|
||||
static constexpr inline void round_2(u32& a, u32 b, u32 c, u32 d, u32 x, u32 s, u32 ac)
|
||||
static constexpr void round_2(u32& a, u32 b, u32 c, u32 d, u32 x, u32 s, u32 ac)
|
||||
{
|
||||
a += G(b, c, d) + x + ac;
|
||||
a = ROTATE_LEFT(a, s);
|
||||
a += b;
|
||||
}
|
||||
|
||||
static constexpr inline void round_3(u32& a, u32 b, u32 c, u32 d, u32 x, u32 s, u32 ac)
|
||||
static constexpr void round_3(u32& a, u32 b, u32 c, u32 d, u32 x, u32 s, u32 ac)
|
||||
{
|
||||
a += H(b, c, d) + x + ac;
|
||||
a = ROTATE_LEFT(a, s);
|
||||
a += b;
|
||||
}
|
||||
|
||||
static constexpr inline void round_4(u32& a, u32 b, u32 c, u32 d, u32 x, u32 s, u32 ac)
|
||||
static constexpr void round_4(u32& a, u32 b, u32 c, u32 d, u32 x, u32 s, u32 ac)
|
||||
{
|
||||
a += I(b, c, d) + x + ac;
|
||||
a = ROTATE_LEFT(a, s);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue