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
This commit is contained in:
Joseph Wang 2008-12-29 22:25:55 +00:00
commit 67e2785cb7

View file

@ -35,15 +35,18 @@
INTSXP.
*/
/* Force coercion of integer, since by default R sets all constants to
numeric, which means that you can't directly call a function with an
integer using an R numercal literal */
%typemap(scoercein) int, int *, int &
%{ $input = as($input, "integer"); %}
%{ $input = as.integer($input); %}
%typemap(scoercein) ptrdiff_t, ptrdiff_t *, ptrdiff_t &
%{ $input = as($input, "integer"); %}
%{ $input = as.integer($input); %}
%typemap(scoercein) unsigned long, unsigned long *, unsigned long &
%{ $input = as($input, "integer"); %}
%{ $input = as.integer($input); %}
%typemap(scoercein) unsigned int, unsigned int *, unsigned int &
%{ $input = as($input, "integer"); %}
%{ $input = as.integer($input); %}
%typemap(scoercein) double, double *, double &
%{ %}
%typemap(scoercein) float, float *, float &