diff options
| author | Ted Ross <tross@apache.org> | 2009-08-24 15:55:14 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2009-08-24 15:55:14 +0000 |
| commit | 77eabe05e21ce283b9dd749de2952f0115b394e2 (patch) | |
| tree | f32e1c0a73a1eacc4d98c6da47cddcffe48c77fe /qpid/cpp/bindings/qmf/ruby/ruby.i | |
| parent | e84cfeafcc8e767842dd5b851870e0e29dd582b8 (diff) | |
| download | qpid-python-77eabe05e21ce283b9dd749de2952f0115b394e2.tar.gz | |
Added QMF tests for method invocation and numeric types.
Improved the swig typemaps to handle different numeric cases.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@807288 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/bindings/qmf/ruby/ruby.i')
| -rw-r--r-- | qpid/cpp/bindings/qmf/ruby/ruby.i | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/qpid/cpp/bindings/qmf/ruby/ruby.i b/qpid/cpp/bindings/qmf/ruby/ruby.i index a8a2a87a97..8c2da1b494 100644 --- a/qpid/cpp/bindings/qmf/ruby/ruby.i +++ b/qpid/cpp/bindings/qmf/ruby/ruby.i @@ -43,7 +43,10 @@ %typemap (in) uint32_t { - $1 = NUM2UINT ($input); + if (TYPE($input) == T_BIGNUM) + $1 = NUM2UINT($input); + else + $1 = FIX2UINT($input); } %typemap (out) uint32_t @@ -51,6 +54,19 @@ $result = UINT2NUM((unsigned int) $1); } +%typemap (in) int32_t +{ + if (TYPE($input) == T_BIGNUM) + $1 = NUM2INT($input); + else + $1 = FIX2INT($input); +} + +%typemap (out) int32_t +{ + $result = INT2NUM((int) $1); +} + %typemap (typecheck, precedence=SWIG_TYPECHECK_INTEGER) uint32_t { $1 = FIXNUM_P($input); } @@ -62,7 +78,20 @@ %typemap (out) uint64_t { - $result = ULONG2NUM((unsigned long) $1); + $result = ULONG2NUM((long) $1); +} + +%typemap (in) int64_t +{ + if (TYPE($input) == T_BIGNUM) + $1 = NUM2LONG($input); + else + $1 = FIX2LONG($input); +} + +%typemap (out) int64_t +{ + $result = LONG2NUM((long) $1); } %typemap (typecheck, precedence=SWIG_TYPECHECK_INTEGER) uint64_t { |
