summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-17 04:57:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-17 04:57:14 +0000
commit6224216294b68b739eaab201746c9a0d8ac57cb3 (patch)
treebc07129c670fbd1352d8ba63e6dfbdb233c9b8c4 /rational.c
parent57e557908a8c4c01390b7ea52b09f8370a3d7dd3 (diff)
unused functions and variables
* complex.c, rational.c: remove unused functions, which are warned by clang 5.1, and also variables only used by removed functions. * ext/date/date_core.c: ditto. * enc/utf_16be.c, enc/utf_16le.c: comment out constants only used by commented out functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c36
1 files changed, 1 insertions, 35 deletions
diff --git a/rational.c b/rational.c
index fe2d11e692..c035a1a89f 100644
--- a/rational.c
+++ b/rational.c
@@ -31,7 +31,7 @@
VALUE rb_cRational;
static ID id_abs, id_cmp, id_convert, id_eqeq_p, id_expt, id_fdiv,
- id_floor, id_idiv, id_integer_p, id_negate, id_to_f,
+ id_idiv, id_integer_p, id_negate, id_to_f,
id_to_i, id_truncate, id_i_num, id_i_den;
#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
@@ -92,14 +92,6 @@ f_div(VALUE x, VALUE y)
}
inline static VALUE
-f_gt_p(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x) && FIXNUM_P(y))
- return f_boolcast(FIX2LONG(x) > FIX2LONG(y));
- return rb_funcall(x, '>', 1, y);
-}
-
-inline static VALUE
f_lt_p(VALUE x, VALUE y)
{
if (FIXNUM_P(x) && FIXNUM_P(y))
@@ -142,7 +134,6 @@ f_sub(VALUE x, VALUE y)
}
fun1(abs)
-fun1(floor)
fun1(integer_p)
fun1(negate)
@@ -161,8 +152,6 @@ f_to_f(VALUE x)
return rb_funcall(x, id_to_f, 0);
}
-fun1(truncate)
-
inline static VALUE
f_eqeq_p(VALUE x, VALUE y)
{
@@ -474,14 +463,6 @@ f_rational_new_bang1(VALUE klass, VALUE x)
return nurat_s_new_internal(klass, x, ONE);
}
-inline static VALUE
-f_rational_new_bang2(VALUE klass, VALUE x, VALUE y)
-{
- assert(f_positive_p(y));
- assert(f_nonzero_p(y));
- return nurat_s_new_internal(klass, x, y);
-}
-
#ifdef CANONICALIZATION_FOR_MATHN
#define CANON
#endif
@@ -580,13 +561,6 @@ nurat_s_new(int argc, VALUE *argv, VALUE klass)
}
inline static VALUE
-f_rational_new1(VALUE klass, VALUE x)
-{
- assert(!k_rational_p(x));
- return nurat_s_canonicalize_internal(klass, x, ONE);
-}
-
-inline static VALUE
f_rational_new2(VALUE klass, VALUE x, VALUE y)
{
assert(!k_rational_p(x));
@@ -595,13 +569,6 @@ f_rational_new2(VALUE klass, VALUE x, VALUE y)
}
inline static VALUE
-f_rational_new_no_reduce1(VALUE klass, VALUE x)
-{
- assert(!k_rational_p(x));
- return nurat_s_canonicalize_internal_no_reduce(klass, x, ONE);
-}
-
-inline static VALUE
f_rational_new_no_reduce2(VALUE klass, VALUE x, VALUE y)
{
assert(!k_rational_p(x));
@@ -2530,7 +2497,6 @@ Init_Rational(void)
id_eqeq_p = rb_intern("==");
id_expt = rb_intern("**");
id_fdiv = rb_intern("fdiv");
- id_floor = rb_intern("floor");
id_idiv = rb_intern("div");
id_integer_p = rb_intern("integer?");
id_negate = rb_intern("-@");