summaryrefslogtreecommitdiff
path: root/contrib/ltree/crc32.c
diff options
context:
space:
mode:
authorBruce Momjian2005-05-25 21:40:43 +0000
committerBruce Momjian2005-05-25 21:40:43 +0000
commitb492c3acccb3f8c97559ddfc2a25f25953a026d2 (patch)
treea9c42aa2bd86a88a849ffaa005766ffe3dee762a /contrib/ltree/crc32.c
parent13b729ca5267b58005f1ca9c873a86c2b0db3591 (diff)
Add parentheses to macros when args are used in computations. Without
them, the executation behavior could be unexpected.
Diffstat (limited to 'contrib/ltree/crc32.c')
-rw-r--r--contrib/ltree/crc32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/ltree/crc32.c b/contrib/ltree/crc32.c
index 8a4f27b3066..c82b3a644c8 100644
--- a/contrib/ltree/crc32.c
+++ b/contrib/ltree/crc32.c
@@ -20,7 +20,7 @@
* Oroginal code by Spencer Garrett <srg@quick.com>
*/
-#define _CRC32_(crc, ch) (crc = (crc >> 8) ^ crc32tab[(crc ^ (ch)) & 0xff])
+#define _CRC32_(crc, ch) ((crc) = ((crc) >> 8) ^ crc32tab[((crc) ^ (ch)) & 0xff])
/* generated using the AUTODIN II polynomial
* x^32 + x^26 + x^23 + x^22 + x^16 +