mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* time.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2451d735a7
commit
cf869bc14d
2 changed files with 10 additions and 6 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]
|
||||
|
|
12
time.c
12
time.c
|
@ -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)
|
||||
|
@ -1799,9 +1799,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)
|
||||
|
@ -2740,7 +2740,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;
|
||||
|
|
Loading…
Reference in a new issue