Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3353: warning C4244: Py_ssize_t to unsigned int
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-01-27 07:55:17
#3353: warning C4244: Py_ssize_t to unsigned int
---------------------------+---------------------
Reporter: davidm@⦠| Owner: dave
Type: Bugs | Status: new
Milestone: Boost 1.40.0 | Component: Python
Version: Boost 1.39.0 | Severity: Problem
Resolution: | Keywords:
---------------------------+---------------------
Comment (by dominik.berner@â¦):
It seems that it wasn't fixed until now (1.57.0) so I created a small
patch to fix the compiler warnings generated by the Visual Studio 2013
compiler:
{{{
Index: Dependencies64/include/boost/python/list.hpp
===================================================================
--- Dependencies64/include/boost/python/list.hpp (revision 29348)
+++ Dependencies64/include/boost/python/list.hpp (revision 29350)
@@ -73,7 +73,7 @@
}
template <class T>
- long count(T const& value) const
+ ssize_t count(T const& value) const
{
return base::count(object(value));
}
Index: Dependencies64/include/boost/python/detail/caller.hpp
===================================================================
--- Dependencies64/include/boost/python/detail/caller.hpp (revision
29348)
+++ Dependencies64/include/boost/python/detail/caller.hpp (revision
29350)
@@ -50,7 +50,7 @@
return PyTuple_GET_ITEM(args_,N);
}
-inline unsigned arity(PyObject* const& args_)
+inline Py_ssize_t arity(PyObject* const& args_)
{
return PyTuple_GET_SIZE(args_);
}
Index: Dependencies64/include/indexing_suite/slice_handler.hpp
===================================================================
--- Dependencies64/include/indexing_suite/slice_handler.hpp (revision
29348)
+++ Dependencies64/include/indexing_suite/slice_handler.hpp (revision
29350)
@@ -286,7 +286,7 @@
boost::python::object length
((boost::python::handle<>
- (PyInt_FromLong (Algorithms::size (c)))));
+ (PyInt_FromSsize_t (Algorithms::size (c)))));
slice sl
((boost::python::handle<>
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3353#comment:2> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC