diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-06-21 15:18:54 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-06-21 15:19:25 -0400 |
commit | c7b8998ebbf310a156aa38022555a24d98fdbfb4 (patch) | |
tree | e85979fb1213a731b7b557f8a830df541f26b135 /src/port/crypt.c | |
parent | f669c09989bda894d6ba01634ccb229f0687c08a (diff) |
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
Diffstat (limited to 'src/port/crypt.c')
-rw-r--r-- | src/port/crypt.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/port/crypt.c b/src/port/crypt.c index 9fc7abe10a4..786161ff351 100644 --- a/src/port/crypt.c +++ b/src/port/crypt.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)crypt.c 8.1.1.1 (Berkeley) 8/18/93"; #else __RCSID("$NetBSD: crypt.c,v 1.18 2001/03/01 14:37:35 wiz Exp $"); #endif -#endif /* not lint */ +#endif /* not lint */ #include "c.h" @@ -287,7 +287,7 @@ typedef union { C_block tblk; permute(cpp,&tblk,p,8); LOAD (d,d0,d1,tblk); } #define PERM3264(d,d0,d1,cpp,p) \ { C_block tblk; permute(cpp,&tblk,p,4); LOAD (d,d0,d1,tblk); } -#endif /* LARGEDATA */ +#endif /* LARGEDATA */ STATIC init_des(void); STATIC init_perm(C_block[64 / CHUNKBITS][1 << CHUNKBITS], unsigned char[64], int, int); @@ -326,12 +326,12 @@ int chars_in; } while (--chars_in > 0); STORE(D, D0, D1, *out); } -#endif /* LARGEDATA */ +#endif /* LARGEDATA */ /* ===== (mostly) Standard DES Tables ==================== */ -static const unsigned char IP[] = { /* initial permutation */ +static const unsigned char IP[] = { /* initial permutation */ 58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, @@ -344,7 +344,7 @@ static const unsigned char IP[] = { /* initial permutation */ /* The final permutation is the inverse of IP - no table is necessary */ -static const unsigned char ExpandTr[] = { /* expansion operation */ +static const unsigned char ExpandTr[] = { /* expansion operation */ 32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, @@ -367,7 +367,7 @@ static const unsigned char PC1[] = { /* permuted choice table 1 */ 21, 13, 5, 28, 20, 12, 4, }; -static const unsigned char Rotates[] = { /* PC1 rotation schedule */ +static const unsigned char Rotates[] = { /* PC1 rotation schedule */ 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, }; @@ -457,7 +457,7 @@ static const unsigned char itoa64[] = /* 0..63 => ascii-64 */ /* ===== Tables that are initialized at run time ==================== */ -static unsigned char a64toi[128]; /* ascii-64 => 0..63 */ +static unsigned char a64toi[128]; /* ascii-64 => 0..63 */ /* Initial key schedule permutation */ static C_block PC1ROT[64 / CHUNKBITS][1 << CHUNKBITS]; @@ -482,7 +482,7 @@ static C_block constdatablock; /* encryption constant */ static char cryptresult[1 + 4 + 4 + 11 + 1]; /* encrypted result */ extern char *__md5crypt(const char *, const char *); /* XXX */ -extern char *__bcrypt(const char *, const char *); /* XXX */ +extern char *__bcrypt(const char *, const char *); /* XXX */ /* @@ -524,7 +524,7 @@ const char *setting; key++; keyblock.b[i] = t; } - if (des_setkey((char *) keyblock.b)) /* also initializes "a64toi" */ + if (des_setkey((char *) keyblock.b)) /* also initializes "a64toi" */ return (NULL); encp = &cryptresult[0]; @@ -715,7 +715,7 @@ int num_iter; R1 = (R1 >> 1) & 0x55555555L; L1 = R0 | R1; /* L1 is the odd-numbered input bits */ STORE(L, L0, L1, B); - PERM3264(L, L0, L1, B.b, (C_block *) IE3264); /* even bits */ + PERM3264(L, L0, L1, B.b, (C_block *) IE3264); /* even bits */ PERM3264(R, R0, R1, B.b + 4, (C_block *) IE3264); /* odd bits */ if (num_iter >= 0) |