summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-30 23:48:21 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-30 23:48:21 +0000
commitf91a5563400156bbacc6373a2dea0dcaf182a433 (patch)
tree2b940be6807f78c48b3b263f20e1e8141d6d9496 /struct.c
parentb49075cdf15a733cf7a9b1f9ce9d06c40828db3d (diff)
downloadruby-f91a5563400156bbacc6373a2dea0dcaf182a433.tar.gz
* struct.c (struct_member_pos): avoid implicit conversion loses
integer precision: 'long' to 'int'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51080 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 b68f2a8a44..17c4643b72 100644
--- a/struct.c
+++ b/struct.c
@@ -131,7 +131,7 @@ struct_member_pos(VALUE s, VALUE name)
{
VALUE back = struct_ivar_get(rb_obj_class(s), id_back_members);
VALUE const * p;
- long j, mask;
+ int j, mask;
if (UNLIKELY(NIL_P(back))) {
rb_raise(rb_eTypeError, "uninitialized struct");
@@ -141,12 +141,12 @@ struct_member_pos(VALUE s, VALUE name)
}
p = RARRAY_CONST_PTR(back);
- mask = RARRAY_LEN(back);
+ mask = RARRAY_LENINT(back);
if (mask <= AREF_HASH_THRESHOLD) {
if (UNLIKELY(RSTRUCT_LEN(s) != RARRAY_LEN(back))) {
rb_raise(rb_eTypeError,
- "struct size differs (%ld required %ld given)",
+ "struct size differs (%d required %ld given)",
mask, RSTRUCT_LEN(s));
}
for (j = 0; j < mask; j++) {