diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-20 13:23:13 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-20 13:23:13 +0000 |
commit | 479bf5e516644f4f278da3be13914592f1962eb0 (patch) | |
tree | 14baf4d21698cef9ab6434a759201bce131e88ee | |
parent | d66c22bfde282e23a74433bee835ad05f7328731 (diff) |
merges r29952 from trunk into ruby_1_9_2.
--
* time.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | time.c | 12 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 11 insertions, 7 deletions
@@ -1,3 +1,7 @@ +Sat Nov 27 19:12:10 2010 Tanaka Akira <akr@fsij.org> + + * time.c: parenthesize macro arguments. + Sat Nov 27 18:08:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> * time.c (leap_year_v_p): fixed typo. [ruby-dev:42631] @@ -184,7 +184,7 @@ quo(VALUE x, VALUE y) return ret; } -#define mulquo(x,y,z) ((y == z) ? x : quo(mul(x,y),z)) +#define mulquo(x,y,z) (((y) == (z)) ? (x) : quo(mul((x),(y)),(z))) static void divmodv(VALUE n, VALUE d, VALUE *q, VALUE *r) @@ -856,8 +856,8 @@ static int leap_year_p(long y); #define leap_year_v_p(y) leap_year_p(NUM2LONG(mod((y), INT2FIX(400)))) #ifdef HAVE_GMTIME_R -#define rb_gmtime_r(t, tm) gmtime_r(t, tm) -#define rb_localtime_r(t, tm) localtime_r(t, tm) +#define rb_gmtime_r(t, tm) gmtime_r((t), (tm)) +#define rb_localtime_r(t, tm) localtime_r((t), (tm)) #else static inline struct tm * rb_gmtime_r(const time_t *tp, struct tm *result) @@ -1762,9 +1762,9 @@ struct time_object { }; #define GetTimeval(obj, tobj) \ - TypedData_Get_Struct(obj, struct time_object, &time_data_type, tobj) + TypedData_Get_Struct((obj), struct time_object, &time_data_type, (tobj)) -#define IsTimeval(obj) rb_typeddata_is_kind_of(obj, &time_data_type) +#define IsTimeval(obj) rb_typeddata_is_kind_of((obj), &time_data_type) #define TIME_UTC_P(tobj) ((tobj)->gmt == 1) #define TIME_SET_UTC(tobj) ((tobj)->gmt = 1) @@ -2703,7 +2703,7 @@ find_time_t(struct tm *tptr, int utc_p, time_t *tp) int status; int tptr_tm_yday; -#define GUESS(p) (DEBUG_FIND_TIME_NUMGUESS_INC (utc_p ? gmtime_with_leapsecond(p, &result) : LOCALTIME(p, result))) +#define GUESS(p) (DEBUG_FIND_TIME_NUMGUESS_INC (utc_p ? gmtime_with_leapsecond((p), &result) : LOCALTIME((p), result))) guess_lo = TIMET_MIN; guess_hi = TIMET_MAX; @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 108 +#define RUBY_PATCHLEVEL 109 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |