Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid MSVC compiler warnings in Envelope #412

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions include/amqpcpp/envelope.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ class Envelope : public MetaData
Envelope(InBuffer &buffer) : MetaData(buffer)
{
// extract the properties
// @todo: is this correct? can body sizes be uint64?
_bodySize = buffer.nextUint64();
_body = buffer.nextData(_bodySize);

// @todo: is casting to uint32 correct?
_body = buffer.nextData(static_cast<uint32_t>(_bodySize));
}

/**
Expand Down Expand Up @@ -122,7 +125,10 @@ class Envelope : public MetaData

// now the size of the message body + the actual body
buffer.add(_bodySize);
buffer.add(_body, _bodySize);

// @todo: is this correct? first we write a uint64 as body size, but body sizes
// cannot be larger than 2^32 - 1 apparently?
buffer.add(_body, static_cast<uint32_t>(_bodySize));
}
};

Expand Down