1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Modify LOOPBYTE/LOOPBIT macros to be more logical; rather than have the

for() body passed as a parameter, make the macros act as simple headers
to code blocks.

This allows pgindent to be run on these files.
This commit is contained in:
Bruce Momjian
2007-11-16 00:13:02 +00:00
parent 7d4c99b414
commit 224f91f66d
9 changed files with 191 additions and 204 deletions

View File

@ -1,4 +1,4 @@
/* $PostgreSQL: pgsql/contrib/ltree/ltree.h,v 1.18 2007/02/28 22:44:38 tgl Exp $ */
/* $PostgreSQL: pgsql/contrib/ltree/ltree.h,v 1.19 2007/11/16 00:13:02 momjian Exp $ */
#ifndef __LTREE_H__
#define __LTREE_H__
@ -178,10 +178,8 @@ ltree *lca_inner(ltree ** a, int len);
typedef unsigned char BITVEC[SIGLEN];
typedef unsigned char *BITVECP;
#define LOOPBYTE(a) \
for(i=0;i<SIGLEN;i++) {\
a;\
}
#define LOOPBYTE \
for(i=0;i<SIGLEN;i++)
#define GETBYTE(x,i) ( *( (BITVECP)(x) + (int)( (i) / BITBYTE ) ) )
#define GETBITBYTE(x,i) ( ((unsigned char)(x)) >> i & 0x01 )
@ -235,10 +233,8 @@ typedef struct
#define ASIGLENBIT (ASIGLEN*BITBYTE)
typedef unsigned char ABITVEC[ASIGLEN];
#define ALOOPBYTE(a) \
for(i=0;i<ASIGLEN;i++) {\
a;\
}
#define ALOOPBYTE \
for(i=0;i<ASIGLEN;i++)
#define AHASHVAL(val) (((unsigned int)(val)) % ASIGLENBIT)
#define AHASH(sign, val) SETBIT((sign), AHASHVAL(val))