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-
This commit is contained in:
João Barbosa
2022-04-26 09:41:00 +01:00
parent a19f641a80
commit bae4561938
4 changed files with 14 additions and 14 deletions

View File

@@ -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));
}
}