summaryrefslogtreecommitdiff
path: root/contrib/ltree
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ltree')
-rw-r--r--contrib/ltree/crc32.c2
-rw-r--r--contrib/ltree/ltree.h2
-rw-r--r--contrib/ltree/ltxtquery_io.c10
3 files changed, 7 insertions, 7 deletions
diff --git a/contrib/ltree/crc32.c b/contrib/ltree/crc32.c
index 8a4f27b306..c82b3a644c 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 +
diff --git a/contrib/ltree/ltree.h b/contrib/ltree/ltree.h
index c55c757016..2057751cfe 100644
--- a/contrib/ltree/ltree.h
+++ b/contrib/ltree/ltree.h
@@ -109,7 +109,7 @@ typedef struct
} ltxtquery;
#define HDRSIZEQT MAXALIGN( 2*sizeof(int4) )
-#define COMPUTESIZE(size,lenofoperand) ( HDRSIZEQT + size * sizeof(ITEM) + lenofoperand )
+#define COMPUTESIZE(size,lenofoperand) ( HDRSIZEQT + (size) * sizeof(ITEM) + (lenofoperand) )
#define GETQUERY(x) (ITEM*)( (char*)(x)+HDRSIZEQT )
#define GETOPERAND(x) ( (char*)GETQUERY(x) + ((ltxtquery*)x)->size * sizeof(ITEM) )
diff --git a/contrib/ltree/ltxtquery_io.c b/contrib/ltree/ltxtquery_io.c
index f63c9ee6fb..0751a6b718 100644
--- a/contrib/ltree/ltxtquery_io.c
+++ b/contrib/ltree/ltxtquery_io.c
@@ -386,12 +386,12 @@ typedef struct
} INFIX;
#define RESIZEBUF(inf,addsize) \
-while( ( inf->cur - inf->buf ) + addsize + 1 >= inf->buflen ) \
+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 ); \
- inf->cur = inf->buf + len; \
+ int4 len = (inf)->cur - (inf)->buf; \
+ (inf)->buflen *= 2; \
+ (inf)->buf = (char*) repalloc( (void*)(inf)->buf, (inf)->buflen ); \
+ (inf)->cur = (inf)->buf + len; \
}
/*