From 147775ac2b21b6591d24cc2af23b8fccb3daf3fa Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 7 Jun 2013 02:41:45 +0000 Subject: use NUM2SIZET and SIZET2NUM * configure.in: revert r41106. size_t may not be unsigned * bignum.c (rb_absint_size_in_word, rb_int_export, rb_int_import): use NUM2SIZET() and SIZET2NUM() already defined in ruby/ruby.h. * ext/-test-/bignum/export.c (rb_int_export_m): ditto. * ext/-test-/bignum/import.c (rb_int_import_m): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/-test-/bignum/export.c | 4 ++-- ext/-test-/bignum/import.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/-test-') diff --git a/ext/-test-/bignum/export.c b/ext/-test-/bignum/export.c index 33cc2d0a42..56e4f9f6dc 100644 --- a/ext/-test-/bignum/export.c +++ b/ext/-test-/bignum/export.c @@ -7,7 +7,7 @@ rb_int_export_m(VALUE val, VALUE buf, VALUE wordorder, VALUE wordsize_arg, VALUE int sign; size_t count = 0; void *ret; - size_t wordsize = NUM2SIZE(wordsize_arg); + size_t wordsize = NUM2SIZET(wordsize_arg); if (!NIL_P(buf)) { StringValue(buf); @@ -19,7 +19,7 @@ rb_int_export_m(VALUE val, VALUE buf, VALUE wordorder, VALUE wordsize_arg, VALUE &sign, &count, NIL_P(buf) ? NULL : RSTRING_PTR(buf), count, NUM2INT(wordorder), wordsize, NUM2INT(endian), NUM2INT(nails)); - return rb_ary_new_from_args(3, INT2NUM(sign), ret ? rb_str_new(ret, wordsize * count) : Qnil, SIZE2NUM(count)); + return rb_ary_new_from_args(3, INT2NUM(sign), ret ? rb_str_new(ret, wordsize * count) : Qnil, SIZET2NUM(count)); } void diff --git a/ext/-test-/bignum/import.c b/ext/-test-/bignum/import.c index 22cc86dcde..c50d855c44 100644 --- a/ext/-test-/bignum/import.c +++ b/ext/-test-/bignum/import.c @@ -7,8 +7,8 @@ rb_int_import_m(VALUE klass, VALUE sign, VALUE buf, VALUE wordcount, VALUE wordo StringValue(buf); return rb_int_import(NUM2INT(sign), RSTRING_PTR(buf), - NUM2SIZE(wordcount), NUM2INT(wordorder), NUM2SIZE(wordsize), - NUM2INT(endian), NUM2SIZE(nails)); + NUM2SIZET(wordcount), NUM2INT(wordorder), NUM2SIZET(wordsize), + NUM2INT(endian), NUM2SIZET(nails)); } void -- cgit v1.2.3