From 6ffeca641c605617f4597c6a887cc85382519d30 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 5 Jun 2009 20:15:01 +0000 Subject: [PATCH] GCC Warning Suppression [SVN r53659] --- include/boost/python/detail/decorated_type_id.hpp | 4 ++-- src/object/class.cpp | 9 ++++----- src/object/function.cpp | 2 +- src/object/function_doc_signature.cpp | 6 +++--- src/str.cpp | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) mode change 100755 => 100644 include/boost/python/detail/decorated_type_id.hpp mode change 100755 => 100644 src/object/function_doc_signature.cpp diff --git a/include/boost/python/detail/decorated_type_id.hpp b/include/boost/python/detail/decorated_type_id.hpp old mode 100755 new mode 100644 index 2e44ac2c..535508b4 --- a/include/boost/python/detail/decorated_type_id.hpp +++ b/include/boost/python/detail/decorated_type_id.hpp @@ -55,8 +55,8 @@ inline decorated_type_info::decorated_type_info(type_info base_t, decoration dec inline bool decorated_type_info::operator<(decorated_type_info const& rhs) const { return m_decoration < rhs.m_decoration - || m_decoration == rhs.m_decoration - && m_base_type < rhs.m_base_type; + || (m_decoration == rhs.m_decoration + && m_base_type < rhs.m_base_type); } inline bool decorated_type_info::operator==(decorated_type_info const& rhs) const diff --git a/src/object/class.cpp b/src/object/class.cpp index a05851ef..64d1d6d0 100644 --- a/src/object/class.cpp +++ b/src/object/class.cpp @@ -506,13 +506,12 @@ namespace objects // Build a tuple of the base Python type objects. If no bases // were declared, we'll use our class_type() as the single base // class. - std::size_t const num_bases = (std::max)(num_types - 1, static_cast(1)); - assert(num_bases <= ssize_t_max); - handle<> bases(PyTuple_New(static_cast(num_bases))); + ssize_t const num_bases = (std::max)(num_types - 1, static_cast(1)); + handle<> bases(PyTuple_New(num_bases)); - for (std::size_t i = 1; i <= num_bases; ++i) + for (ssize_t i = 1; i <= num_bases; ++i) { - type_handle c = (i >= num_types) ? class_type() : get_class(types[i]); + type_handle c = (i >= static_cast(num_types)) ? class_type() : get_class(types[i]); // PyTuple_SET_ITEM steals this reference PyTuple_SET_ITEM(bases.get(), static_cast(i - 1), upcast(c.release())); } diff --git a/src/object/function.cpp b/src/object/function.cpp index 64dc3846..d49d0228 100644 --- a/src/object/function.cpp +++ b/src/object/function.cpp @@ -166,7 +166,7 @@ PyObject* function::call(PyObject* args, PyObject* keywords) const else { // build a new arg tuple, will adjust its size later - assert(max_arity <= ssize_t_max); + assert(max_arity <= static_cast(ssize_t_max)); inner_args = handle<>( PyTuple_New(static_cast(max_arity))); diff --git a/src/object/function_doc_signature.cpp b/src/object/function_doc_signature.cpp old mode 100755 new mode 100644 index 49f2c350..d6c8879a --- a/src/object/function_doc_signature.cpp +++ b/src/object/function_doc_signature.cpp @@ -52,9 +52,9 @@ namespace boost { namespace python { namespace objects { //check if the argument default values are the same bool f1_has_names = bool(f1->m_arg_names); bool f2_has_names = bool(f2->m_arg_names); - if ( f1_has_names && f2_has_names && f2->m_arg_names[i-1]!=f1->m_arg_names[i-1] - || f1_has_names && !f2_has_names - || !f1_has_names && f2_has_names && f2->m_arg_names[i-1]!=python::object() + if ( (f1_has_names && f2_has_names && f2->m_arg_names[i-1]!=f1->m_arg_names[i-1]) + || (f1_has_names && !f2_has_names) + || (!f1_has_names && f2_has_names && f2->m_arg_names[i-1]!=python::object()) ) return false; } diff --git a/src/str.cpp b/src/str.cpp index a7646866..ddde1a53 100644 --- a/src/str.cpp +++ b/src/str.cpp @@ -26,7 +26,7 @@ namespace { ssize_t str_size_as_py_ssize_t(std::size_t n) { - if (n > ssize_t_max) + if (n > static_cast(ssize_t_max)) { throw std::range_error("str size > ssize_t_max"); }