diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-04 15:10:28 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-04 15:10:28 +0000 |
commit | 5eab13c377a60869d89e770f163323efeaff8da2 (patch) | |
tree | 3a00d1dc30f2daa0c70baaa3d82dd59da85566a3 /marshal.c | |
parent | aff64b94786b51d105a93ae3c635b5afca853554 (diff) | |
download | ruby-5eab13c377a60869d89e770f163323efeaff8da2.tar.gz |
* marshal.c (r_object0): Generalize a round up expression.
Use BDIGIT instead of int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r-- | marshal.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1620,7 +1620,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod) #if SIZEOF_BDIGITS == SIZEOF_SHORT rb_big_resize((VALUE)big, len); #else - rb_big_resize((VALUE)big, (len + 1) * 2 / sizeof(BDIGIT)); + rb_big_resize((VALUE)big, (len * 2 + sizeof(BDIGIT) - 1) / sizeof(BDIGIT)); #endif digits = RBIGNUM_DIGITS(big); MEMCPY(digits, RSTRING_PTR(data), char, len * 2); @@ -1638,7 +1638,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod) int i; for (i=0; i<SIZEOF_BDIGITS; i++) { - num |= (int)p[i] << shift; + num |= (BDIGIT)p[i] << shift; shift += 8; } #else |