mirror of
https://github.com/boostorg/python.git
synced 2026-01-21 05:02:17 +00:00
ssize_t patches merged from HEAD
[SVN r35327]
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <boost/python/extract.hpp>
|
||||
#include <boost/python/tuple.hpp>
|
||||
#include <boost/python/list.hpp>
|
||||
#include <boost/python/ssize_t.hpp>
|
||||
|
||||
#include <boost/python/detail/signature.hpp>
|
||||
#include <boost/mpl/vector/vector10.hpp>
|
||||
@@ -64,7 +65,7 @@ function::function(
|
||||
= max_arity > num_keywords ? max_arity - num_keywords : 0;
|
||||
|
||||
|
||||
unsigned tuple_size = num_keywords ? max_arity : 0;
|
||||
ssize_t tuple_size = num_keywords ? max_arity : 0;
|
||||
m_arg_names = object(handle<>(PyTuple_New(tuple_size)));
|
||||
|
||||
if (num_keywords != 0)
|
||||
@@ -158,7 +159,9 @@ PyObject* function::call(PyObject* args, PyObject* keywords) const
|
||||
else
|
||||
{
|
||||
// build a new arg tuple, will adjust its size later
|
||||
inner_args = handle<>(PyTuple_New(max_arity));
|
||||
assert(max_arity <= ssize_t_max);
|
||||
inner_args = handle<>(
|
||||
PyTuple_New(static_cast<ssize_t>(max_arity)));
|
||||
|
||||
// Fill in the positional arguments
|
||||
for (std::size_t i = 0; i < n_unnamed_actual; ++i)
|
||||
@@ -293,7 +296,7 @@ void function::argument_error(PyObject* args, PyObject* /*keywords*/) const
|
||||
% make_tuple(this->m_namespace, this->m_name);
|
||||
|
||||
list actual_args;
|
||||
for (int i = 0; i < PyTuple_Size(args); ++i)
|
||||
for (ssize_t i = 0; i < PyTuple_Size(args); ++i)
|
||||
{
|
||||
char const* name = PyTuple_GetItem(args, i)->ob_type->tp_name;
|
||||
actual_args.append(str(name));
|
||||
|
||||
Reference in New Issue
Block a user