[Ruby] Fix to handle FIXNUM values greater than MAXINT passed for a double parameter.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11320 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
75198b86bf
commit
45611ebd57
3 changed files with 8 additions and 1 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
Version 1.3.40 (in progress)
|
Version 1.3.40 (in progress)
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
2009-06-26: olly
|
||||||
|
[Ruby] Fix to handle FIXNUM values greater than MAXINT passed for a
|
||||||
|
double parameter.
|
||||||
|
|
||||||
2009-06-24: wsfulton
|
2009-06-24: wsfulton
|
||||||
Fix wrapping methods with default arguments and the compactdefaultargs feature
|
Fix wrapping methods with default arguments and the compactdefaultargs feature
|
||||||
where a class is passed by value and is assigned a default value. The SwigValueWrapper
|
where a class is passed by value and is assigned a default value. The SwigValueWrapper
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,9 @@ end
|
||||||
|
|
||||||
raise RuntimeError if fail != 1
|
raise RuntimeError if fail != 1
|
||||||
|
|
||||||
|
# Test a number which won't fit in a 32 bit integer and is represented
|
||||||
|
# as a FIXNUM by Ruby.
|
||||||
|
raise RuntimeError if val_double(51767811298) != 51767811298
|
||||||
|
|
||||||
raise RuntimeError if val_double_2(1.0) != 4.0
|
raise RuntimeError if val_double_2(1.0) != 4.0
|
||||||
raise RuntimeError if val_double_2(1) != 4
|
raise RuntimeError if val_double_2(1) != 4
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ SWIG_AsVal_dec(unsigned long long)(VALUE obj, unsigned long long *val)
|
||||||
}
|
}
|
||||||
|
|
||||||
%fragment(SWIG_AsVal_frag(double),"header",fragment="SWIG_ruby_failed") {
|
%fragment(SWIG_AsVal_frag(double),"header",fragment="SWIG_ruby_failed") {
|
||||||
%ruby_aux_method(double, NUM2DBL, (type == T_FLOAT ? NUM2DBL(obj) : (type == T_FIXNUM ? (double) FIX2INT(obj) : rb_big2dbl(obj))))
|
%ruby_aux_method(double, NUM2DBL, NUM2DBL(obj))
|
||||||
|
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
SWIG_AsVal_dec(double)(VALUE obj, double *val)
|
SWIG_AsVal_dec(double)(VALUE obj, double *val)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue