summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-20 16:43:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-20 16:43:41 +0000
commit3a6227f5ee9358bd8d0d093d0b4a7f3400e17e78 (patch)
treebeb1650b092b8a90fef0bf9b94288d0b38091117 /struct.c
parentb7d7682da879d1fe5b670486298585822f56b9f2 (diff)
downloadruby-3a6227f5ee9358bd8d0d093d0b4a7f3400e17e78.tar.gz
ruby-3a6227f5ee9358bd8d0d093d0b4a7f3400e17e78.tar.xz
ruby-3a6227f5ee9358bd8d0d093d0b4a7f3400e17e78.zip
* include/ruby/ruby.h (rb_long2int, RARRAY_LENINT): check long to
cast to int. [ruby-dev:38508] * struct.c, vm_eval.c, vm_insnhelper.c: use RARRAY_LENINT. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/struct.c b/struct.c
index 2962d400c..718add389 100644
--- a/struct.c
+++ b/struct.c
@@ -378,7 +378,7 @@ rb_struct_initialize_m(int argc, VALUE *argv, VALUE self)
VALUE
rb_struct_initialize(VALUE self, VALUE values)
{
- return rb_struct_initialize_m(RARRAY_LEN(values), RARRAY_PTR(values), self);
+ return rb_struct_initialize_m(RARRAY_LENINT(values), RARRAY_PTR(values), self);
}
static VALUE
@@ -414,10 +414,10 @@ VALUE
rb_struct_new(VALUE klass, ...)
{
VALUE tmpargs[N_REF_FUNC], *mem = tmpargs;
- long size, i;
+ int size, i;
va_list args;
- size = num_members(klass);
+ size = rb_long2int(num_members(klass));
if (size > numberof(tmpargs)) {
tmpargs[0] = rb_ary_tmp_new(size);
mem = RARRAY_PTR(tmpargs[0]);