1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Add parentheses to macros when args are used in computations. Without

them, the executation behavior could be unexpected.
This commit is contained in:
Bruce Momjian
2005-05-25 21:40:43 +00:00
parent 13b729ca52
commit b492c3accc
36 changed files with 211 additions and 211 deletions

View File

@ -3,7 +3,7 @@
* Add do ... while() macro fix
* Remove __inline, _DIAGASSERTs, __P
*
* $PostgreSQL: pgsql/src/port/qsort.c,v 1.5 2004/10/05 00:12:49 neilc Exp $
* $PostgreSQL: pgsql/src/port/qsort.c,v 1.6 2005/05/25 21:40:43 momjian Exp $
*/
/* $NetBSD: qsort.c,v 1.13 2003/08/07 16:43:42 agc Exp $ */
@ -63,8 +63,8 @@ do { \
} while (--i > 0); \
} while (0)
#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
#define SWAPINIT(a, es) swaptype = ((char *)(a) - (char *)0) % sizeof(long) || \
(es) % sizeof(long) ? 2 : (es) == sizeof(long)? 0 : 1;
static void
swapfunc(a, b, n, swaptype)