summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-30 06:20:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-30 06:20:26 +0000
commite449d06f15a7b65b8f8bb1441dcad7c35f707b1f (patch)
tree1248058f1385e7b724e4e70e02962648cf11273b /range.c
parent69adf990e1d05603b43c6da660870ea5b9ecef49 (diff)
ChangeLog, range.c: adjust indent and style
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
-rw-r--r--range.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/range.c b/range.c
index 87e013d..8b613ec 100644
--- a/range.c
+++ b/range.c
@@ -473,24 +473,27 @@ range_step(int argc, VALUE *argv, VALUE range)
#if SIZEOF_DOUBLE == 8 && defined(HAVE_INT64_T)
union int64_double {
- int64_t i;
- double d;
+ int64_t i;
+ double d;
};
static VALUE
-int64_as_double_to_num(int64_t i) {
+int64_as_double_to_num(int64_t i)
+{
union int64_double convert;
if (i < 0) {
convert.i = -i;
return DBL2NUM(-convert.d);
- } else {
+ }
+ else {
convert.i = i;
return DBL2NUM(convert.d);
}
}
static int64_t
-double_as_int64(double d) {
+double_as_int64(double d)
+{
union int64_double convert;
convert.d = fabs(d);
return d < 0 ? -convert.i : convert.i;
@@ -498,7 +501,8 @@ double_as_int64(double d) {
#endif
static int
-is_integer_p(VALUE v) {
+is_integer_p(VALUE v)
+{
VALUE is_int = rb_check_funcall(v, id_integer_p, 0, 0);
return RTEST(is_int) && is_int != Qundef;
}