summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--ext/date/date_core.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d383aaafbb..916ea54569 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Jun 30 21:16:04 2011 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * ext/date/date_core.c (m_ajd): refers a constant.
+
Thu Jun 30 20:54:25 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/io/console/io-console.gemspec: spin-off gem for 1.9.2.
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index a18365eb21..66d980fcf4 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -1481,6 +1481,8 @@ m_fr(union DateData *x)
}
}
+#define HALF_DAYS_IN_SECONDS (DAY_IN_SECONDS / 2)
+
static VALUE
m_ajd(union DateData *x)
{
@@ -1495,7 +1497,7 @@ m_ajd(union DateData *x)
r = m_real_jd(x);
df = m_df(x);
- df -= 43200; /* 12 hours */
+ df -= HALF_DAYS_IN_SECONDS;
if (df)
r = f_add(r, isec_to_day(df));
sf = m_sf(x);