PROTON-1093 [proton-c++] pragma to hide a warning in GCC introduces a warning in Windows
Removed the GCC pragma (actually added for clang) Added -Wno-old-style-cast to the list of acceptable warnings for clang. Fixed clang warning in C code (tolower macro multiple eval of arg with side effects.) Fixed ctor warning on windows in container.cpp Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/89440b62 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/89440b62 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/89440b62 Branch: refs/heads/master Commit: 89440b62dc44303a2ac16f51190dbf36195a0dcf Parents: 0601711 Author: Alan Conway <[email protected]> Authored: Wed Jan 6 15:20:20 2016 -0500 Committer: Alan Conway <[email protected]> Committed: Wed Jan 6 16:08:07 2016 -0500 ---------------------------------------------------------------------- proton-c/CMakeLists.txt | 4 +++- proton-c/bindings/cpp/include/proton/message.hpp | 16 ++++++++++------ proton-c/bindings/cpp/src/container.cpp | 10 ++++++---- proton-c/bindings/cpp/src/contexts.cpp | 1 - proton-c/bindings/cpp/src/message.cpp | 4 ++-- proton-c/src/util.c | 6 ++++-- 6 files changed, 25 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/89440b62/proton-c/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt index 85d819c..96859ab 100644 --- a/proton-c/CMakeLists.txt +++ b/proton-c/CMakeLists.txt @@ -246,7 +246,9 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") if (ENABLE_WARNING_ERROR) set (WERROR "-Werror") endif (ENABLE_WARNING_ERROR) - set (CXX_WARNING_FLAGS "${WERROR} -pedantic -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-float-equal -Wno-padded -Wno-sign-conversion -Wno-switch-enum -Wno-weak-vtables -Wno-exit-time-destructors -Wno-global-constructors -Wno-shorten-64-to-32 -Wno-documentation -Wno-documentation-unknown-command") + # TODO aconway 2016-01-06: we should be able to clean up the code and turn on + # some of these warnings. + set (CXX_WARNING_FLAGS "${WERROR} -pedantic -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-float-equal -Wno-padded -Wno-sign-conversion -Wno-switch-enum -Wno-weak-vtables -Wno-exit-time-destructors -Wno-global-constructors -Wno-shorten-64-to-32 -Wno-documentation -Wno-documentation-unknown-command -Wno-old-style-cast") endif() if (MSVC) http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/89440b62/proton-c/bindings/cpp/include/proton/message.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/message.hpp b/proton-c/bindings/cpp/include/proton/message.hpp index 374c7e8..b609c4e 100644 --- a/proton-c/bindings/cpp/include/proton/message.hpp +++ b/proton-c/bindings/cpp/include/proton/message.hpp @@ -67,6 +67,8 @@ class message ///@name Standard AMQP message properties ///@{ + // FIXME aconway 2016-01-06: document, re-order with others. + PN_CPP_EXTERN void id(const message_id& id); PN_CPP_EXTERN message_id id() const; @@ -161,7 +163,7 @@ class message * @return the value of the durable flag */ PN_CPP_EXTERN bool durable() const; - /** Get the durable flag for a message. */ + /** Set the durable flag for a message. */ PN_CPP_EXTERN void durable(bool); /** @@ -188,7 +190,7 @@ class message * @return the message priority */ PN_CPP_EXTERN uint8_t priority() const; - /** Get the priority for a message. */ + /** Set the priority for a message. */ PN_CPP_EXTERN void priority(uint8_t); /** @@ -203,7 +205,7 @@ class message * @return the first acquirer flag for the message */ PN_CPP_EXTERN bool first_acquirer() const; - /** Get the first acquirer flag for a message. */ + /** Set the first acquirer flag for a message. */ PN_CPP_EXTERN void first_acquirer(bool); /** @@ -227,10 +229,12 @@ class message * * @return the group sequence for the message */ - PN_CPP_EXTERN int32_t sequence() const; - /** Get the group sequence for a message. */ - PN_CPP_EXTERN void sequence(int32_t); + PN_CPP_EXTERN int32_t group_sequence() const; + /** Set the group sequence for a message. */ + PN_CPP_EXTERN void group_sequence(int32_t); + + /** Override std::swap to efficiently swap messages. */ friend PN_CPP_EXTERN void swap(message&, message&); private: http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/89440b62/proton-c/bindings/cpp/src/container.cpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/src/container.cpp b/proton-c/bindings/cpp/src/container.cpp index 2eaad07..01dcf2a 100644 --- a/proton-c/bindings/cpp/src/container.cpp +++ b/proton-c/bindings/cpp/src/container.cpp @@ -41,11 +41,13 @@ namespace proton { //// Public container class. -container::container(const std::string& id) : - impl_(new container_impl(*this, 0, id)) {} +container::container(const std::string& id) { + impl_.reset(new container_impl(*this, 0, id)); +} -container::container(messaging_handler &mhandler, const std::string& id) : - impl_(new container_impl(*this, &mhandler, id)) {} +container::container(messaging_handler &mhandler, const std::string& id) { + impl_.reset(new container_impl(*this, &mhandler, id)); +} container::~container() {} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/89440b62/proton-c/bindings/cpp/src/contexts.cpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/src/contexts.cpp b/proton-c/bindings/cpp/src/contexts.cpp index 0d48aa6..9b77d89 100644 --- a/proton-c/bindings/cpp/src/contexts.cpp +++ b/proton-c/bindings/cpp/src/contexts.cpp @@ -45,7 +45,6 @@ void cpp_context_finalize(void* v) { reinterpret_cast<context*>(v)->~context(); pn_class_t cpp_context_class = PN_CLASS(cpp_context); // Handles -#pragma GCC diagnostic ignored "-Wold-style-cast" PN_HANDLE(CONNECTION_CONTEXT) PN_HANDLE(CONTAINER_CONTEXT) PN_HANDLE(LISTENER_CONTEXT) http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/89440b62/proton-c/bindings/cpp/src/message.cpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/src/message.cpp b/proton-c/bindings/cpp/src/message.cpp index 19741ec..24a6ba6 100644 --- a/proton-c/bindings/cpp/src/message.cpp +++ b/proton-c/bindings/cpp/src/message.cpp @@ -314,7 +314,7 @@ void message::first_acquirer(bool b) { pn_message_set_first_acquirer(pn_msg(), b uint32_t message::delivery_count() const { return pn_message_get_delivery_count(pn_msg()); } void message::delivery_count(uint32_t d) { pn_message_set_delivery_count(pn_msg(), d); } -int32_t message::sequence() const { return pn_message_get_group_sequence(pn_msg()); } -void message::sequence(int32_t d) { pn_message_set_group_sequence(pn_msg(), d); } +int32_t message::group_sequence() const { return pn_message_get_group_sequence(pn_msg()); } +void message::group_sequence(int32_t d) { pn_message_set_group_sequence(pn_msg(), d); } } http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/89440b62/proton-c/src/util.c ---------------------------------------------------------------------- diff --git a/proton-c/src/util.c b/proton-c/src/util.c index 0587c1d..47fbc34 100644 --- a/proton-c/src/util.c +++ b/proton-c/src/util.c @@ -209,7 +209,8 @@ int pn_strcasecmp(const char *a, const char *b) { int diff; while (*b) { - diff = tolower(*a++)-tolower(*b++); + char aa = *a++, bb = *b++; + diff = tolower(aa)-tolower(bb); if ( diff!=0 ) return diff; } return *a; @@ -219,7 +220,8 @@ int pn_strncasecmp(const char* a, const char* b, size_t len) { int diff = 0; while (*b && len > 0) { - diff = tolower(*a++)-tolower(*b++); + char aa = *a++, bb = *b++; + diff = tolower(aa)-tolower(bb); if ( diff!=0 ) return diff; --len; }; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
