mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Add do { ... } while (0) to more bad macros.
This commit is contained in:
@ -555,7 +555,9 @@ typedef struct {
|
||||
int4 buflen;
|
||||
} INFIX;
|
||||
|
||||
#define RESIZEBUF(inf,addsize) while( ( inf->cur - inf->buf ) + addsize + 1 >= inf->buflen ) { \
|
||||
#define RESIZEBUF(inf,addsize) \
|
||||
while( ( inf->cur - inf->buf ) + addsize + 1 >= inf->buflen ) \
|
||||
{ \
|
||||
int4 len = inf->cur - inf->buf; \
|
||||
inf->buflen *= 2; \
|
||||
inf->buf = (char*) repalloc( (void*)inf->buf, inf->buflen ); \
|
||||
|
@ -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 ) {
|
||||
|
Reference in New Issue
Block a user