mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user