Skip to content

Commit b492c3a

Browse files
committed
Add parentheses to macros when args are used in computations. Without
them, the executation behavior could be unexpected.
1 parent 13b729c commit b492c3a

File tree

36 files changed

+212
-212
lines changed

36 files changed

+212
-212
lines changed

contrib/intarray/_int_bool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ typedef struct
466466
int4 buflen;
467467
} INFIX;
468468

469-
#define RESIZEBUF(inf,addsize) while( ( inf->cur - inf->buf ) + addsize + 1 >= inf->buflen ) { \
469+
#define RESIZEBUF(inf,addsize) while( ( (inf)->cur - (inf)->buf ) + (addsize) + 1 >= (inf)->buflen ) { \
470470
int4 len = inf->cur - inf->buf; \
471471
inf->buflen *= 2; \
472472
inf->buf = (char*) repalloc( (void*)inf->buf, inf->buflen ); \

contrib/ltree/crc32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* Oroginal code by Spencer Garrett <srg@quick.com>
2121
*/
2222

23-
#define _CRC32_(crc, ch) (crc = (crc >> 8) ^ crc32tab[(crc ^ (ch)) & 0xff])
23+
#define _CRC32_(crc, ch) ((crc) = ((crc) >> 8) ^ crc32tab[((crc) ^ (ch)) & 0xff])
2424

2525
/* generated using the AUTODIN II polynomial
2626
* x^32 + x^26 + x^23 + x^22 + x^16 +

contrib/ltree/ltree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ typedef struct
109109
} ltxtquery;
110110

111111
#define HDRSIZEQT MAXALIGN( 2*sizeof(int4) )
112-
#define COMPUTESIZE(size,lenofoperand) ( HDRSIZEQT + size * sizeof(ITEM) + lenofoperand )
112+
#define COMPUTESIZE(size,lenofoperand) ( HDRSIZEQT + (size) * sizeof(ITEM) + (lenofoperand) )
113113
#define GETQUERY(x) (ITEM*)( (char*)(x)+HDRSIZEQT )
114114
#define GETOPERAND(x) ( (char*)GETQUERY(x) + ((ltxtquery*)x)->size * sizeof(ITEM) )
115115

contrib/ltree/ltxtquery_io.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,12 @@ typedef struct
386386
} INFIX;
387387

388388
#define RESIZEBUF(inf,addsize) \
389-
while( ( inf->cur - inf->buf ) + addsize + 1 >= inf->buflen ) \
389+
while( ( (inf)->cur - (inf)->buf ) + (addsize) + 1 >= (inf)->buflen ) \
390390
{ \
391-
int4 len = inf->cur - inf->buf; \
392-
inf->buflen *= 2; \
393-
inf->buf = (char*) repalloc( (void*)inf->buf, inf->buflen ); \
394-
inf->cur = inf->buf + len; \
391+
int4 len = (inf)->cur - (inf)->buf; \
392+
(inf)->buflen *= 2; \
393+
(inf)->buf = (char*) repalloc( (void*)(inf)->buf, (inf)->buflen ); \
394+
(inf)->cur = (inf)->buf + len; \
395395
}
396396

397397
/*

contrib/pgcrypto/crypt-blowfish.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -452,41 +452,41 @@ BF_swap(BF_word * x, int count)
452452
#if BF_SCALE
453453
/* Architectures which can shift addresses left by 2 bits with no extra cost */
454454
#define BF_ROUND(L, R, N) \
455-
tmp1 = L & 0xFF; \
456-
tmp2 = L >> 8; \
455+
tmp1 = (L) & 0xFF; \
456+
tmp2 = (L) >> 8; \
457457
tmp2 &= 0xFF; \
458-
tmp3 = L >> 16; \
458+
tmp3 = (L) >> 16; \
459459
tmp3 &= 0xFF; \
460-
tmp4 = L >> 24; \
460+
tmp4 = (L) >> 24; \
461461
tmp1 = data.ctx.S[3][tmp1]; \
462462
tmp2 = data.ctx.S[2][tmp2]; \
463463
tmp3 = data.ctx.S[1][tmp3]; \
464464
tmp3 += data.ctx.S[0][tmp4]; \
465465
tmp3 ^= tmp2; \
466-
R ^= data.ctx.P[N + 1]; \
466+
(R) ^= data.ctx.P[(N) + 1]; \
467467
tmp3 += tmp1; \
468-
R ^= tmp3;
468+
(R) ^= tmp3;
469469
#else
470470
/* Architectures with no complicated addressing modes supported */
471471
#define BF_INDEX(S, i) \
472-
(*((BF_word *)(((unsigned char *)S) + (i))))
472+
(*((BF_word *)(((unsigned char *)(S)) + (i))))
473473
#define BF_ROUND(L, R, N) \
474-
tmp1 = L & 0xFF; \
474+
tmp1 = (L) & 0xFF; \
475475
tmp1 <<= 2; \
476-
tmp2 = L >> 6; \
476+
tmp2 = (L) >> 6; \
477477
tmp2 &= 0x3FC; \
478-
tmp3 = L >> 14; \
478+
tmp3 = (L) >> 14; \
479479
tmp3 &= 0x3FC; \
480-
tmp4 = L >> 22; \
480+
tmp4 = (L) >> 22; \
481481
tmp4 &= 0x3FC; \
482482
tmp1 = BF_INDEX(data.ctx.S[3], tmp1); \
483483
tmp2 = BF_INDEX(data.ctx.S[2], tmp2); \
484484
tmp3 = BF_INDEX(data.ctx.S[1], tmp3); \
485485
tmp3 += BF_INDEX(data.ctx.S[0], tmp4); \
486486
tmp3 ^= tmp2; \
487-
R ^= data.ctx.P[N + 1]; \
487+
(R) ^= data.ctx.P[(N) + 1]; \
488488
tmp3 += tmp1; \
489-
R ^= tmp3;
489+
(R) ^= tmp3;
490490
#endif
491491

