From fde8edaf53806777e606e04187d60d5b3f26d886 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 25 Oct 2001 01:29:37 +0000 Subject: Add do { ... } while (0) to more bad macros. --- contrib/tsearch/txtidx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'contrib/tsearch/txtidx.c') diff --git a/contrib/tsearch/txtidx.c b/contrib/tsearch/txtidx.c index 39a64437c5..e1abd54d3b 100644 --- a/contrib/tsearch/txtidx.c +++ b/contrib/tsearch/txtidx.c @@ -88,12 +88,16 @@ uniqueentry( WordEntry* a, int4 l, char *buf, int4 *outbuflen ) { #define WAITNEXTCHAR 3 #define WAITENDCMPLX 4 -#define RESIZEPRSBUF if ( state->curpos - state->word == state->len ) { \ +#define RESIZEPRSBUF \ +do { \ + if ( state->curpos - state->word == state->len ) \ + { \ int4 clen = state->curpos - state->word; \ state->len *= 2; \ state->word = (char*)repalloc( (void*)state->word, state->len ); \ state->curpos = state->word + clen; \ -} + } \ +} while (0) int4 gettoken_txtidx( TI_IN_STATE *state ) { -- cgit v1.2.1