diff --git a/include/amqpcpp/envelope.h b/include/amqpcpp/envelope.h index 355e81c..91dd7c7 100644 --- a/include/amqpcpp/envelope.h +++ b/include/amqpcpp/envelope.h @@ -56,7 +56,7 @@ public: * @param body * @param size */ - Envelope(const char *body, uint64_t size) : MetaData(), _body((char *)body), _bodySize(size) {} + Envelope(const char *body, uint64_t size) : MetaData(), _body(const_cast(body)), _bodySize(size) {} /** * Disabled copy constructor diff --git a/include/amqpcpp/message.h b/include/amqpcpp/message.h index 7c8f59e..ee6fd0e 100644 --- a/include/amqpcpp/message.h +++ b/include/amqpcpp/message.h @@ -103,7 +103,7 @@ protected: { // we do not have to combine multiple frames, so we can store // the buffer pointer in the message - _body = (char *)buffer; + _body = const_cast(buffer); } else {