summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c331
1 files changed, 98 insertions, 233 deletions
diff --git a/object.c b/object.c
index d94620fde6..0952837a0c 100644
--- a/object.c
+++ b/object.c
@@ -43,8 +43,7 @@ static ID id_eq, id_eql, id_inspect, id_init_copy;
*/
VALUE
-rb_equal(obj1, obj2)
- VALUE obj1, obj2;
+rb_equal(VALUE obj1, VALUE obj2)
{
VALUE result;
@@ -55,8 +54,7 @@ rb_equal(obj1, obj2)
}
int
-rb_eql(obj1, obj2)
- VALUE obj1, obj2;
+rb_eql(VALUE obj1, VALUE obj2)
{
return RTEST(rb_funcall(obj1, id_eql, 1, obj2));
}
@@ -91,8 +89,7 @@ rb_eql(obj1, obj2)
*/
static VALUE
-rb_obj_equal(obj1, obj2)
- VALUE obj1, obj2;
+rb_obj_equal(VALUE obj1, VALUE obj2)
{
if (obj1 == obj2) return Qtrue;
return Qfalse;
@@ -129,8 +126,7 @@ rb_obj_equal(obj1, obj2)
*/
VALUE
-rb_obj_id(obj)
- VALUE obj;
+rb_obj_id(VALUE obj)
{
if (SPECIAL_CONST_P(obj)) {
return LONG2NUM((long)obj);
@@ -139,8 +135,7 @@ rb_obj_id(obj)
}
VALUE
-rb_class_real(cl)
- VALUE cl;
+rb_class_real(VALUE cl)
{
while (FL_TEST(cl, FL_SINGLETON) || TYPE(cl) == T_ICLASS) {
cl = RCLASS(cl)->super;
@@ -163,15 +158,13 @@ rb_class_real(cl)
*/
VALUE
-rb_obj_class(obj)
- VALUE obj;
+rb_obj_class(VALUE obj)
{
return rb_class_real(CLASS_OF(obj));
}
static void
-init_copy(dest, obj)
- VALUE dest, obj;
+init_copy(VALUE dest, VALUE obj)
{
if (OBJ_FROZEN(dest)) {
rb_raise(rb_eTypeError, "[bug] frozen object (%s) allocated", rb_obj_classname(dest));
@@ -220,8 +213,7 @@ init_copy(dest, obj)
*/
VALUE
-rb_obj_clone(obj)
- VALUE obj;
+rb_obj_clone(VALUE obj)
{
VALUE clone;
@@ -256,8 +248,7 @@ rb_obj_clone(obj)
*/
VALUE
-rb_obj_dup(obj)
- VALUE obj;
+rb_obj_dup(VALUE obj)
{
VALUE dup;
@@ -272,8 +263,7 @@ rb_obj_dup(obj)
/* :nodoc: */
VALUE
-rb_obj_init_copy(obj, orig)
- VALUE obj, orig;
+rb_obj_init_copy(VALUE obj, VALUE orig)
{
if (obj == orig) return obj;
rb_check_frozen(obj);
@@ -294,8 +284,7 @@ rb_obj_init_copy(obj, orig)
*/
VALUE
-rb_any_to_s(obj)
- VALUE obj;
+rb_any_to_s(VALUE obj)
{
char *cname = rb_obj_classname(obj);
VALUE str;
@@ -307,17 +296,13 @@ rb_any_to_s(obj)
}
VALUE
-rb_inspect(obj)
- VALUE obj;
+rb_inspect(VALUE obj)
{
return rb_obj_as_string(rb_funcall(obj, id_inspect, 0, 0));
}
static int
-inspect_i(id, value, str)
- ID id;
- VALUE value;
- VALUE str;
+inspect_i(ID id, VALUE value, VALUE str)
{
VALUE str2;
char *ivname;
@@ -343,9 +328,7 @@ inspect_i(id, value, str)
}
static VALUE
-inspect_obj(obj, str, recur)
- VALUE obj, str;
- int recur;
+inspect_obj(VALUE obj, VALUE str, int recur)
{
if (recur) {
rb_str_cat2(str, " ...");
@@ -374,8 +357,7 @@ inspect_obj(obj, str, recur)
static VALUE
-rb_obj_inspect(obj)
- VALUE obj;
+rb_obj_inspect(VALUE obj)
{
if (TYPE(obj) == T_OBJECT
&& ROBJECT(obj)->iv_tbl
@@ -400,8 +382,7 @@ rb_obj_inspect(obj)
*/
VALUE
-rb_obj_is_instance_of(obj, c)
- VALUE obj, c;
+rb_obj_is_instance_of(VALUE obj, VALUE c)
{
switch (TYPE(c)) {
case T_MODULE:
@@ -444,8 +425,7 @@ rb_obj_is_instance_of(obj, c)
*/
VALUE
-rb_obj_is_kind_of(obj, c)
- VALUE obj, c;
+rb_obj_is_kind_of(VALUE obj, VALUE c)
{
VALUE cl = CLASS_OF(obj);
@@ -574,7 +554,7 @@ rb_obj_is_kind_of(obj, c)
*/
static VALUE
-rb_obj_dummy()
+rb_obj_dummy(void)
{
return Qnil;
}
@@ -588,8 +568,7 @@ rb_obj_dummy()
*/
VALUE
-rb_obj_tainted(obj)
- VALUE obj;
+rb_obj_tainted(VALUE obj)
{
if (OBJ_TAINTED(obj))
return Qtrue;
@@ -606,8 +585,7 @@ rb_obj_tainted(obj)
*/
VALUE
-rb_obj_taint(obj)
- VALUE obj;
+rb_obj_taint(VALUE obj)
{
rb_secure(4);
if (!OBJ_TAINTED(obj)) {
@@ -628,8 +606,7 @@ rb_obj_taint(obj)
*/
VALUE
-rb_obj_untaint(obj)
- VALUE obj;
+rb_obj_untaint(VALUE obj)
{
rb_secure(3);
if (OBJ_TAINTED(obj)) {
@@ -642,8 +619,7 @@ rb_obj_untaint(obj)
}
void
-rb_obj_infect(obj1, obj2)
- VALUE obj1, obj2;
+rb_obj_infect(VALUE obj1, VALUE obj2)
{
OBJ_INFECT(obj1, obj2);
}
@@ -669,8 +645,7 @@ rb_obj_infect(obj1, obj2)
*/
VALUE
-rb_obj_freeze(obj)
- VALUE obj;
+rb_obj_freeze(VALUE obj)
{
if (!OBJ_FROZEN(obj)) {
if (rb_safe_level() >= 4 && !OBJ_TAINTED(obj)) {
@@ -693,8 +668,7 @@ rb_obj_freeze(obj)
*/
static VALUE
-rb_obj_frozen_p(obj)
- VALUE obj;
+rb_obj_frozen_p(VALUE obj)
{
if (OBJ_FROZEN(obj)) return Qtrue;
return Qfalse;
@@ -718,8 +692,7 @@ rb_obj_frozen_p(obj)
static VALUE
-nil_to_i(obj)
- VALUE obj;
+nil_to_i(VALUE obj)
{
return INT2FIX(0);
}
@@ -734,8 +707,7 @@ nil_to_i(obj)
*/
static VALUE
-nil_to_f(obj)
- VALUE obj;
+nil_to_f(VALUE obj)
{
return rb_float_new(0.0);
}
@@ -750,8 +722,7 @@ nil_to_f(obj)
*/
static VALUE
-nil_to_s(obj)
- VALUE obj;
+nil_to_s(VALUE obj)
{
return rb_str_new2("");
}
@@ -766,8 +737,7 @@ nil_to_s(obj)
*/
static VALUE
-nil_to_a(obj)
- VALUE obj;
+nil_to_a(VALUE obj)
{
return rb_ary_new2(0);
}
@@ -780,8 +750,7 @@ nil_to_a(obj)
*/
static VALUE
-nil_inspect(obj)
- VALUE obj;
+nil_inspect(VALUE obj)
{
return rb_str_new2("nil");
}
@@ -809,8 +778,7 @@ nil_plus(x, y)
#endif
static VALUE
-main_to_s(obj)
- VALUE obj;
+main_to_s(VALUE obj)
{
return rb_str_new2("main");
}
@@ -834,8 +802,7 @@ main_to_s(obj)
*/
static VALUE
-true_to_s(obj)
- VALUE obj;
+true_to_s(VALUE obj)
{
return rb_str_new2("true");
}
@@ -850,8 +817,7 @@ true_to_s(obj)
*/
static VALUE
-true_and(obj, obj2)
- VALUE obj, obj2;
+true_and(VALUE obj, VALUE obj2)
{
return RTEST(obj2)?Qtrue:Qfalse;
}
@@ -873,8 +839,7 @@ true_and(obj, obj2)
*/
static VALUE
-true_or(obj, obj2)
- VALUE obj, obj2;
+true_or(VALUE obj, VALUE obj2)
{
return Qtrue;
}
@@ -890,8 +855,7 @@ true_or(obj, obj2)
*/
static VALUE
-true_xor(obj, obj2)
- VALUE obj, obj2;
+true_xor(VALUE obj, VALUE obj2)
{
return RTEST(obj2)?Qfalse:Qtrue;
}
@@ -915,8 +879,7 @@ true_xor(obj, obj2)
*/
static VALUE
-false_to_s(obj)
- VALUE obj;
+false_to_s(VALUE obj)
{
return rb_str_new2("false");
}
@@ -932,8 +895,7 @@ false_to_s(obj)
*/
static VALUE
-false_and(obj, obj2)
- VALUE obj, obj2;
+false_and(VALUE obj, VALUE obj2)
{
return Qfalse;
}
@@ -949,8 +911,7 @@ false_and(obj, obj2)
*/
static VALUE
-false_or(obj, obj2)
- VALUE obj, obj2;
+false_or(VALUE obj, VALUE obj2)
{
return RTEST(obj2)?Qtrue:Qfalse;
}
@@ -969,8 +930,7 @@ false_or(obj, obj2)
*/
static VALUE
-false_xor(obj, obj2)
- VALUE obj, obj2;
+false_xor(VALUE obj, VALUE obj2)
{
return RTEST(obj2)?Qtrue:Qfalse;
}
@@ -983,8 +943,7 @@ false_xor(obj, obj2)
*/
static VALUE
-rb_true(obj)
- VALUE obj;
+rb_true(VALUE obj)
{
return Qtrue;
}
@@ -999,8 +958,7 @@ rb_true(obj)
static VALUE
-rb_false(obj)
- VALUE obj;
+rb_false(VALUE obj)
{
return Qfalse;
}
@@ -1016,8 +974,7 @@ rb_false(obj)
*/
static VALUE
-rb_obj_pattern_match(obj1, obj2)
- VALUE obj1, obj2;
+rb_obj_pattern_match(VALUE obj1, VALUE obj2)
{
return Qnil;
}
@@ -1067,8 +1024,7 @@ rb_obj_pattern_match(obj1, obj2)
*/
static VALUE
-sym_to_i(sym)
- VALUE sym;
+sym_to_i(VALUE sym)
{
ID id = SYM2ID(sym);
@@ -1086,8 +1042,7 @@ sym_to_i(sym)
*/
static VALUE
-sym_inspect(sym)
- VALUE sym;
+sym_inspect(VALUE sym)
{
VALUE str;
char *name;
@@ -1117,8 +1072,7 @@ sym_inspect(sym)
static VALUE
-sym_to_s(sym)
- VALUE sym;
+sym_to_s(VALUE sym)
{
return rb_str_new2(rb_id2name(SYM2ID(sym)));
}
@@ -1134,8 +1088,7 @@ sym_to_s(sym)
*/
static VALUE
-sym_to_sym(sym)
- VALUE sym;
+sym_to_sym(VALUE sym)
{
return sym;
}
@@ -1179,9 +1132,7 @@ sym_to_sym(sym)
*/
static VALUE
-rb_mod_to_s(klass)
- VALUE klass;
-
+rb_mod_to_s(VALUE klass)
{
if (FL_TEST(klass, FL_SINGLETON)) {
VALUE s = rb_str_new2("#<");
@@ -1211,8 +1162,7 @@ rb_mod_to_s(klass)
*/
static VALUE
-rb_mod_freeze(mod)
- VALUE mod;
+rb_mod_freeze(VALUE mod)
{
rb_mod_to_s(mod);
return rb_obj_freeze(mod);
@@ -1229,8 +1179,7 @@ rb_mod_freeze(mod)
*/
static VALUE
-rb_mod_eqq(mod, arg)
- VALUE mod, arg;
+rb_mod_eqq(VALUE mod, VALUE arg)
{
return rb_obj_is_kind_of(arg, mod);
}
@@ -1248,8 +1197,7 @@ rb_mod_eqq(mod, arg)
*/
VALUE
-rb_class_inherited_p(mod, arg)
- VALUE mod, arg;
+rb_class_inherited_p(VALUE mod, VALUE arg)
{
VALUE start = mod;
@@ -1287,8 +1235,7 @@ rb_class_inherited_p(mod, arg)
*/
static VALUE
-rb_mod_lt(mod, arg)
- VALUE mod, arg;
+rb_mod_lt(VALUE mod, VALUE arg)
{
if (mod == arg) return Qfalse;
return rb_class_inherited_p(mod, arg);
@@ -1308,8 +1255,7 @@ rb_mod_lt(mod, arg)
*/
static VALUE
-rb_mod_ge(mod, arg)
- VALUE mod, arg;
+rb_mod_ge(VALUE mod, VALUE arg)
{
switch (TYPE(arg)) {
case T_MODULE:
@@ -1334,8 +1280,7 @@ rb_mod_ge(mod, arg)
*/
static VALUE
-rb_mod_gt(mod, arg)
- VALUE mod, arg;
+rb_mod_gt(VALUE mod, VALUE arg)
{
if (mod == arg) return Qfalse;
return rb_mod_ge(mod, arg);
@@ -1353,8 +1298,7 @@ rb_mod_gt(mod, arg)
*/
static VALUE
-rb_mod_cmp(mod, arg)
- VALUE mod, arg;
+rb_mod_cmp(VALUE mod, VALUE arg)
{
VALUE cmp;
@@ -1375,10 +1319,8 @@ rb_mod_cmp(mod, arg)
return INT2FIX(1);
}
-static VALUE rb_module_s_alloc _((VALUE));
static VALUE
-rb_module_s_alloc(klass)
- VALUE klass;
+rb_module_s_alloc(VALUE klass)
{
VALUE mod = rb_module_new();
@@ -1386,10 +1328,8 @@ rb_module_s_alloc(klass)
return mod;
}
-static VALUE rb_class_s_alloc _((VALUE));
static VALUE
-rb_class_s_alloc(klass)
- VALUE klass;
+rb_class_s_alloc(VALUE klass)
{
return rb_class_boot(0);
}
@@ -1418,8 +1358,7 @@ rb_class_s_alloc(klass)
*/
static VALUE
-rb_mod_initialize(module)
- VALUE module;
+rb_mod_initialize(VALUE module)
{
if (rb_block_given_p()) {
rb_mod_module_eval(0, 0, module);
@@ -1438,10 +1377,7 @@ rb_mod_initialize(module)
*/
static VALUE
-rb_class_initialize(argc, argv, klass)
- int argc;
- VALUE *argv;
- VALUE klass;
+rb_class_initialize(int argc, VALUE *argv, VALUE klass)
{
VALUE super;
@@ -1472,8 +1408,7 @@ rb_class_initialize(argc, argv, klass)
*/
VALUE
-rb_obj_alloc(klass)
- VALUE klass;
+rb_obj_alloc(VALUE klass)
{
VALUE obj;
@@ -1490,10 +1425,8 @@ rb_obj_alloc(klass)
return obj;
}
-static VALUE rb_class_allocate_instance _((VALUE));
static VALUE
-rb_class_allocate_instance(klass)
- VALUE klass;
+rb_class_allocate_instance(VALUE klass)
{
NEWOBJ(obj, struct RObject);
OBJSETUP(obj, klass, T_OBJECT);
@@ -1513,10 +1446,7 @@ rb_class_allocate_instance(klass)
*/
VALUE
-rb_class_new_instance(argc, argv, klass)
- int argc;
- VALUE *argv;
- VALUE klass;
+rb_class_new_instance(int argc, VALUE *argv, VALUE klass)
{
VALUE obj;
@@ -1539,8 +1469,7 @@ rb_class_new_instance(argc, argv, klass)
*/
static VALUE
-rb_class_superclass(klass)
- VALUE klass;
+rb_class_superclass(VALUE klass)
{
VALUE super = RCLASS(klass)->super;
@@ -1557,8 +1486,7 @@ rb_class_superclass(klass)
}
static ID
-str_to_id(str)
- VALUE str;
+str_to_id(VALUE str)
{
if (!RSTRING(str)->ptr || RSTRING(str)->len == 0) {
rb_raise(rb_eArgError, "empty symbol string");
@@ -1570,8 +1498,7 @@ str_to_id(str)
}
ID
-rb_to_id(name)
- VALUE name;
+rb_to_id(VALUE name)
{
VALUE tmp;
ID id;
@@ -1626,10 +1553,7 @@ rb_to_id(name)
*/
static VALUE
-rb_mod_attr(argc, argv, klass)
- int argc;
- VALUE *argv;
- VALUE klass;
+rb_mod_attr(int argc, VALUE *argv, VALUE klass)
{
VALUE name, pub;
@@ -1648,10 +1572,7 @@ rb_mod_attr(argc, argv, klass)
*/
static VALUE
-rb_mod_attr_reader(argc, argv, klass)
- int argc;
- VALUE *argv;
- VALUE klass;
+rb_mod_attr_reader(int argc, VALUE *argv, VALUE klass)
{
int i;
@@ -1670,10 +1591,7 @@ rb_mod_attr_reader(argc, argv, klass)
*/
static VALUE
-rb_mod_attr_writer(argc, argv, klass)
- int argc;
- VALUE *argv;
- VALUE klass;
+rb_mod_attr_writer(int argc, VALUE *argv, VALUE klass)
{
int i;
@@ -1697,10 +1615,7 @@ rb_mod_attr_writer(argc, argv, klass)
*/
static VALUE
-rb_mod_attr_accessor(argc, argv, klass)
- int argc;
- VALUE *argv;
- VALUE klass;
+rb_mod_attr_accessor(int argc, VALUE *argv, VALUE klass)
{
int i;
@@ -1720,8 +1635,7 @@ rb_mod_attr_accessor(argc, argv, klass)
*/
static VALUE
-rb_mod_const_get(mod, name)
- VALUE mod, name;
+rb_mod_const_get(VALUE mod, VALUE name)
{
ID id = rb_to_id(name);
@@ -1744,8 +1658,7 @@ rb_mod_const_get(mod, name)
*/
static VALUE
-rb_mod_const_set(mod, name, value)
- VALUE mod, name, value;
+rb_mod_const_set(VALUE mod, VALUE name, VALUE value)
{
ID id = rb_to_id(name);
@@ -1767,8 +1680,7 @@ rb_mod_const_set(mod, name, value)
*/
static VALUE
-rb_mod_const_defined(mod, name)
- VALUE mod, name;
+rb_mod_const_defined(VALUE mod, VALUE name)
{
ID id = rb_to_id(name);
@@ -1799,10 +1711,7 @@ rb_mod_const_defined(mod, name)
static VALUE
-rb_obj_methods(argc, argv, obj)
- int argc;
- VALUE *argv;
- VALUE obj;
+rb_obj_methods(int argc, VALUE *argv, VALUE obj)
{
retry:
if (argc == 0) {
@@ -1833,10 +1742,7 @@ rb_obj_methods(argc, argv, obj)
*/
static VALUE
-rb_obj_protected_methods(argc, argv, obj)
- int argc;
- VALUE *argv;
- VALUE obj;
+rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj)
{
if (argc == 0) { /* hack to stop warning */
VALUE args[1];
@@ -1857,10 +1763,7 @@ rb_obj_protected_methods(argc, argv, obj)
*/
static VALUE
-rb_obj_private_methods(argc, argv, obj)
- int argc;
- VALUE *argv;
- VALUE obj;
+rb_obj_private_methods(int argc, VALUE *argv, VALUE obj)
{
if (argc == 0) { /* hack to stop warning */
VALUE args[1];
@@ -1881,10 +1784,7 @@ rb_obj_private_methods(argc, argv, obj)
*/
static VALUE
-rb_obj_public_methods(argc, argv, obj)
- int argc;
- VALUE *argv;
- VALUE obj;
+rb_obj_public_methods(int argc, VALUE *argv, VALUE obj)
{
if (argc == 0) { /* hack to stop warning */
VALUE args[1];
@@ -1914,8 +1814,7 @@ rb_obj_public_methods(argc, argv, obj)
*/
static VALUE
-rb_obj_ivar_get(obj, iv)
- VALUE obj, iv;
+rb_obj_ivar_get(VALUE obj, VALUE iv)
{
ID id = rb_to_id(iv);
@@ -1947,8 +1846,7 @@ rb_obj_ivar_get(obj, iv)
*/
static VALUE
-rb_obj_ivar_set(obj, iv, val)
- VALUE obj, iv, val;
+rb_obj_ivar_set(VALUE obj, VALUE iv, VALUE val)
{
ID id = rb_to_id(iv);
@@ -1973,8 +1871,7 @@ rb_obj_ivar_set(obj, iv, val)
*/
static VALUE
-rb_mod_cvar_get(obj, iv)
- VALUE obj, iv;
+rb_mod_cvar_get(VALUE obj, VALUE iv)
{
ID id = rb_to_id(iv);
@@ -2003,8 +1900,7 @@ rb_mod_cvar_get(obj, iv)
*/
static VALUE
-rb_mod_cvar_set(obj, iv, val)
- VALUE obj, iv, val;
+rb_mod_cvar_set(VALUE obj, VALUE iv, VALUE val)
{
ID id = rb_to_id(iv);
@@ -2016,10 +1912,7 @@ rb_mod_cvar_set(obj, iv, val)
}
static VALUE
-convert_type(val, tname, method, raise)
- VALUE val;
- const char *tname, *method;
- int raise;
+convert_type(VALUE val, const char *tname, const char *method, int raise)
{
ID m;
@@ -2041,10 +1934,7 @@ convert_type(val, tname, method, raise)
}
VALUE
-rb_convert_type(val, type, tname, method)
- VALUE val;
- int type;
- const char *tname, *method;
+rb_convert_type(VALUE val, int type, const char *tname, const char *method)
{
VALUE v;
@@ -2059,10 +1949,7 @@ rb_convert_type(val, type, tname, method)
}
VALUE
-rb_check_convert_type(val, type, tname, method)
- VALUE val;
- int type;
- const char *tname, *method;
+rb_check_convert_type(VALUE val, int type, const char *tname, const char *method)
{
VALUE v;
@@ -2080,9 +1967,7 @@ rb_check_convert_type(val, type, tname, method)
static VALUE
-rb_to_integer(val, method)
- VALUE val;
- const char *method;
+rb_to_integer(VALUE val, const char *method)
{
VALUE v = convert_type(val, "Integer", method, Qtrue);
if (!rb_obj_is_kind_of(v, rb_cInteger)) {
@@ -2094,9 +1979,7 @@ rb_to_integer(val, method)
}
VALUE
-rb_check_to_integer(val, method)
- VALUE val;
- const char *method;
+rb_check_to_integer(VALUE val, const char *method)
{
VALUE v = convert_type(val, "Integer", method, Qfalse);
if (!rb_obj_is_kind_of(v, rb_cInteger)) {
@@ -2106,15 +1989,13 @@ rb_check_to_integer(val, method)
}
VALUE
-rb_to_int(val)
- VALUE val;
+rb_to_int(VALUE val)
{
return rb_to_integer(val, "to_int");
}
VALUE
-rb_Integer(val)
- VALUE val;
+rb_Integer(VALUE val)
{
VALUE tmp;
@@ -2161,16 +2042,13 @@ rb_Integer(val)
*/
static VALUE
-rb_f_integer(obj, arg)
- VALUE obj, arg;
+rb_f_integer(VALUE obj, VALUE arg)
{
return rb_Integer(arg);
}
double
-rb_cstr_to_dbl(p, badcheck)
- const char *p;
- int badcheck;
+rb_cstr_to_dbl(const char *p, int badcheck)
{
const char *q;
char *end;
@@ -2237,9 +2115,7 @@ rb_cstr_to_dbl(p, badcheck)
}
double
-rb_str_to_dbl(str, badcheck)
- VALUE str;
- int badcheck;
+rb_str_to_dbl(VALUE str, int badcheck)
{
char *s;
long len;
@@ -2263,8 +2139,7 @@ rb_str_to_dbl(str, badcheck)
}
VALUE
-rb_Float(val)
- VALUE val;
+rb_Float(VALUE val)
{
switch (TYPE(val)) {
case T_FIXNUM:
@@ -2307,15 +2182,13 @@ rb_Float(val)
*/
static VALUE
-rb_f_float(obj, arg)
- VALUE obj, arg;
+rb_f_float(VALUE obj, VALUE arg)
{
return rb_Float(arg);
}
double
-rb_num2dbl(val)
- VALUE val;
+rb_num2dbl(VALUE val)
{
switch (TYPE(val)) {
case T_FLOAT:
@@ -2337,9 +2210,7 @@ rb_num2dbl(val)
}
char*
-rb_str2cstr(str, len)
- VALUE str;
- long *len;
+rb_str2cstr(VALUE str, long *len)
{
StringValue(str);
if (len) *len = RSTRING(str)->len;
@@ -2350,8 +2221,7 @@ rb_str2cstr(str, len)
}
VALUE
-rb_String(val)
- VALUE val;
+rb_String(VALUE val)
{
return rb_convert_type(val, T_STRING, "String", "to_s");
}
@@ -2370,15 +2240,13 @@ rb_String(val)
*/
static VALUE
-rb_f_string(obj, arg)
- VALUE obj, arg;
+rb_f_string(VALUE obj, VALUE arg)
{
return rb_String(arg);
}
VALUE
-rb_Array(val)
- VALUE val;
+rb_Array(VALUE val)
{
VALUE tmp = rb_check_array_type(val);
@@ -2404,16 +2272,13 @@ rb_Array(val)
*/
static VALUE
-rb_f_array(obj, arg)
- VALUE obj, arg;
+rb_f_array(VALUE obj, VALUE arg)
{
return rb_Array(arg);
}
static VALUE
-boot_defclass(name, super)
- char *name;
- VALUE super;
+boot_defclass(char *name, VALUE super)
{
extern st_table *rb_class_tbl;
VALUE obj = rb_class_boot(super);
@@ -2502,7 +2367,7 @@ VALUE ruby_top_self;
*/
void
-Init_Object()
+Init_Object(void)
{
VALUE metaclass;