diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2022-04-26 09:41:00 +0100 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2022-04-26 09:41:45 +0100 |
commit | bae4561938f66b31420ffc3f09c9a62932355b8c (patch) | |
tree | 7be3569bf677b3beb4138dd8b832fd6f685a0434 /src/serialize.h | |
parent | a19f641a80cb2841ca9f593e9be589dbc4b4ae7c (diff) |
scripted-diff: rename BytePtr to AsBytePtr
Building with iPhoneOS SDK fails because it also has `BytePtr` defined
in /usr/include/MacTypes.h.
-BEGIN VERIFY SCRIPT-
sed -i 's/BytePtr/AsBytePtr/' $(git grep -l "BytePtr" src)
-END VERIFY SCRIPT-
Diffstat (limited to 'src/serialize.h')
-rw-r--r-- | src/serialize.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/serialize.h b/src/serialize.h index 44bb471f25..a1cce78451 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -472,10 +472,10 @@ struct CustomUintFormatter if (v < 0 || v > MAX) throw std::ios_base::failure("CustomUintFormatter value out of range"); if (BigEndian) { uint64_t raw = htobe64(v); - s.write({BytePtr(&raw) + 8 - Bytes, Bytes}); + s.write({AsBytePtr(&raw) + 8 - Bytes, Bytes}); } else { uint64_t raw = htole64(v); - s.write({BytePtr(&raw), Bytes}); + s.write({AsBytePtr(&raw), Bytes}); } } @@ -485,10 +485,10 @@ struct CustomUintFormatter static_assert(std::numeric_limits<U>::max() >= MAX && std::numeric_limits<U>::min() <= 0, "Assigned type too small"); uint64_t raw = 0; if (BigEndian) { - s.read({BytePtr(&raw) + 8 - Bytes, Bytes}); + s.read({AsBytePtr(&raw) + 8 - Bytes, Bytes}); v = static_cast<I>(be64toh(raw)); } else { - s.read({BytePtr(&raw), Bytes}); + s.read({AsBytePtr(&raw), Bytes}); v = static_cast<I>(le64toh(raw)); } } |