492492
/*

contrib/pgcrypto/rijndael.c

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ static void gen_tabs(void);
5757

5858
/* Invert byte order in a 32 bit variable */
5959

60-
#define bswap(x) ((rotl(x, 8) & 0x00ff00ff) | (rotr(x, 8) & 0xff00ff00))
60+
#define bswap(x) ((rotl((x), 8) & 0x00ff00ff) | (rotr((x), 8) & 0xff00ff00))
6161

6262
/* Extract byte from a 32 bit quantity (little endian notation) */
6363

64-
#define byte(x,n) ((u1byte)((x) >> (8 * n)))
64+
#define byte(x,n) ((u1byte)((x) >> (8 * (n))))
6565

6666
#if BYTE_ORDER != LITTLE_ENDIAN
6767
#define BYTE_SWAP
@@ -100,19 +100,19 @@ static u4byte il_tab[4][256];
100100
static u4byte tab_gen = 0;
101101
#endif /* !PRE_CALC_TABLES */
102102

103-
#define ff_mult(a,b) (a && b ? pow_tab[(log_tab[a] + log_tab[b]) % 255] : 0)
103+
#define ff_mult(a,b) ((a) && (b) ? pow_tab[(log_tab[a] + log_tab[b]) % 255] : 0)
104104

105-
#define f_rn(bo, bi, n, k) \
106-
bo[n] = ft_tab[0][byte(bi[n],0)] ^ \
107-
ft_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
108-
ft_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
109-
ft_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
105+
#define f_rn(bo, bi, n, k) \
106+
(bo)[n] = ft_tab[0][byte((bi)[n],0)] ^ \
107+
ft_tab[1][byte((bi)[((n) + 1) & 3],1)] ^ \
108+
ft_tab[2][byte((bi)[((n) + 2) & 3],2)] ^ \
109+
ft_tab[3][byte((bi)[((n) + 3) & 3],3)] ^ *((k) + (n))
110110

