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:
Pieter Wuille
2018-03-20 17:37:32 -07:00
parent 4ba3d4f439
commit a7c45bce92
8 changed files with 40 additions and 26 deletions

View File

@@ -48,10 +48,10 @@ public:
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action)
{
READWRITE(FLATDATA(pchMessageStart));
READWRITE(FLATDATA(pchCommand));
READWRITE(pchMessageStart);
READWRITE(pchCommand);
READWRITE(nMessageSize);
READWRITE(FLATDATA(pchChecksum));
READWRITE(pchChecksum);
}
char pchMessageStart[MESSAGE_START_SIZE];