Skip to content

Commit 6ffeca6

Browse files
committed
GCC Warning Suppression
[SVN r53659]
1 parent 22b65a1 commit 6ffeca6

5 files changed

Lines changed: 11 additions & 12 deletions

File tree

include/boost/python/detail/decorated_type_id.hpp

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ inline decorated_type_info::decorated_type_info(type_info base_t, decoration dec
5555
inline bool decorated_type_info::operator<(decorated_type_info const& rhs) const
5656
{
5757
return m_decoration < rhs.m_decoration
58-
|| m_decoration == rhs.m_decoration
59-
&& m_base_type < rhs.m_base_type;
58+
|| (m_decoration == rhs.m_decoration
59+
&& m_base_type < rhs.m_base_type);
6060
}
6161

6262
inline bool decorated_type_info::operator==(decorated_type_info const& rhs) const

src/object/class.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,13 +506,12 @@ namespace objects
506506
// Build a tuple of the base Python type objects. If no bases
507507
// were declared, we'll use our class_type() as the single base
508508
// class.
509-
std::size_t const num_bases = (std::max)(num_types - 1, static_cast<std::size_t>(1));
510-
assert(num_bases <= ssize_t_max);
511-
handle<> bases(PyTuple_New(static_cast<ssize_t>(num_bases)));
509+
ssize_t const num_bases = (std::max)(num_types - 1, static_cast<std::size_t>(1));
510+
handle<> bases(PyTuple_New(num_bases));
512511

513-
for (std::size_t i = 1; i <= num_bases; ++i)
512+
for (ssize_t i = 1; i <= num_bases; ++i)
514513
{
515-
type_handle c = (i >= num_types) ? class_type() : get_class(types[i]);
514+
type_handle c = (i >= static_cast<ssize_t>(num_types)) ? class_type() : get_class(types[i]);
516515
// PyTuple_SET_ITEM steals this reference
517516
PyTuple_SET_ITEM(bases.get(), static_cast<ssize_t>(i - 1), upcast<PyObject>(c.release()));
518517
}

src/object/function.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ PyObject* function::call(PyObject* args, PyObject* keywords) const
166166
else
167167
{
168168
// build a new arg tuple, will adjust its size later
169-
assert(max_arity <= ssize_t_max);
169+
assert(max_arity <= static_cast<std::size_t>(ssize_t_max));
170170
inner_args = handle<>(
171171
PyTuple_New(static_cast<ssize_t>(max_arity)));
172172

src/object/function_doc_signature.cpp

100755100644
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ namespace boost { namespace python { namespace objects {
5252
//check if the argument default values are the same
5353
bool f1_has_names = bool(f1->m_arg_names);
5454
bool f2_has_names = bool(f2->m_arg_names);
55-
if ( f1_has_names && f2_has_names && f2->m_arg_names[i-1]!=f1->m_arg_names[i-1]
56-
|| f1_has_names && !f2_has_names
57-
|| !f1_has_names && f2_has_names && f2->m_arg_names[i-1]!=python::object()
55+
if ( (f1_has_names && f2_has_names && f2->m_arg_names[i-1]!=f1->m_arg_names[i-1])
56+
|| (f1_has_names && !f2_has_names)
57+
|| (!f1_has_names && f2_has_names && f2->m_arg_names[i-1]!=python::object())
5858
)
5959
return false;
6060
}

src/str.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace {
2626

2727
ssize_t str_size_as_py_ssize_t(std::size_t n)
2828
{
29-
if (n > ssize_t_max)
29+
if (n > static_cast<std::size_t>(ssize_t_max))
3030
{
3131
throw std::range_error("str size > ssize_t_max");
3232
}

0 commit comments

Comments
 (0)