diff options
| author | Bruce Momjian <bruce@momjian.us> | 2001-10-25 01:29:37 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2001-10-25 01:29:37 +0000 |
| commit | fde8edaf53806777e606e04187d60d5b3f26d886 (patch) | |
| tree | a9d2702cbf8a0748931c81c27aa48dda4293c973 /contrib/pgcrypto/sha1.c | |
| parent | b4a57b06486df001e9b4e4350c493e2c15e76380 (diff) | |
| download | postgresql-fde8edaf53806777e606e04187d60d5b3f26d886.tar.gz | |
Add do { ... } while (0) to more bad macros.
Diffstat (limited to 'contrib/pgcrypto/sha1.c')
| -rw-r--r-- | contrib/pgcrypto/sha1.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/pgcrypto/sha1.c b/contrib/pgcrypto/sha1.c index 98ad552182..20c6230540 100644 --- a/contrib/pgcrypto/sha1.c +++ b/contrib/pgcrypto/sha1.c @@ -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 *); |
