aboutsummaryrefslogtreecommitdiffstats
path: root/compar.c
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-12 10:44:21 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-12 10:44:21 +0000
commitdda5dc00cff334cac373096d444a0fd59e716124 (patch)
treed9ab9c1dc4cede235a3bbaea653c07f38ea880b9 /compar.c
parent51e25545aeb1555051b95c5b31b4f3ca6ec6b6fe (diff)
downloadruby-dda5dc00cff334cac373096d444a0fd59e716124.tar.gz
* array.c: moved to ANSI function style from K&R function style.
(used protoize on windows, so still K&R remains on #ifdef part of other platforms. And `foo _((boo))' stuff is still there) [ruby-dev:26975] * bignum.c, class.c, compar.c, dir.c, dln.c, dmyext.c, enum.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, main.c, marshal.c, math.c, numeric.c, object.c, pack.c, prec.c, process.c, random.c, range.c, re.c, regcomp.c, regenc.c, regerror.c, regexec.c, regparse.c, regparse.h, ruby.c, signal.c, sprintf.c, st.c, string.c, struct.c, time.c, util.h, variable.c, version.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compar.c')
-rw-r--r--compar.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/compar.c b/compar.c
index a3ee684778..fd06cf0c15 100644
--- a/compar.c
+++ b/compar.c
@@ -17,8 +17,7 @@ VALUE rb_mComparable;
static ID cmp;
int
-rb_cmpint(val, a, b)
- VALUE val, a, b;
+rb_cmpint(VALUE val, VALUE a, VALUE b)
{
if (NIL_P(val)) {
rb_cmperr(a, b);
@@ -34,8 +33,7 @@ rb_cmpint(val, a, b)
}
void
-rb_cmperr(x, y)
- VALUE x, y;
+rb_cmperr(VALUE x, VALUE y)
{
const char *classname;
@@ -51,8 +49,7 @@ rb_cmperr(x, y)
}
static VALUE
-cmp_eq(a)
- VALUE *a;
+cmp_eq(VALUE *a)
{
VALUE c = rb_funcall(a[0], cmp, 1, a[1]);
@@ -62,7 +59,7 @@ cmp_eq(a)
}
static VALUE
-cmp_failed()
+cmp_failed(void)
{
return Qnil;
}
@@ -77,8 +74,7 @@ cmp_failed()
*/
static VALUE
-cmp_equal(x, y)
- VALUE x, y;
+cmp_equal(VALUE x, VALUE y)
{
VALUE a[2];
@@ -97,8 +93,7 @@ cmp_equal(x, y)
*/
static VALUE
-cmp_gt(x, y)
- VALUE x, y;
+cmp_gt(VALUE x, VALUE y)
{
VALUE c = rb_funcall(x, cmp, 1, y);
@@ -115,8 +110,7 @@ cmp_gt(x, y)
*/
static VALUE
-cmp_ge(x, y)
- VALUE x, y;
+cmp_ge(VALUE x, VALUE y)
{
VALUE c = rb_funcall(x, cmp, 1, y);
@@ -133,8 +127,7 @@ cmp_ge(x, y)
*/
static VALUE
-cmp_lt(x, y)
- VALUE x, y;
+cmp_lt(VALUE x, VALUE y)
{
VALUE c = rb_funcall(x, cmp, 1, y);
@@ -152,8 +145,7 @@ cmp_lt(x, y)
*/
static VALUE
-cmp_le(x, y)
- VALUE x, y;
+cmp_le(VALUE x, VALUE y)
{
VALUE c = rb_funcall(x, cmp, 1, y);
@@ -177,8 +169,7 @@ cmp_le(x, y)
*/
static VALUE
-cmp_between(x, min, max)
- VALUE x, min, max;
+cmp_between(VALUE x, VALUE min, VALUE max)
{
if (RTEST(cmp_lt(x, min))) return Qfalse;
if (RTEST(cmp_gt(x, max))) return Qfalse;
@@ -223,7 +214,7 @@ cmp_between(x, min, max)
*/
void
-Init_Comparable()
+Init_Comparable(void)
{
rb_mComparable = rb_define_module("Comparable");
rb_define_method(rb_mComparable, "==", cmp_equal, 1);