mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Add native support for serializing char arrays without FLATDATA
Support is added to serialize arrays of type char or unsigned char directly, without any wrappers. All invocations of the FLATDATA wrappers that are obsoleted by this are removed. This includes a patch by Russell Yanofsky to make char casting type safe. The serialization of CSubNet is changed to serialize a bool directly rather than though FLATDATA. This makes the serialization independent of the size of the bool type (and will use 1 byte everywhere).
This commit is contained in:
@@ -93,7 +93,7 @@ class CNetAddr
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(FLATDATA(ip));
|
||||
READWRITE(ip);
|
||||
}
|
||||
|
||||
friend class CSubNet;
|
||||
@@ -131,8 +131,8 @@ class CSubNet
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(network);
|
||||
READWRITE(FLATDATA(netmask));
|
||||
READWRITE(FLATDATA(valid));
|
||||
READWRITE(netmask);
|
||||
READWRITE(valid);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -166,7 +166,7 @@ class CService : public CNetAddr
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action) {
|
||||
READWRITE(FLATDATA(ip));
|
||||
READWRITE(ip);
|
||||
unsigned short portN = htons(port);
|
||||
READWRITE(FLATDATA(portN));
|
||||
if (ser_action.ForRead())
|
||||
|
||||
Reference in New Issue
Block a user