refactor: modernize-avoid-c-arrays pt. 2 (#3713)

This commit is contained in:
Charles Kerr
2022-08-26 13:35:28 -05:00
committed by GitHub
parent fa8b6a5e0a
commit a24679d89f
12 changed files with 57 additions and 55 deletions

View File

@@ -736,7 +736,7 @@ uint64_t tr_htonll(uint64_t x)
/* fallback code by bdonlan at https://stackoverflow.com/questions/809902/64-bit-ntohl-in-c/875505#875505 */
union
{
uint32_t lx[2];
std::array<uint32_t, 2> lx;
uint64_t llx;
} u;
u.lx[0] = htonl(x >> 32);
@@ -757,7 +757,7 @@ uint64_t tr_ntohll(uint64_t x)
/* fallback code by bdonlan at https://stackoverflow.com/questions/809902/64-bit-ntohl-in-c/875505#875505 */
union
{
uint32_t lx[2];
std::array<uint32_t, 2> lx;
uint64_t llx;
} u;
u.llx = x;