aboutsummaryrefslogtreecommitdiff
path: root/regex
diff options
context:
space:
mode:
Diffstat (limited to 'regex')
-rw-r--r--regex/engine.c2
-rw-r--r--regex/regexec.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/regex/engine.c b/regex/engine.c
index 069a473921c5..056be0c9786e 100644
--- a/regex/engine.c
+++ b/regex/engine.c
@@ -118,7 +118,7 @@ static char *pchar(int ch);
#ifdef REDEBUG
#define SP(t, s, c) print(m, t, s, c, stdout)
#define AT(t, p1, p2, s1, s2) at(m, t, p1, p2, s1, s2)
-#define NOTE(str) { if (m->eflags&REG_TRACE) printf("=%s\n", (str)); }
+#define NOTE(str) do { if (m->eflags&REG_TRACE) printf("=%s\n", (str)); } while(0);
#else
#define SP(t, s, c) /* nothing */
#define AT(t, p1, p2, s1, s2) /* nothing */
diff --git a/regex/regexec.c b/regex/regexec.c
index 67abd01e5c87..6fed64010f40 100644
--- a/regex/regexec.c
+++ b/regex/regexec.c
@@ -114,10 +114,10 @@ static char sccsid[] = "@(#)regexec.c 8.2 (Berkeley) 3/16/94";
#define ASSIGN(d, s) memcpy(d, s, m->g->nstates)
#define EQ(a, b) (memcmp(a, b, m->g->nstates) == 0)
#define STATEVARS int vn; char *space
-#define STATESETUP(m, nv) { (m)->space = malloc((nv)*(m)->g->nstates); \
+#define STATESETUP(m, nv) do { (m)->space = malloc((nv)*(m)->g->nstates); \
if ((m)->space == NULL) return(REG_ESPACE); \
- (m)->vn = 0; }
-#define STATETEARDOWN(m) { free((m)->space); }
+ (m)->vn = 0; } while (0)
+#define STATETEARDOWN(m) free((m)->space)
#define SETUP(v) ((v) = &m->space[m->vn++ * m->g->nstates])
#define onestate int
#define INIT(o, n) ((o) = (n))