aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorMatt Corallo <matt@bluematt.me>2012-07-04 16:40:16 +0200
committerMatt Corallo <matt@bluematt.me>2012-07-04 16:40:16 +0200
commit24154ed64b70ac3c9fdceb6b53f1746b91e53bfa (patch)
tree5b2bb12ea0a41e916a7a1653053d1438b76796ce /src/net.h
parentc729dbb6d2b63d9c0b32e3937be0ebf528d4c753 (diff)
Fix remaining warnings.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/net.h b/src/net.h
index f6608bc030..fccb5d10f9 100644
--- a/src/net.h
+++ b/src/net.h
@@ -371,14 +371,14 @@ public:
// Set the size
unsigned int nSize = vSend.size() - nMessageStart;
- memcpy((char*)&vSend[nHeaderStart] + offsetof(CMessageHeader, nMessageSize), &nSize, sizeof(nSize));
+ memcpy((char*)&vSend[nHeaderStart] + CMessageHeader::MESSAGE_SIZE_OFFSET, &nSize, sizeof(nSize));
// Set the checksum
uint256 hash = Hash(vSend.begin() + nMessageStart, vSend.end());
unsigned int nChecksum = 0;
memcpy(&nChecksum, &hash, sizeof(nChecksum));
- assert(nMessageStart - nHeaderStart >= offsetof(CMessageHeader, nChecksum) + sizeof(nChecksum));
- memcpy((char*)&vSend[nHeaderStart] + offsetof(CMessageHeader, nChecksum), &nChecksum, sizeof(nChecksum));
+ assert(nMessageStart - nHeaderStart >= CMessageHeader::CHECKSUM_OFFSET + sizeof(nChecksum));
+ memcpy((char*)&vSend[nHeaderStart] + CMessageHeader::CHECKSUM_OFFSET, &nChecksum, sizeof(nChecksum));
if (fDebug) {
printf("(%d bytes)\n", nSize);