mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-04 04:53:19 +00:00
common: fix base58 gcc -Werror=implicit-fallthrough
This commit is contained in:
parent
8534f71eed
commit
d01bdaca12
1 changed files with 2 additions and 14 deletions
|
@ -109,20 +109,8 @@ namespace tools
|
||||||
assert(1 <= size && size <= sizeof(uint64_t));
|
assert(1 <= size && size <= sizeof(uint64_t));
|
||||||
|
|
||||||
uint64_t res = 0;
|
uint64_t res = 0;
|
||||||
switch (9 - size)
|
memcpy(reinterpret_cast<uint8_t*>(&res) + sizeof(uint64_t) - size, data, size);
|
||||||
{
|
return SWAP64BE(res);
|
||||||
case 1: res |= *data++; /* FALLTHRU */
|
|
||||||
case 2: res <<= 8; res |= *data++; /* FALLTHRU */
|
|
||||||
case 3: res <<= 8; res |= *data++; /* FALLTHRU */
|
|
||||||
case 4: res <<= 8; res |= *data++; /* FALLTHRU */
|
|
||||||
case 5: res <<= 8; res |= *data++; /* FALLTHRU */
|
|
||||||
case 6: res <<= 8; res |= *data++; /* FALLTHRU */
|
|
||||||
case 7: res <<= 8; res |= *data++; /* FALLTHRU */
|
|
||||||
case 8: res <<= 8; res |= *data; break;
|
|
||||||
default: assert(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void uint_64_to_8be(uint64_t num, size_t size, uint8_t* data)
|
void uint_64_to_8be(uint64_t num, size_t size, uint8_t* data)
|
||||||
|
|
Loading…
Reference in a new issue