summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-14 00:36:26 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-14 00:36:26 +0000
commite95f7ea80d096cf27ea0ae5f7dc712ad72e71f3c (patch)
treec2550b798f6f44c9b0aef99617c8dca47ca55420 /numeric.c
parentda39d32f60778b111c6cf063ae74e2627be14b77 (diff)
* variable.c (trace_ev): Removed "not reached" comment as this line is
reached. * variable.c (rb_obj_remove_instance_variable): Replaced "not reached" comment with the UNREACHABLE macro. * variable.c (rb_mod_const_missing): ditto. * variable.c (rb_mod_remove_cvar): ditto. * enum.c (first_i): ditto. * string.c (rb_str_aref): ditto. * string.c (str_byte_aref): ditto. * string.c (rb_to_id): ditto. * io.c (rb_io_fmode_modestr): ditto. * io.c (rb_io_oflags_modestr): ditto. * pack.c (num2i32): ditto. * vm_eval.c (rb_method_missing): ditto. * vm_eval.c (rb_f_throw): ditto. * dir.c (dir_read): ditto. * win32/win32.c (child_result): ditto. * struct.c (rb_struct_getmember): ditto. * struct.c (rb_struct_set): ditto. * struct.c (rb_struct_aref_id): ditto. * eval.c (rb_f_raise): ditto. * process.c (rb_f_exit_bang): ditto. * process.c (rb_f_exit): ditto. * process.c (rb_f_abort): ditto. * ext/-test-/iter/break.c (iter_break_value): ditto. * ext/pty/pty.c (pty_check): ditto. * ext/openssl/ossl_pkey.c (ossl_pkey_new): ditto. * ext/readline/readline.c (rb_remove_history): ditto. * ext/stringio/stringio.c (strio_unimpl): ditto. * numeric.c (num_sadded): ditto. * numeric.c (num_init_copy): ditto. * numeric.c (rb_num2ll): ditto. * numeric.c (rb_num2ull): ditto. * vm_insnhelper.c (call_cfunc): ditto. * ruby.c (opt_W_getter): ditto. * bignum.c (rb_big_coerce): ditto. * file.c (rb_f_test): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/numeric.c b/numeric.c
index 7371236426..03abf6db8f 100644
--- a/numeric.c
+++ b/numeric.c
@@ -260,7 +260,8 @@ num_sadded(VALUE x, VALUE name)
"can't define singleton method \"%s\" for %s",
rb_id2name(mid),
rb_obj_classname(x));
- return Qnil; /* not reached */
+
+ UNREACHABLE;
}
/* :nodoc: */
@@ -269,7 +270,8 @@ num_init_copy(VALUE x, VALUE y)
{
/* Numerics are immutable values, which should not be copied */
rb_raise(rb_eTypeError, "can't copy %s", rb_obj_classname(x));
- return Qnil; /* not reached */
+
+ UNREACHABLE;
}
/*
@@ -2099,17 +2101,19 @@ rb_num2ll(VALUE val)
case T_STRING:
rb_raise(rb_eTypeError, "no implicit conversion from string");
- return Qnil; /* not reached */
+ break;
case T_TRUE:
case T_FALSE:
rb_raise(rb_eTypeError, "no implicit conversion from boolean");
- return Qnil; /* not reached */
+ break;
default:
val = rb_to_int(val);
return NUM2LL(val);
}
+
+ UNREACHABLE;
}
unsigned LONG_LONG
@@ -2141,17 +2145,19 @@ rb_num2ull(VALUE val)
case T_STRING:
rb_raise(rb_eTypeError, "no implicit conversion from string");
- return Qnil; /* not reached */
+ break;
case T_TRUE:
case T_FALSE:
rb_raise(rb_eTypeError, "no implicit conversion from boolean");
- return Qnil; /* not reached */
+ break;
default:
val = rb_to_int(val);
return NUM2ULL(val);
}
+
+ UNREACHABLE;
}
#endif /* HAVE_LONG_LONG */