Even more style checks.

This commit is contained in:
Daniel Kirchner
2019-02-14 11:53:00 +01:00
parent 8ca6715e18
commit 809b9a95f9
15 changed files with 35 additions and 34 deletions
+2 -2
View File
@@ -74,7 +74,7 @@ using strings = std::vector<std::string>;
/// Interprets @a _u as a two's complement signed number and returns the resulting s256.
inline s256 u2s(u256 _u)
{
static const bigint c_end = bigint(1) << 256;
static bigint const c_end = bigint(1) << 256;
if (boost::multiprecision::bit_test(_u, 255))
return s256(-(c_end - _u));
else
@@ -84,7 +84,7 @@ inline s256 u2s(u256 _u)
/// @returns the two's complement signed representation of the signed number _u.
inline u256 s2u(s256 _u)
{
static const bigint c_end = bigint(1) << 256;
static bigint const c_end = bigint(1) << 256;
if (_u >= 0)
return u256(_u);
else
+1 -1
View File
@@ -31,7 +31,7 @@ namespace dev
/// Base class for all exceptions.
struct Exception: virtual std::exception, virtual boost::exception
{
const char* what() const noexcept override;
char const* what() const noexcept override;
/// @returns "FileName:LineNumber" referring to the point where the exception was thrown.
std::string lineInfo() const;
+5 -5
View File
@@ -47,17 +47,17 @@ namespace
/******** The Keccak-f[1600] permutation ********/
/*** Constants. ***/
static const uint8_t rho[24] = \
static uint8_t const rho[24] = \
{ 1, 3, 6, 10, 15, 21,
28, 36, 45, 55, 2, 14,
27, 41, 56, 8, 25, 43,
62, 18, 39, 61, 20, 44};
static const uint8_t pi[24] = \
static uint8_t const pi[24] = \
{10, 7, 11, 17, 18, 3,
5, 16, 8, 21, 24, 4,
15, 23, 19, 13, 12, 2,
20, 14, 22, 9, 6, 1};
static const uint64_t RC[24] = \
static uint64_t const RC[24] = \
{1ULL, 0x8082ULL, 0x800000000000808aULL, 0x8000000080008000ULL,
0x808bULL, 0x80000001ULL, 0x8000000080008081ULL, 0x8000000000008009ULL,
0x8aULL, 0x88ULL, 0x80008009ULL, 0x8000000aULL,
@@ -118,7 +118,7 @@ static inline void keccakf(void* state) {
_(for (size_t i = 0; i < L; i += ST) { S; })
#define mkapply_ds(NAME, S) \
static inline void NAME(uint8_t* dst, \
const uint8_t* src, \
uint8_t const* src, \
size_t len) { \
FOR(i, 1, len, S); \
}
@@ -148,7 +148,7 @@ mkapply_sd(setout, dst[i] = src[i]) // setout
inline void hash(
uint8_t* out,
size_t outlen,
const uint8_t* in,
uint8_t const* in,
size_t inlen,
size_t rate,
uint8_t delim
+2 -2
View File
@@ -139,8 +139,8 @@ inline std::string formatNumberReadable(
if (len < 24)
return str;
const int initialChars = (prefix == HexPrefix::Add) ? 6 : 4;
const int finalChars = 4;
int const initialChars = (prefix == HexPrefix::Add) ? 6 : 4;
int const finalChars = 4;
int numSkipped = len - initialChars - finalChars;
return str.substr(0, initialChars) +