111111
#define i_rn(bo, bi, n, k) \
112-
bo[n] = it_tab[0][byte(bi[n],0)] ^ \
113-
it_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
114-
it_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
115-
it_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
112+
(bo)[n] = it_tab[0][byte((bi)[n],0)] ^ \
113+
it_tab[1][byte((bi)[((n) + 3) & 3],1)] ^ \
114+
it_tab[2][byte((bi)[((n) + 2) & 3],2)] ^ \
115+
it_tab[3][byte((bi)[((n) + 1) & 3],3)] ^ *((k) + (n))
116116

117117
#ifdef LARGE_TABLES
118118

@@ -122,17 +122,17 @@ static u4byte tab_gen = 0;
122122
fl_tab[2][byte(x, 2)] ^ \
123123
fl_tab[3][byte(x, 3)] )
124124

125-
#define f_rl(bo, bi, n, k) \
126-
bo[n] = fl_tab[0][byte(bi[n],0)] ^ \
127-
fl_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
128-
fl_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
129-
fl_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
125+
#define f_rl(bo, bi, n, k) \
126+
(bo)[n] = fl_tab[0][byte((bi)[n],0)] ^ \
127+
fl_tab[1][byte((bi)[((n) + 1) & 3],1)] ^ \
128+
fl_tab[2][byte((bi)[((n) + 2) & 3],2)] ^ \
129+
fl_tab[3][byte((bi)[((n) + 3) & 3],3)] ^ *((k) + (n))
130130

131-
#define i_rl(bo, bi, n, k) \
132-
bo[n] = il_tab[0][byte(bi[n],0)] ^ \
133-
il_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
134-
il_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
135-
il_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
131+
#define i_rl(bo, bi, n, k) \
132+
(bo)[n] = il_tab[0][byte((bi)[n],0)] ^ \
133+
il_tab[1][byte((bi)[((n) + 3) & 3],1)] ^ \
134+
il_tab[2][byte((bi)[((n) + 2) & 3],2)] ^ \
135+
il_tab[3][byte((bi)[((n) + 1) & 3],3)] ^ *((k) + (n))
136136

137137
#else
138138

@@ -142,17 +142,17 @@ static u4byte tab_gen = 0;
142142
((u4byte)sbx_tab[byte(x, 2)] << 16) ^ \
143143
((u4byte)sbx_tab[byte(x, 3)] << 24)
144144

145-
#define f_rl(bo, bi, n, k) \
146-
bo[n] = (u4byte)sbx_tab[byte(bi[n],0)] ^ \
147-
rotl(((u4byte)sbx_tab[byte(bi[(n + 1) & 3],1)]), 8) ^ \
148-
rotl(((u4byte)sbx_tab[byte(bi[(n + 2) & 3],2)]), 16) ^ \
149-
rotl(((u4byte)sbx_tab[byte(bi[(n + 3) & 3],3)]), 24) ^ *(k + n)
150-
151-
#define i_rl(bo, bi, n, k) \
152-
bo[n] = (u4byte)isb_tab[byte(bi[n],0)] ^ \
153-
rotl(((u4byte)isb_tab[byte(bi[(n + 3) & 3],1)]), 8) ^ \
154-
rotl(((u4byte)isb_tab[byte(bi[(n + 2) & 3],2)]), 16) ^ \
155-
rotl(((u4byte)isb_tab[byte(bi[(n + 1) & 3],3)]), 24) ^ *(k + n)
145+
#define f_rl(bo, bi, n, k) \
146+
(bo)[n] = (u4byte)sbx_tab[byte((bi)[n],0)] ^ \
147+
rotl(((u4byte)sbx_tab[byte((bi)[((n) + 1) & 3],1)]), 8) ^ \
148+
rotl(((u4byte)sbx_tab[byte((bi)[((n) + 2) & 3],2)]), 16) ^ \
149+
rotl(((u4byte)sbx_tab[byte((bi)[((n) + 3) & 3],3)]), 24) ^ *((k) + (n))
150+
151+
#define i_rl(bo, bi, n, k) \
152+
(bo)[n] = (u4byte)isb_tab[byte((bi)[n],0)] ^ \
153+
rotl(((u4byte)isb_tab[byte((bi)[((n) + 3) & 3],1)]), 8) ^ \
154+
rotl(((u4byte)isb_tab[byte((bi)[((n) + 2) & 3],2)]), 16) ^ \
155+
rotl(((u4byte)isb_tab[byte((bi)[((n) + 1) & 3],3)]), 24) ^ *((k) + (n))
156156
#endif
157157

