mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user