Commit graph

27 commits

Author SHA1 Message Date
William S Fulton
973590ff91 R rtypecheck typemaps
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.
2022-11-05 08:40:26 +00:00
William S Fulton
752b7e82cd Add missing SWIGTYPE *const& typemaps 2022-10-13 22:22:18 +01:00
William S Fulton
c10a84c775 Cosmetic stray semi-colon removal after %typemap using quotes 2022-08-31 19:40:13 +01:00
khoran
d58041606e fixed some missing semicolons. Each one caused a compile error in generated code 2020-03-25 11:01:12 -07:00
Richard Beare
43af20ab3b FIX: references to enums now functioning
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.
2019-03-08 21:56:36 +11:00
Joseph C Wang
4e8c515d36 add new tests and coercion files for null fix #1124 2017-11-26 03:43:39 +08:00
William S Fulton
ede1e9544c Fix R Lib files and testcase failing due to new preprocessor checks
Fixes unknown preprocessor directive error introduced in #217
commit 255c929c56
These were probably intended as script comments using # when C/C++
comments using // or /* */ should have been used.
2014-10-29 23:11:09 +00:00
William S Fulton
bcb7aee022 Merge branch 'master' into gsoc2009-matevz
Conflicts:
	Examples/Makefile.in
	Examples/guile/Makefile.in
	Lib/php/php.swg
	Makefile.in
	Source/CParse/parser.y
	configure.ac
2013-10-10 07:26:09 +01:00
joequant
93b63969f9 change to allow file SEXP return values 2013-07-14 20:28:17 +08:00
William S Fulton
e805d5f925 Merge branch 'master' into gsoc2009-matevz
parser.y still to be fixed up

Conflicts:
	Doc/Devel/engineering.html
	Examples/Makefile.in
	Lib/allegrocl/allegrocl.swg
	Lib/csharp/csharp.swg
	Lib/csharp/enums.swg
	Lib/csharp/enumsimple.swg
	Lib/csharp/enumtypesafe.swg
	Lib/java/java.swg
	Lib/python/pydocs.swg
	Lib/r/rtype.swg
	Source/Include/swigwarn.h
	Source/Modules/octave.cxx
	Source/Modules/python.cxx
	Source/Modules/ruby.cxx
	Source/Swig/scanner.c
	Source/Swig/stype.c
	Source/Swig/swig.h
	configure.ac
2013-01-28 07:01:37 +00:00
William S Fulton
ac74c90fb0 Add rvalue reference typemaps 2013-01-24 20:27:29 +00:00
joequant
308b5dab3f r changes to handle external pointers 2013-01-06 19:42:12 +08:00
Joseph Wang
33bb317b61 make ExternalReference slot ref to contain reference
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13721 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-26 03:35:04 +00:00
William S Fulton
be1c4d2e68 Revert r13601 as it breaks older versions of R
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13713 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-20 21:20:19 +00:00
Joseph Wang
fad95da7f5 change R components so that pointers are visible through ref
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13601 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-12 15:21:39 +00:00
Joseph Wang
a18af913fb fix typo in int definition
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12951 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-03-25 12:01:46 +00:00
Joseph Wang
5a0269c3bf fix typos and add more typecheck
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12943 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-03-21 15:44:01 +00:00
Joseph Wang
efa5edbe5b use type checks to order r outputs
add noreturn exception handler


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12935 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-03-18 10:48:48 +00:00
William S Fulton
bdb136d611 Change typemap matching rules for the default type (SWIGTYPE) to follow template partial specialization type deduction. Fixes some containers of const pointers. SWIGTYPE*& typemps removed and replaced with SWIGTYPE *const&.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11958 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-04-01 18:26:37 +00:00
Joseph Wang
b279cd3dde add std_map
fix compact mode


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11731 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-11-10 02:32:29 +00:00
Joseph Wang
e351dfceaf first pass at making fcompact work with R
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11722 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-11-04 03:48:17 +00:00
Joseph Wang
809bbb89e3 put in integer fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11059 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-01-12 08:57:16 +00:00
Joseph Wang
4b5c817793 Fix integer handling in r. unsigned values where getting handled
incorrected as reals leading to crashes


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11052 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-01-11 00:08:37 +00:00
Joseph Wang
67e2785cb7 change as(...,"integer") to as.integer to force conversion into integers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11015 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-12-29 22:25:55 +00:00
Joseph Wang
ebf910f755 remove numerical conversion in corecions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10425 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-05-08 02:39:52 +00:00
Joseph Wang
5993327dc0 remove numeric coercion which seems to be unnecessary
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10394 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-04-26 19:40:07 +00:00
Joseph Wang
ef80a4f59a Committing R-SWIG
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9175 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-06-29 03:01:18 +00:00