summaryrefslogtreecommitdiff
path: root/complex.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-14 09:35:08 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-14 09:35:08 +0000
commit583400c15eb3bf88fb2e2f9eb62c44608297ba20 (patch)
tree0d5916aaac2f466fcc684a28e01e88ba064d0e53 /complex.c
parenta81206ae3f8ed1f131ee7e5ced754c87ac3ec162 (diff)
* complex.c: trivial changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/complex.c b/complex.c
index 07b8223561..1d31f6a08f 100644
--- a/complex.c
+++ b/complex.c
@@ -377,13 +377,15 @@ nucomp_s_canonicalize(int argc, VALUE *argv, VALUE klass)
switch (rb_scan_args(argc, argv, "11", &real, &image)) {
case 1:
+ nucomp_real_check(real);
image = ZERO;
break;
+ default:
+ nucomp_real_check(real);
+ nucomp_real_check(image);
+ break;
}
- nucomp_real_check(real);
- nucomp_real_check(image);
-
return nucomp_s_canonicalize_internal(klass, real, image);
}
#endif
@@ -395,13 +397,15 @@ nucomp_s_new(int argc, VALUE *argv, VALUE klass)
switch (rb_scan_args(argc, argv, "11", &real, &image)) {
case 1:
+ nucomp_real_check(real);
image = ZERO;
break;
+ default:
+ nucomp_real_check(real);
+ nucomp_real_check(image);
+ break;
}
- nucomp_real_check(real);
- nucomp_real_check(image);
-
return nucomp_s_canonicalize_internal(klass, real, image);
}
@@ -1125,9 +1129,8 @@ string_to_c_internal(VALUE self)
}
if (NIL_P(m)) {
m = f_match(comp_pat2, s);
- if (NIL_P(m)) {
+ if (NIL_P(m))
return rb_assoc_new(Qnil, self);
- }
sr = f_aref(m, INT2FIX(1));
if (NIL_P(f_aref(m, INT2FIX(2))))
si = Qnil;
@@ -1495,5 +1498,5 @@ Init_Complex(void)
/*
Local variables:
c-file-style: "ruby"
-end:
+End:
*/