fixed 32 bit warnings.

This commit is contained in:
Aart Stuurman 2018-01-24 00:38:07 +01:00
parent 4072430fb3
commit b211fc7779
2 changed files with 6 additions and 6 deletions

View File

@ -94,10 +94,10 @@ protected:
size = std::min(size, _bodySize - _filled);
// append more data
memcpy(_body + _filled, buffer, size);
memcpy(_body + _filled, buffer, (size_t)size);
// update filled data
_filled += size;
_filled += (size_t)size;
}
else if (size >= _bodySize)
{
@ -108,16 +108,16 @@ protected:
else
{
// allocate the buffer
_body = (char *)malloc(_bodySize);
_body = (char *)malloc((size_t)_bodySize);
// remember that the buffer was allocated, so that the destructor can get rid of it
_allocated = true;
// append more data
memcpy(_body, buffer, std::min(size, _bodySize));
memcpy(_body, buffer, std::min((size_t)size, (size_t)_bodySize));
// update filled data
_filled = std::min(size, _bodySize);
_filled = std::min((size_t)size, (size_t)_bodySize);
}
// check if we're done

View File

@ -125,7 +125,7 @@ uint64_t ConnectionImpl::parse(const Buffer &buffer)
try
{
// try to recognize the frame
ReducedBuffer reduced_buf(buffer, processed);
ReducedBuffer reduced_buf(buffer, (size_t)processed);
ReceivedFrame receivedFrame(reduced_buf, _maxFrame);
// do we have the full frame?