mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02: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:
parent
365539c846
commit
e829c9afbf
9 changed files with 12 additions and 15 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue