diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-01 04:09:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-01 04:09:02 +0000 |
commit | c4816a11e4fd954a12f6cb12fc5ba23adf8d6a4b (patch) | |
tree | be571cb0489eb97ea0ad1c92155e59a3b19196f7 /ext/date/date_parse.c | |
parent | ba3da085961e5ffcdab405416518abef0a1d13ed (diff) |
surround macro block with do/while
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/date/date_parse.c')
-rw-r--r-- | ext/date/date_parse.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c index f0b33daae9..99a6bd7f91 100644 --- a/ext/date/date_parse.c +++ b/ext/date/date_parse.c @@ -263,18 +263,18 @@ regcomp(const char *source, long len, int opt) } #define REGCOMP(pat,opt) \ -{ \ +do { \ if (NIL_P(pat)) \ pat = regcomp(pat##_source, sizeof pat##_source - 1, opt); \ -} +} while (0) #define REGCOMP_0(pat) REGCOMP(pat, 0) #define REGCOMP_I(pat) REGCOMP(pat, ONIG_OPTION_IGNORECASE) #define MATCH(s,p,c) \ -{ \ +do { \ return match(s, p, hash, c); \ -} +} while (0) static int match(VALUE str, VALUE pat, VALUE hash, int (*cb)(VALUE, VALUE)) @@ -314,30 +314,30 @@ subx(VALUE str, VALUE rep, VALUE pat, VALUE hash, int (*cb)(VALUE, VALUE)) } #define SUBS(s,p,c) \ -{ \ +do { \ return subx(s, asp_string(), p, hash, c); \ -} +} while (0) #ifdef TIGHT_PARSER #define SUBA(s,p,c) \ -{ \ +do { \ return subx(s, asuba_string(), p, hash, c); \ -} +} while (0) #define SUBB(s,p,c) \ -{ \ +do { \ return subx(s, asubb_string(), p, hash, c); \ -} +} while (0) #define SUBW(s,p,c) \ -{ \ +do { \ return subx(s, asubw_string(), p, hash, c); \ -} +} while (0) #define SUBT(s,p,c) \ -{ \ +do { \ return subx(s, asubt_string(), p, hash, c); \ -} +} while (0) #endif #include "zonetab.h" |