diff options
author | Ted Ross <tross@apache.org> | 2009-08-24 18:04:21 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2009-08-24 18:04:21 +0000 |
commit | 5585f3a3a52b59ebd2fb543a7b9b0fc3a854821b (patch) | |
tree | 2e73b35d3f94dfea5f37bf1d67a4bacb867c39cd | |
parent | 8aa5b3e1c1cb28d0b7fd2cefec9ed4f85b3606a5 (diff) | |
download | qpid-python-5585f3a3a52b59ebd2fb543a7b9b0fc3a854821b.tar.gz |
Fixed Ruby typemaps so 64-bit values are handled correctly on 32-bit architectures.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@807323 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | cpp/bindings/qmf/ruby/ruby.i | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/cpp/bindings/qmf/ruby/ruby.i b/cpp/bindings/qmf/ruby/ruby.i index 8c2da1b494..b7fed403bd 100644 --- a/cpp/bindings/qmf/ruby/ruby.i +++ b/cpp/bindings/qmf/ruby/ruby.i @@ -38,7 +38,7 @@ %typemap (out) uint16_t { - $result = UINT2NUM((unsigned short) $1); + $result = UINT2NUM((uint16_t) $1); } %typemap (in) uint32_t @@ -51,7 +51,7 @@ %typemap (out) uint32_t { - $result = UINT2NUM((unsigned int) $1); + $result = UINT2NUM((uint32_t) $1); } %typemap (in) int32_t @@ -64,7 +64,7 @@ %typemap (out) int32_t { - $result = INT2NUM((int) $1); + $result = INT2NUM((int32_t) $1); } %typemap (typecheck, precedence=SWIG_TYPECHECK_INTEGER) uint32_t { @@ -73,25 +73,28 @@ %typemap (in) uint64_t { - $1 = NUM2ULONG ($input); + if (TYPE($input) == T_BIGNUM) + $1 = NUM2ULL($input); + else + $1 = (uint64_t) FIX2LONG($input); } %typemap (out) uint64_t { - $result = ULONG2NUM((long) $1); + $result = ULL2NUM((uint64_t) $1); } %typemap (in) int64_t { if (TYPE($input) == T_BIGNUM) - $1 = NUM2LONG($input); + $1 = NUM2LL($input); else - $1 = FIX2LONG($input); + $1 = (int64_t) FIX2LONG($input); } %typemap (out) int64_t { - $result = LONG2NUM((long) $1); + $result = LL2NUM((int64_t) $1); } %typemap (typecheck, precedence=SWIG_TYPECHECK_INTEGER) uint64_t { |