158158
static void
@@ -282,25 +282,25 @@ do { t = ls_box(rotr(t, 8)) ^ rco_tab[i]; \
282282

283283
#define loop6(i) \
284284
do { t = ls_box(rotr(t, 8)) ^ rco_tab[i]; \
285-
t ^= e_key[6 * i]; e_key[6 * i + 6] = t; \
286-
t ^= e_key[6 * i + 1]; e_key[6 * i + 7] = t; \
287-
t ^= e_key[6 * i + 2]; e_key[6 * i + 8] = t; \
288-
t ^= e_key[6 * i + 3]; e_key[6 * i + 9] = t; \
289-
t ^= e_key[6 * i + 4]; e_key[6 * i + 10] = t; \
290-
t ^= e_key[6 * i + 5]; e_key[6 * i + 11] = t; \
285+
t ^= e_key[6 * (i)]; e_key[6 * (i) + 6] = t; \
286+
t ^= e_key[6 * (i) + 1]; e_key[6 * (i) + 7] = t; \
287+
t ^= e_key[6 * (i) + 2]; e_key[6 * (i) + 8] = t; \
288+
t ^= e_key[6 * (i) + 3]; e_key[6 * (i) + 9] = t; \
289+
t ^= e_key[6 * (i) + 4]; e_key[6 * (i) + 10] = t; \
290+
t ^= e_key[6 * (i) + 5]; e_key[6 * (i) + 11] = t; \
291291
} while (0)
292292

293293
#define loop8(i) \
294294
do { t = ls_box(rotr(t, 8)) ^ rco_tab[i]; \
295-
t ^= e_key[8 * i]; e_key[8 * i + 8] = t; \
296-
t ^= e_key[8 * i + 1]; e_key[8 * i + 9] = t; \
297-
t ^= e_key[8 * i + 2]; e_key[8 * i + 10] = t; \
298-
t ^= e_key[8 * i + 3]; e_key[8 * i + 11] = t; \
299-
t = e_key[8 * i + 4] ^ ls_box(t); \
300-
e_key[8 * i + 12] = t; \
301-
t ^= e_key[8 * i + 5]; e_key[8 * i + 13] = t; \
302-
t ^= e_key[8 * i + 6]; e_key[8 * i + 14] = t; \
303-
t ^= e_key[8 * i + 7]; e_key[8 * i + 15] = t; \
295+
t ^= e_key[8 * (i)]; e_key[8 * (i) + 8] = t; \
296+
t ^= e_key[8 * (i) + 1]; e_key[8 * (i) + 9] = t; \
297+
t ^= e_key[8 * (i) + 2]; e_key[8 * (i) + 10] = t; \
298+
t ^= e_key[8 * (i) + 3]; e_key[8 * (i) + 11] = t; \
299+
t = e_key[8 * (i) + 4] ^ ls_box(t); \
300+
e_key[8 * (i) + 12] = t; \
301+
t ^= e_key[8 * (i) + 5]; e_key[8 * (i) + 13] = t; \
302+
t ^= e_key[8 * (i) + 6]; e_key[8 * (i) + 14] = t; \
303+
t ^= e_key[8 * (i) + 7]; e_key[8 * (i) + 15] = t; \
304304
} while (0)
305305

306306
rijndael_ctx *

contrib/pgcrypto/sha1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/contrib/pgcrypto/sha1.c,v 1.14 2004/08/29 16:43:05 tgl Exp $ */
1+
/* $PostgreSQL: pgsql/contrib/pgcrypto/sha1.c,v 1.15 2005/05/25 21:40:39 momjian Exp $ */
22
/* $KAME: sha1.c,v 1.3 2000/02/22 14:01:18 itojun Exp $ */
33

44
/*
@@ -59,7 +59,7 @@ static uint32 _K[] = {0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6};
5959
#define F2(b, c, d) (((b) & (c)) | ((b) & (d)) | ((c) & (d)))
6060
#define F3(b, c, d) (((b) ^ (c)) ^ (d))
6161

62-
#define S(n, x) (((x) << (n)) | ((x) >> (32 - n)))
62+
#define S(n, x) (((x) << (n)) | ((x) >> (32 - (n))))
6363

6464
#define H(n) (ctxt->h.b32[(n)])
6565
#define COUNT (ctxt->count)

contrib/rtree_gist/rtree_gist.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/contrib/rtree_gist/rtree_gist.c,v 1.11 2005/05/21 12:08:05 neilc Exp $
10+
* $PostgreSQL: pgsql/contrib/rtree_gist/rtree_gist.c,v 1.12 2005/05/25 21:40:40 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -276,14 +276,14 @@ gbox_picksplit(PG_FUNCTION_ARGS)
276276

277277
#define ADDLIST( list, unionD, pos, num ) do { \
278278
if ( pos ) { \
279-
if ( unionD->high.x < cur->high.x ) unionD->high.x = cur->high.x; \
280-
if ( unionD->low.x > cur->low.x ) unionD->low.x = cur->low.x; \
281-
if ( unionD->high.y < cur->high.y ) unionD->high.y = cur->high.y; \
282-
if ( unionD->low.y > cur->low.y ) unionD->low.y = cur->low.y; \
279+
if ( (unionD)->high.x < cur->high.x ) (unionD)->high.x = cur->high.x; \
280+
if ( (unionD)->low.x > cur->low.x ) (unionD)->low.x = cur->low.x; \
281+
if ( (unionD)->high.y < cur->high.y ) (unionD)->high.y = cur->high.y; \
282+
if ( (unionD)->low.y > cur->low.y ) (unionD)->low.y = cur->low.y; \
283283
} else { \
284-
memcpy( (void*)unionD, (void*) cur, sizeof( BOX ) ); \
284+
memcpy( (void*)(unionD), (void*) cur, sizeof( BOX ) ); \
285285
} \
286-
list[pos] = num; \
286+
(list)[pos] = num; \
287287
(pos)++; \
288288
} while(0)
289289

contrib/tsearch/crc32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Oroginal code by Spencer Garrett <srg@quick.com>
1414
*/
1515

16-
#define _CRC32_(crc, ch) (crc = (crc >> 8) ^ crc32tab[(crc ^ (ch)) & 0xff])
16+
#define _CRC32_(crc, ch) ((crc) = ((crc) >> 8) ^ crc32tab[((crc) ^ (ch)) & 0xff])
1717

1818
/* generated using the AUTODIN II polynomial
1919
* x^32 + x^26 + x^23 + x^22 + x^16 +

contrib/tsearch/gistidx.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typedef char *BITVECP;
2727
}
2828

2929
#define GETBYTE(x,i) ( *( (BITVECP)(x) + (int)( (i) / BITBYTE ) ) )
30-
#define GETBITBYTE(x,i) ( ((char)(x)) >> i & 0x01 )
30+
#define GETBITBYTE(x,i) ( ((char)(x)) >> (i) & 0x01 )
3131
#define CLRBIT(x,i) GETBYTE(x,i) &= ~( 0x01 << ( (i) % BITBYTE ) )
3232
#define SETBIT(x,i) GETBYTE(x,i) |= ( 0x01 << ( (i) % BITBYTE ) )
3333
#define GETBIT(x,i) ( (GETBYTE(x,i) >> ( (i) % BITBYTE )) & 0x01 )
@@ -50,15 +50,15 @@ typedef struct
5050
#define SIGNKEY 0x02
5151
#define ALLISTRUE 0x04
5252

53-
#define ISARRKEY(x) ( ((GISTTYPE*)x)->flag & ARRKEY )
54-
#define ISSIGNKEY(x) ( ((GISTTYPE*)x)->flag & SIGNKEY )
55-
#define ISALLTRUE(x) ( ((GISTTYPE*)x)->flag & ALLISTRUE )
53+
#define ISARRKEY(x) ( ((GISTTYPE*)(x))->flag & ARRKEY )
54+
#define ISSIGNKEY(x) ( ((GISTTYPE*)(x))->flag & SIGNKEY )
55+
#define ISALLTRUE(x) ( ((GISTTYPE*)(x))->flag & ALLISTRUE )
5656

57-
#define GTHDRSIZE ( sizeof(int4)*2 )
57+
#define GTHDRSIZE ( sizeof(int4)* 2 )
5858
#define CALCGTSIZE(flag, len) ( GTHDRSIZE + ( ( (flag) & ARRKEY ) ? ((len)*sizeof(int4)) : (((flag) & ALLISTRUE) ? 0 : SIGLEN) ) )
5959

60-
#define GETSIGN(x) ( (BITVECP)( (char*)x+GTHDRSIZE ) )
61-
#define GETARR(x) ( (int4*)( (char*)x+GTHDRSIZE ) )
62-
#define ARRNELEM(x) ( ( ((GISTTYPE*)x)->len - GTHDRSIZE )/sizeof(int4) )
60+
#define GETSIGN(x) ( (BITVECP)( (char*)(x) + GTHDRSIZE ) )
61+
#define GETARR(x) ( (int4*)( (char*)(x) + GTHDRSIZE ) )
62+
#define ARRNELEM(x) ( ( ((GISTTYPE*)(x))->len - GTHDRSIZE ) / sizeof(int4) )
6363

6464
#endif

contrib/tsearch/query.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -658,12 +658,12 @@ typedef struct
658658
} INFIX;
659659

660660
#define RESIZEBUF(inf,addsize) \
661-
while( ( inf->cur - inf->buf ) + addsize + 1 >= inf->buflen ) \
661+
while( ( (inf)->cur - (inf)->buf ) + (addsize) + 1 >= (inf)->buflen ) \
662662
{ \
663-
int4 len = inf->cur - inf->buf; \
664-
inf->buflen *= 2; \
665-
inf->buf = (char*) repalloc( (void*)inf->buf, inf->buflen ); \
666-
inf->cur = inf->buf + len; \
663+
int4 len = (inf)->cur - (inf)->buf; \
664+
(inf)->buflen *= 2; \
665+
(inf)->buf = (char*) repalloc( (void*)(inf)->buf, (inf)->buflen ); \
666+
(inf)->cur = (inf)->buf + len; \
667667
}
668668

669669
/*

contrib/tsearch/query.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ typedef struct
3131
} QUERYTYPE;
3232

3333
#define HDRSIZEQT ( 2*sizeof(int4) )
34-
#define COMPUTESIZE(size,lenofoperand) ( HDRSIZEQT + size * sizeof(ITEM) + lenofoperand )
34+
#define COMPUTESIZE(size, lenofoperand) ( HDRSIZEQT + (size) * sizeof(ITEM) + (lenofoperand) )
3535
#define GETQUERY(x) (ITEM*)( (char*)(x)+HDRSIZEQT )
36-
#define GETOPERAND(x) ( (char*)GETQUERY(x) + ((QUERYTYPE*)x)->size * sizeof(ITEM) )
36+
#define GETOPERAND(x) ( (char*)GETQUERY(x) + ((QUERYTYPE*)(x))->size * sizeof(ITEM) )
3737

3838
#define ISOPERATOR(x) ( (x)=='!' || (x)=='&' || (x)=='|' || (x)=='(' || (x)==')' )
3939

contrib/tsearch2/crc32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Oroginal code by Spencer Garrett <srg@quick.com>
1414
*/
1515

16-
#define _CRC32_(crc, ch) (crc = (crc >> 8) ^ crc32tab[(crc ^ (ch)) & 0xff])
16+
#define _CRC32_(crc, ch) ((crc) = ((crc) >> 8) ^ crc32tab[((crc) ^ (ch)) & 0xff])
1717

1818
/* generated using the AUTODIN II polynomial
1919
* x^32 + x^26 + x^23 + x^22 + x^16 +

0 commit comments

Comments
 (0)