diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-11-18 12:13:08 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-11-19 12:36:19 +0900 |
commit | 0e8219f591f3f17cb7ee361e8a60dbef08145883 (patch) | |
tree | 89704f4d90521cf52ef1befc5e87429f8a9d5da3 /numeric.c | |
parent | 78e266da1dede1c81e634982e76a129c5720d80e (diff) |
make functions static
These functions are used from within a compilation unit so we can
make them static, for better binary size. This changeset reduces
the size of generated ruby binary from 26,590,128 bytes to
26,584,472 bytes on my macihne.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2682
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1404,6 +1404,7 @@ rb_float_equal(VALUE x, VALUE y) } #define flo_eq rb_float_equal +static VALUE rb_dbl_hash(double d); /* * call-seq: @@ -1420,7 +1421,7 @@ flo_hash(VALUE num) return rb_dbl_hash(RFLOAT_VALUE(num)); } -VALUE +static VALUE rb_dbl_hash(double d) { return LONG2FIX(rb_dbl_long_hash(d)); @@ -2099,7 +2100,7 @@ int_half_p_half_down(VALUE num, VALUE n, VALUE f) /* * Assumes num is an Integer, ndigits <= 0 */ -VALUE +static VALUE rb_int_round(VALUE num, int ndigits, enum ruby_num_rounding_mode mode) { VALUE n, f, h, r; @@ -3342,7 +3343,7 @@ rb_int_succ(VALUE num) * (-1).pred #=> -2 */ -VALUE +static VALUE rb_int_pred(VALUE num) { if (FIXNUM_P(num)) { |