From 1f7472c4ce9571522647236d100f925ab827253d Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Wed, 28 Jul 2021 12:13:58 +0200 Subject: [PATCH] Avoid MSVC compiler warnings in Envelope --- include/amqpcpp/envelope.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/amqpcpp/envelope.h b/include/amqpcpp/envelope.h index 02726b36..4bf0e0aa 100644 --- a/include/amqpcpp/envelope.h +++ b/include/amqpcpp/envelope.h @@ -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(_bodySize)); } /** @@ -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(_bodySize)); } };