- Remove python code from octave's std_basic_string.i
- Correctly return an error to fix error handling when using std::basic_string in
overloaded methods - issue #1171.
The directorin typemaps will now generate a temporary variable
(specified after the type), such as:
%typemap(directorin) MyType (MyType *temp) { ... use temp ... }
The shared_ptr director typemaps have been fixed for use in functions
that take more than one parameter.
Modify the Python and Ruby director shared_ptr typemaps to be language neutral.
Port the director modifications to other scripting languages that
have shared_ptr support - Octave, R and Scilab. Scilab shared_ptr
support is not fully working and needs work though.
* radarsat1-fix-null-shared_ptr-directors:
Remove duplicate director shared_ptr pointer reference typemaps
For shared_ptr directorin, make copy of shared_ptr in all cases.
Add directorin typemap for Python and Ruby shared_ptr.
Fixes missing type information for std::complex in scripting languages.
Closes#732.
Update Javascript and Octave complextest, although they don't actually
get run as they don't work
* tamuratak-fix_python_unordered_2:
[python] add %swig_sequence_iterator_with_making_function and make %swig_sequence_iterator forward to it. add %swig_sequence_forward_iterator too.
[python] make SwigPyIteratorClosed_T and SwigPyIteratorOpen_T inherit from forward iterator classes.
[python] fix std unordered containers
This fragment needs to depend on StdTraits fragment as it specializes the
template struct traits<> defined there and it could happen that the struct was
not declared before being specialized, resulting in compilation errors in the
generated code.
It doesn't seem to need to depend on stddef.h inclusion, however, so replace
it with the correct dependency instead of keeping both.
"CID 11151 (#3-1 of 3): Using invalid iterator (INVALIDATE_ITERATOR)18.
increment_iterator: Incrementing iterator it though it is already past
the end of its container."
Coverity does not understand 'replace_count', so warns that we may go
past self->end() (or self->rend() I guess).
Fix Coverity issue reported for SWIG_Python_ConvertFunctionPtr:
"Execution cannot reach this statement: *ptr = vptr;"
Because if 'ty' is null, then desc becomes null and we return with
SWIG_ERROR. So 'ty' cannot be null at 'if (ty)'.
Fix Coverity issue reported for SWIG_Python_FixMethods:
"buffer_size: Calling strncpy with a source string whose length
(10 chars) is greater than or equal to the size argument (10)
will fail to null-terminate buff."
The issue is only reported for the "swig_ptr: " line, but for
consistency we replace both occurrences of strncpy with memcpy.
The metaclass (SwigPyObjectType) for SWIG objects was not defined in
a way that let importlib successfully import the Python wrappers.
The pickle module failed because it couldn't determine what module the
SWIG wrapped objects are in.
I've changed the definition of SwigPyObjectType using more normal
builtin type definitions. There are still some open questions:
- None of the builtin types, like swig_static_var_getset_descriptor and
SwigPyObject are added into any module. No call to PyModule_AddObject
is made, so isinstance cannot be used for any wrapped type, all of
which are derived from SwigPyObject.
Closes#808
The closure names used for builtin slots are mangled with their functype so
that overloaded C++ method names can be used for multiple slots.
For example:
%feature("python:slot", "mp_subscript", functype="binaryfunc") SimpleArray::__getitem__;
%feature("python:slot", "sq_item", functype="ssizeargfunc") SimpleArray::__getitem__(Py_ssize_t n);
will generate closures:
SWIGPY_SSIZEARGFUNC_CLOSURE(_wrap_SimpleArray___getitem__) /* defines _wrap_SimpleArray___getitem___ssizeargfunc_closure */
SWIGPY_BINARYFUNC_CLOSURE(_wrap_SimpleArray___getitem__) /* defines _wrap_SimpleArray___getitem___binaryfunc_closure */