Fixed the argument counts passed to SWIG_Python_UnpackTuple for varargs.

Removed obsolete methods from std_map.i and pyiterators.swg.

Added builtin-check target to python test suite Makefile.

Fixed using_namespace_loop.i so that the generated wrappers will compile.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12644 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Stefan Zager 2011-04-29 18:25:16 +00:00
parent 4b9ef9bc99
commit e629b192e2
5 changed files with 20 additions and 28 deletions

View File

@ -86,6 +86,18 @@ C_TEST_CASES += \
include $(srcdir)/../common.mk
BUILTIN_BROKEN = \
li_std_string_extra.cpptest \
li_std_wstring.cpptest \
default_constructor.cpptest \
director_exception.cpptest \
exception_order.cpptest \
threads_exception.cpptest
BUILTIN_NOT_BROKEN = $(filter-out $(BUILTIN_BROKEN),$(NOT_BROKEN_TEST_CASES))
builtin-check : $(BUILTIN_NOT_BROKEN)
# Overridden variables here
LIBS = -L.
VALGRIND_OPT += --suppressions=pythonswig.supp

View File

@ -1,7 +1,9 @@
%module using_namespace_loop
%inline {
namespace A {}
namespace A {
struct Foo;
}
namespace B {
using namespace A;

View File

@ -311,18 +311,6 @@ namespace swig {
return new SwigPyIteratorOpen_T<OutIter>(current, seq);
}
%#if defined(SWIGPYTHON_BUILTIN)
template <typename Sequence>
inline PyObject* make_output_iterator_builtin_T (PyObject *pyself)
{
SwigPyObject *builtin_obj = (SwigPyObject*) pyself;
Sequence *seq = reinterpret_cast< Sequence * >(builtin_obj->ptr);
if (!seq)
return SWIG_Py_Void();
SwigPyIterator *iter = make_output_iterator(seq->begin(), seq->begin(), seq->end(), pyself);
return SWIG_InternalNewPointerObj(iter, SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN);
}
%#endif
}
}

View File

@ -119,17 +119,6 @@
return new SwigPyMapKeyIterator_T<OutIter>(current, begin, end, seq);
}
template<typename Sequence>
inline PyObject* make_output_key_iterator_builtin (PyObject *pyself)
{
SwigPyObject *builtin_obj = (SwigPyObject*) pyself;
Sequence *seq = reinterpret_cast< Sequence * >(builtin_obj->ptr);
if (!seq)
return SWIG_Py_Void();
SwigPyIterator *iter = make_output_key_iterator(seq->begin(), seq->begin(), seq->end(), pyself);
return SWIG_InternalNewPointerObj(iter, SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN);
}
template<class OutIterator,
class FromOper = from_value_oper<typename OutIterator::value_type> >
struct SwigPyMapValueITerator_T : SwigPyMapIterator_T<OutIterator, FromOper>

View File

@ -2067,12 +2067,13 @@ public:
emit_attach_parmmaps(l, f);
Setattr(n, "wrap:parms", l);
/* Get number of required and total arguments */
tuple_arguments = num_fixed_arguments = num_arguments = emit_num_arguments(l);
tuple_arguments = num_arguments = emit_num_arguments(l);
tuple_required = num_required = emit_num_required(l);
if (add_self) {
--tuple_arguments;
--tuple_required;
}
num_fixed_arguments = tuple_required;
if (((num_arguments == 0) && (num_required == 0)) || ((num_arguments == 1) && (num_required == 1) && Getattr(l, "self")))
allow_kwargs = 0;
varargs = emit_isvarargs(l);
@ -2306,13 +2307,13 @@ public:
Printf(parse_args, "if (!args) SWIG_fail;\n");
Append(parse_args, "swig_obj[0] = args;\n");
} else if (!noargs) {
Printf(parse_args, "if (!SWIG_Python_UnpackTuple(args,\"%s\",%d,%d,swig_obj)) SWIG_fail;\n", iname, tuple_required, tuple_arguments);
Printf(parse_args, "if (!SWIG_Python_UnpackTuple(args,\"%s\",%d,%d,swig_obj)) SWIG_fail;\n", iname, num_fixed_arguments, tuple_arguments);
} else if (noargs) {
Printf(parse_args, "if (!SWIG_Python_UnpackTuple(args,\"%s\",%d,%d,0)) SWIG_fail;\n", iname, tuple_required, tuple_arguments);
Printf(parse_args, "if (!SWIG_Python_UnpackTuple(args,\"%s\",%d,%d,0)) SWIG_fail;\n", iname, num_fixed_arguments, tuple_arguments);
}
}
} else if (tuple_arguments > 0) {
Printf(parse_args, "if(!PyArg_UnpackTuple(args,(char *)\"%s\",%d,%d", iname, tuple_required, tuple_arguments);
Printf(parse_args, "if(!PyArg_UnpackTuple(args,(char *)\"%s\",%d,%d", iname, num_fixed_arguments, tuple_arguments);
Printv(parse_args, arglist, ")) SWIG_fail;\n", NIL);
}
}