diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2020-11-20 00:14:32 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-01-31 17:35:16 +0100 |
commit | e829c9afbf75e930db6c3fe77a269b0af5e7a3ad (patch) | |
tree | 6623bb198d779b51ebf6611c8a01709dba9a50d0 /src/random.cpp | |
parent | 365539c84691d470b44d35df374d8c049f8c1192 (diff) |
refactor: replace sizeof(a)/sizeof(a[0]) by std::size (C++17)
Removes the macro ARRAYLEN and also substitutes all other uses of the same
"sizeof(a)/sizeof(a[0])" pattern by std::size, available since C++17.
Diffstat (limited to 'src/random.cpp')
-rw-r--r-- | src/random.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/random.cpp b/src/random.cpp index af9504e0ce..9900825abb 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -38,7 +38,6 @@ #include <sys/random.h> #endif #ifdef HAVE_SYSCTL_ARND -#include <util/strencodings.h> // for ARRAYLEN #include <sys/sysctl.h> #endif @@ -333,7 +332,7 @@ void GetOSRand(unsigned char *ent32) int have = 0; do { size_t len = NUM_OS_RANDOM_BYTES - have; - if (sysctl(name, ARRAYLEN(name), ent32 + have, &len, nullptr, 0) != 0) { + if (sysctl(name, std::size(name), ent32 + have, &len, nullptr, 0) != 0) { RandFailure(); } have += len; |