aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-25 07:04:02 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-25 07:04:02 +0000
commit939383275c555c1a23cee3d41676aee90e843b92 (patch)
treee623cf694c19b7cc9ed9298cddb091d37c6ff934
parentc7cfaac6686e20871ada91c6b5872b6405c34ecc (diff)
downloadruby-939383275c555c1a23cee3d41676aee90e843b92.tar.gz
* time.c (TIME_COPY_GMT): new macro.
(time_s_at): use TIME_COPY_GMT. (time_succ): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--time.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e5f7cb9387..14e277b808 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Apr 25 16:03:21 2009 Tanaka Akira <akr@fsij.org>
+
+ * time.c (TIME_COPY_GMT): new macro.
+ (time_s_at): use TIME_COPY_GMT.
+ (time_succ): ditto.
+
Sat Apr 25 15:54:04 2009 Tanaka Akira <akr@fsij.org>
* time.c (time_mload): use TIME_SET_UTC.
diff --git a/time.c b/time.c
index dbea6cafdc..2b5606f61a 100644
--- a/time.c
+++ b/time.c
@@ -1002,6 +1002,8 @@ struct time_object {
#define TIME_LOCALTIME_P(tobj) ((tobj)->gmt == 0)
#define TIME_SET_LOCALTIME(tobj) ((tobj)->gmt = 0)
+#define TIME_COPY_GMT(tobj1, tobj2) ((tobj1)->gmt = (tobj2)->gmt)
+
static VALUE time_get_tm(VALUE, struct time_object *);
#define MAKE_TM(time, tobj) \
do { \
@@ -1359,7 +1361,7 @@ time_s_at(int argc, VALUE *argv, VALUE klass)
GetTimeval(time, tobj);
t = time_new_timev(klass, tobj->timev);
GetTimeval(t, tobj2);
- tobj2->gmt = tobj->gmt;
+ TIME_COPY_GMT(tobj2, tobj);
}
else {
timev = num_exact(time);
@@ -2450,7 +2452,7 @@ time_succ(VALUE time)
GetTimeval(time, tobj);
time = time_new_timev(rb_cTime, add(tobj->timev, INT2FIX(1)));
GetTimeval(time, tobj2);
- tobj2->gmt = tobj->gmt;
+ TIME_COPY_GMT(tobj2, tobj);
return time;
}