From 539128e559b904169fd22469fa463515781bbfd8 Mon Sep 17 00:00:00 2001 From: theirix Date: Wed, 18 Apr 2018 14:59:35 +0300 Subject: [PATCH] Replaced C-casts with const_cast for Envelope::body_ --- include/amqpcpp/envelope.h | 2 +- include/amqpcpp/message.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 {