1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Add do { ... } while (0) to more bad macros.

This commit is contained in:
Bruce Momjian
2001-10-25 01:29:37 +00:00
parent b4a57b0648
commit fde8edaf53
13 changed files with 89 additions and 42 deletions

View File

@ -1,4 +1,4 @@
/* $Id: sha1.c,v 1.6 2001/08/21 00:42:41 momjian Exp $ */
/* $Id: sha1.c,v 1.7 2001/10/25 01:29:37 momjian Exp $ */
/* $KAME: sha1.c,v 1.3 2000/02/22 14:01:18 itojun Exp $ */
/*
@ -65,22 +65,24 @@ static uint32 _K[] = {0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6};
#define BCOUNT (ctxt->c.b64[0] / 8)
#define W(n) (ctxt->m.b32[(n)])
#define PUTBYTE(x) { \
#define PUTBYTE(x) \
do { \
ctxt->m.b8[(COUNT % 64)] = (x); \
COUNT++; \
COUNT %= 64; \
ctxt->c.b64[0] += 8; \
if (COUNT % 64 == 0) \
sha1_step(ctxt); \
}
} while (0)
#define PUTPAD(x) { \
#define PUTPAD(x) \
do { \
ctxt->m.b8[(COUNT % 64)] = (x); \
COUNT++; \
COUNT %= 64; \
if (COUNT % 64 == 0) \
sha1_step(ctxt); \
}
} while (0)
static void sha1_step(struct sha1_ctxt *);