From 3f9d0c023f3d84de0c68dbf9f7c29aa1b0abb9c9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 May 2014 22:47:17 +0300 Subject: Fix code style in net. --- src/net/messageout.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/net/messageout.cpp') diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp index aeb409f14..1b78e2aee 100644 --- a/src/net/messageout.cpp +++ b/src/net/messageout.cpp @@ -71,11 +71,15 @@ void MessageOut::writeString(const std::string &string, int length) expand(length); // Write the actual string - memcpy(mData + mPos, string.c_str(), stringLength); + memcpy(mData + static_cast(mPos), string.c_str(), stringLength); // Pad remaining space with zeros if (length > stringLength) - memset(mData + mPos + stringLength, '\0', length - stringLength); + { + memset(mData + static_cast(mPos + stringLength), + '\0', + length - stringLength); + } mPos += length; DEBUGLOG("writeString: " + string); @@ -99,11 +103,15 @@ void MessageOut::writeStringNoLog(const std::string &string, int length) expand(length); // Write the actual string - memcpy(mData + mPos, string.c_str(), stringLength); + memcpy(mData + static_cast(mPos), string.c_str(), stringLength); // Pad remaining space with zeros if (length > stringLength) - memset(mData + mPos + stringLength, '\0', length - stringLength); + { + memset(mData + static_cast(mPos + stringLength), + '\0', + length - stringLength); + } mPos += length; DEBUGLOG("writeString: ***"); -- cgit v1.2.3-60-g2f50