Ticket #4596: squash-64-bit-warnings.patch

File squash-64-bit-warnings.patch, 2.1 KB (added by Matthew Bradbury <matt-bradbury@…>, 12 years ago)

Patch

  • boost/python/detail/caller.hpp

     
    5252
    5353inline unsigned arity(PyObject* const& args_)
    5454{
    55     return PyTuple_GET_SIZE(args_);
     55    return static_cast<unsigned>(PyTuple_GET_SIZE(args_));
    5656}
    5757
    5858// This "result converter" is really just used as
  • boost/python/suite/indexing/detail/indexing_suite_detail.hpp

     
    602602            else {
    603603                long from = extract<long>( slice->start);
    604604                if (from < 0) // Negative slice index
    605                     from += max_index;
     605                    from += long(max_index);
    606606                if (from < 0) // Clip lower bounds to zero
    607607                    from = 0;
    608608                from_ = boost::numeric_cast<Index>(from);
     
    616616            else {
    617617                long to = extract<long>( slice->stop);
    618618                if (to < 0)
    619                     to += max_index;
     619                    to += long(max_index);
    620620                if (to < 0)
    621621                    to = 0;
    622622                to_ = boost::numeric_cast<Index>(to);
  • boost/python/suite/indexing/vector_indexing_suite.hpp

     
    173173            {
    174174                long index = i();
    175175                if (index < 0)
    176                     index += DerivedPolicies::size(container);
     176                    index += long(DerivedPolicies::size(container));
    177177                if (index >= long(container.size()) || index < 0)
    178178                {
    179179                    PyErr_SetString(PyExc_IndexError, "Index out of range");