| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Further switch to use rtypecheck typemaps instead of hard coded logic.
The full switch to typemaps is deferred until swig-4.2 as it can't be fully
backwards compatible. For now a warning is provided to help the
transition. It provides the full typemap that should be placed into
a user's interface file, for example:
%typemap("rtype") int32_t * "integer"
void testmethod(int32_t * i);
void testmethod();
If there is no rtypecheck typemap for int32_t *, the warning shown is:
example.i:7: Warning 750: Optional rtypecheck code is deprecated. Add the
following typemap to fix as the next version of SWIG will not work without it:
%typemap("rtypecheck") int32_t * %{ (is.integer($arg) || is.numeric($arg)) %}
The warning is shown for any code that previously used "numeric", "integer" or
"character" for the rtype typemap. Copying the rtypecheck typemap as
shown into the user interface file will provide the appropriate fix and
the warning will disappear. This is important to do as swig-4.2 will
not be able to provide this helpful warning.
|
|
|
|
|
|
|
|
| |
- Fix for special variable $argtype expansion in rtypecheck typemap.
- Remove unnecessary () brackets when using rtypecheck typemap for
single parameter functions.
- Add rtypecheck typemaps for shared_ptr so that NULL can be used
in overloaded functions taking shared_ptr.
|
|
|
|
|
|
|
|
|
| |
Fix leak when a cast up a class inheritance chain is
required.
Adds implementation of SWIG_ConvertPtrAndOwn for R.
Closes #2386
|
|
|
|
|
|
|
|
| |
Fix problems in shared_ptr wrappers where the class names were
not consistent when using the shared_ptr template or the actual
underlying type. Move $R_class substitution to typemaps.
Issue #2386
|
|
|
|
| |
Closes #2385
|
| |
|
|
|
|
|
| |
STRING_VALUE does not work with R_NO_REMAP
in older versions (it broke 3.0.2)
|
| |
|
|
|
|
|
|
|
|
|
| |
and exception specifications for native types.
Now the raised exception contains the string value as the exception
message instead of just the C/C++ type of the exception.
R exceptions were completely swallowed beforehand
|
|
|
|
|
|
|
|
|
|
|
|
| |
For implementing full move semantics when passing parameters by value.
Based on SWIGTYPE && and std::unique_ptr typemaps which implement move
semantics.
Added for all languages, but untested for: Go, Ocaml, R, Scilab (and
unlikely to be fully functional for same reasons as for std::unique_ptr
support).
Issue #999
|
| |
|
|
|
|
|
| |
More removal of casts in the out typemaps when copying objects to enable
C++ compilers to possibly make use of move semantics.
|
|
|
|
|
|
|
| |
The directorin typemaps in the director methods now use std::move on the
input parameter when copying the object from the stack to the heap prior
to the callback into the target language, thereby taking advantage of
move semantics if available.
|
|
|
|
|
|
| |
This is necessary for regex-like renames (where you can't use the #define trick
as is done in many of the %keywordwarn directives). It's now unnecessary to print
the "renaming to '`x`'" code explicitly by the kw.swg files.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
There is a possible memory leak in case the SWIG_exception_fail macro
is called. The problem is related to its definition that call the
function Rf_warning. This function (as well as Rf_error) involves
a longjmp over C++ destructors on the stack. Thus, all the objects
allocated on the heap are not freed.
Closes #914
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is some consolidation work to be done. The
core of the change is getRClassName2, which will
probably eventually replace getRClassName.
getRClassName seems to be in a funny state, with
a middle argument that is commented out and never
used.
My next step is to verify whether the new version
can replace it.
|
| |
|
|
|
|
|
| |
Same file now for all languages except R which is still missing std_map.i.
Recent Java changes adding in std_set.i removed.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This fixes #1124 and returns R_NilValue for null pointer objects
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace R_SWIG_EXTERNAL and R_SWIG_OWNER with the standard equivalent
macros. I can't see where these were actually used, but in case they are,
equivalent backwards compatibility can be obtained using:
#define R_SWIG_EXTERNAL 0
#define R_SWIG_OWNER SWIG_POINTER_OWN
SWIG_MakePtr does not seem to be used within the R SWIG code base so I
havn't added the above as backwards compatibility macros.
There seems to be no memory management in R. I've made this change
to fit in with the rest of SWIG though in preparation for an upcoming
commit to use the same shared_ptr macros as is used elsewhere.
|
|
|
|
|
| |
Merge changes from Python/Ruby equivalent files to obtain a fix
for NULL handling of T*const& typemaps.
|
|
|
|
|
| |
Synchronize typemaps with other identical typemaps in Scilab/Ruby.
Adds some missing $disown support.
|
|
|
|
|
| |
Add 'equivalent' attribute to typecheck typemap.
Closes #1098.
|
| |
|
| |
|
|
|
|
|
| |
Visual Studio 2015 debug builds:
error C4703: potentially uninitialized local pointer variable 'p' used
|
|
|
|
| |
[skip ci]
|
|
|
|
| |
https://github.com/swig/swig/pull/853
|
|
|
|
|
|
|
|
| |
This reverts commit a96409875462468c8ebdbadb8bc9e5f7566f7794, reversing
changes made to bda3a11f9e167629300cecdea3139505c3cf4c84.
SWIG should only provide default operator names that provide special
standard or conventional meaning in the target language.
|
| |
|
|
|
|
| |
This corrects for compilers that need stdio.h
|
|
|
|
|
|
|
| |
Most R header files can be included within C++ programs but they should
not be included within an extern "C" block (as they include system headers).
This patch moves the Rdefines.h and Rversion.h outside the extern block.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The vector of pointers (just fixed) were not working correctly because the
descriptors returned from swig::type_info() were sometimes returning
zero. Zero should only be used for void * as the subsequent call to
SWIG_ConvertPtr will blindly cast the pointer without checking
descriptor.
std::vector<void *> does not work and will require further changes:
specializing traits_info<void *> to return 0 and traits_asptr<void *>.
I tried this and traits_asptr<void> also needs to be added in which
seems odd and requires further investigation...
Lib/python/pystdcommon.swg:
template <> struct traits_info<void *> {
static swig_type_info *type_info() {
static swig_type_info *info = 0;
}
};
Lib/std/std_common.i:
template <>
struct traits_asptr<void *> {
static int asptr(PyObject *obj, void ***val) {
void **p;
swig_type_info *descriptor = 0;
int res = SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0);
if (SWIG_IsOK(res)) {
if (val) *val = p;
}
return res;
}
};
// this is needed, but am not sure this is expected
template <>
struct traits_asptr<void> {
static int asptr(PyObject *obj, void **val) {
void **p;
swig_type_info *descriptor = 0;
int res = SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0);
if (SWIG_IsOK(res)) {
if (val) *val = p;
}
return res;
}
};
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Suppress unmessage at package load
|
| |
| |
| |
| | |
‘print’ from package ‘base’ in package <some package>
|