};
-#ifdef _MSC_VER
-#define IMPLEMENT_SERIALIZE(statements) \
- unsigned int GetSerializeSize(int nType, int nVersion) const \
- { \
- CSerActionGetSerializeSize ser_action; \
- const bool fGetSize = true; \
- const bool fWrite = false; \
- const bool fRead = false; \
- unsigned int nSerSize = 0; \
- ser_streamplaceholder s; \
- assert(fGetSize||fWrite||fRead); /* suppress warning */ \
- s.nType = nType; \
- s.nVersion = nVersion; \
- std::map<int, int> mapUnkIds; \
- {statements} \
- return nSerSize; \
- } \
- template<typename Stream> \
- void Serialize(Stream& s, int nType, int nVersion) const \
- { \
- CSerActionSerialize ser_action; \
- const bool fGetSize = false; \
- const bool fWrite = true; \
- const bool fRead = false; \
- unsigned int nSerSize = 0; \
- assert(fGetSize||fWrite||fRead); /* suppress warning */ \
- std::map<int, int> mapUnkIds; \
- {statements} \
- } \
- template<typename Stream> \
- void Unserialize(Stream& s, int nType, int nVersion) \
- { \
- CSerActionUnserialize ser_action; \
- const bool fGetSize = false; \
- const bool fWrite = false; \
- const bool fRead = true; \
- unsigned int nSerSize = 0; \
- std::map<int, int> mapUnkIds; \
- assert(fGetSize||fWrite||fRead); /* suppress warning */ \
- {statements} \
- }
-
-#else
-
#define IMPLEMENT_SERIALIZE(statements) \
unsigned int GetSerializeSize(int nType, int nVersion) const \
{ \
{statements} \
}
-#endif
-
#define READWRITE(obj) (nSerSize += ::SerReadWrite(s, (obj), nType, nVersion, ser_action))
unsigned int pos = (unsigned int)(nReadPos % vchBuf.size());
size_t nNow = nSize;
if (nNow + pos > vchBuf.size())
- nNow = (size_t)(vchBuf.size() - pos);
+ nNow = vchBuf.size() - pos;
if (nNow + nReadPos > nSrcPos)
nNow = (size_t)(nSrcPos - nReadPos);
memcpy(pch, &vchBuf[pos], nNow);