mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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 e3860ffa4d
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
This commit is contained in:
@ -734,7 +734,7 @@ px_crypt_des(const char *key, const char *setting)
|
||||
p = output + strlen(output);
|
||||
}
|
||||
else
|
||||
#endif /* !DISABLE_XDES */
|
||||
#endif /* !DISABLE_XDES */
|
||||
{
|
||||
/*
|
||||
* "old"-style: setting - 2 bytes of salt key - only up to the first 8
|
||||
|
@ -1975,7 +1975,7 @@ mp_int_string_len(mp_int z, mp_size radix)
|
||||
if (radix < MP_MIN_RADIX || radix > MP_MAX_RADIX)
|
||||
return MP_RANGE;
|
||||
|
||||
len = s_outlen(z, radix) + 1; /* for terminator */
|
||||
len = s_outlen(z, radix) + 1; /* for terminator */
|
||||
|
||||
/* Allow for sign marker on negatives */
|
||||
if (MP_SIGN(z) == MP_NEG)
|
||||
@ -2512,7 +2512,7 @@ s_usub(mp_digit *da, mp_digit *db, mp_digit *dc,
|
||||
/* Subtract corresponding digits and propagate borrow */
|
||||
for (pos = 0; pos < size_b; ++pos, ++da, ++db, ++dc)
|
||||
{
|
||||
w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */
|
||||
w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */
|
||||
(mp_word) *da) - w - (mp_word) *db;
|
||||
|
||||
*dc = LOWER_HALF(w);
|
||||
@ -2522,7 +2522,7 @@ s_usub(mp_digit *da, mp_digit *db, mp_digit *dc,
|
||||
/* Finish the subtraction for remaining upper digits of da */
|
||||
for ( /* */ ; pos < size_a; ++pos, ++da, ++dc)
|
||||
{
|
||||
w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */
|
||||
w = ((mp_word) MP_DIGIT_MAX + 1 + /* MP_RADIX */
|
||||
(mp_word) *da) - w;
|
||||
|
||||
*dc = LOWER_HALF(w);
|
||||
@ -2594,10 +2594,10 @@ s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc,
|
||||
* t1 and t2 are initially used as temporaries to compute the inner
|
||||
* product (a1 + a0)(b1 + b0) = a1b1 + a1b0 + a0b1 + a0b0
|
||||
*/
|
||||
carry = s_uadd(da, a_top, t1, bot_size, at_size); /* t1 = a1 + a0 */
|
||||
carry = s_uadd(da, a_top, t1, bot_size, at_size); /* t1 = a1 + a0 */
|
||||
t1[bot_size] = carry;
|
||||
|
||||
carry = s_uadd(db, b_top, t2, bot_size, bt_size); /* t2 = b1 + b0 */
|
||||
carry = s_uadd(db, b_top, t2, bot_size, bt_size); /* t2 = b1 + b0 */
|
||||
t2[bot_size] = carry;
|
||||
|
||||
(void) s_kmul(t1, t2, t3, bot_size + 1, bot_size + 1); /* t3 = t1 * t2 */
|
||||
@ -2609,7 +2609,7 @@ s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc,
|
||||
ZERO(t1, buf_size);
|
||||
ZERO(t2, buf_size);
|
||||
(void) s_kmul(da, db, t1, bot_size, bot_size); /* t1 = a0 * b0 */
|
||||
(void) s_kmul(a_top, b_top, t2, at_size, bt_size); /* t2 = a1 * b1 */
|
||||
(void) s_kmul(a_top, b_top, t2, at_size, bt_size); /* t2 = a1 * b1 */
|
||||
|
||||
/* Subtract out t1 and t2 to get the inner product */
|
||||
s_usub(t3, t1, t3, buf_size + 2, buf_size);
|
||||
@ -2692,10 +2692,10 @@ s_ksqr(mp_digit *da, mp_digit *dc, mp_size size_a)
|
||||
t3 = t2 + buf_size;
|
||||
ZERO(t1, 4 * buf_size);
|
||||
|
||||
(void) s_ksqr(da, t1, bot_size); /* t1 = a0 ^ 2 */
|
||||
(void) s_ksqr(a_top, t2, at_size); /* t2 = a1 ^ 2 */
|
||||
(void) s_ksqr(da, t1, bot_size); /* t1 = a0 ^ 2 */
|
||||
(void) s_ksqr(a_top, t2, at_size); /* t2 = a1 ^ 2 */
|
||||
|
||||
(void) s_kmul(da, a_top, t3, bot_size, at_size); /* t3 = a0 * a1 */
|
||||
(void) s_kmul(da, a_top, t3, bot_size, at_size); /* t3 = a0 * a1 */
|
||||
|
||||
/* Quick multiply t3 by 2, shifting left (can't overflow) */
|
||||
{
|
||||
@ -2782,7 +2782,7 @@ s_usqr(mp_digit *da, mp_digit *dc, mp_size size_a)
|
||||
w = UPPER_HALF(w);
|
||||
if (ov)
|
||||
{
|
||||
w += MP_DIGIT_MAX; /* MP_RADIX */
|
||||
w += MP_DIGIT_MAX; /* MP_RADIX */
|
||||
++w;
|
||||
}
|
||||
}
|
||||
|
@ -106,9 +106,9 @@ void mp_int_free(mp_int z);
|
||||
|
||||
mp_result mp_int_copy(mp_int a, mp_int c); /* c = a */
|
||||
void mp_int_swap(mp_int a, mp_int c); /* swap a, c */
|
||||
void mp_int_zero(mp_int z); /* z = 0 */
|
||||
mp_result mp_int_abs(mp_int a, mp_int c); /* c = |a| */
|
||||
mp_result mp_int_neg(mp_int a, mp_int c); /* c = -a */
|
||||
void mp_int_zero(mp_int z); /* z = 0 */
|
||||
mp_result mp_int_abs(mp_int a, mp_int c); /* c = |a| */
|
||||
mp_result mp_int_neg(mp_int a, mp_int c); /* c = -a */
|
||||
mp_result mp_int_add(mp_int a, mp_int b, mp_int c); /* c = a + b */
|
||||
mp_result mp_int_add_value(mp_int a, int value, mp_int c);
|
||||
mp_result mp_int_sub(mp_int a, mp_int b, mp_int c); /* c = a - b */
|
||||
@ -116,23 +116,23 @@ mp_result mp_int_sub_value(mp_int a, int value, mp_int c);
|
||||
mp_result mp_int_mul(mp_int a, mp_int b, mp_int c); /* c = a * b */
|
||||
mp_result mp_int_mul_value(mp_int a, int value, mp_int c);
|
||||
mp_result mp_int_mul_pow2(mp_int a, int p2, mp_int c);
|
||||
mp_result mp_int_sqr(mp_int a, mp_int c); /* c = a * a */
|
||||
mp_result mp_int_sqr(mp_int a, mp_int c); /* c = a * a */
|
||||
|
||||
mp_result mp_int_div(mp_int a, mp_int b, /* q = a / b */
|
||||
mp_result mp_int_div(mp_int a, mp_int b, /* q = a / b */
|
||||
mp_int q, mp_int r); /* r = a % b */
|
||||
mp_result mp_int_div_value(mp_int a, int value, /* q = a / value */
|
||||
mp_int q, int *r); /* r = a % value */
|
||||
mp_result mp_int_div_value(mp_int a, int value, /* q = a / value */
|
||||
mp_int q, int *r); /* r = a % value */
|
||||
mp_result mp_int_div_pow2(mp_int a, int p2, /* q = a / 2^p2 */
|
||||
mp_int q, mp_int r); /* r = q % 2^p2 */
|
||||
mp_result mp_int_mod(mp_int a, mp_int m, mp_int c); /* c = a % m */
|
||||
|
||||
#define mp_int_mod_value(A, V, R) mp_int_div_value((A), (V), 0, (R))
|
||||
mp_result mp_int_expt(mp_int a, int b, mp_int c); /* c = a^b */
|
||||
mp_result mp_int_expt(mp_int a, int b, mp_int c); /* c = a^b */
|
||||
mp_result mp_int_expt_value(int a, int b, mp_int c); /* c = a^b */
|
||||
|
||||
int mp_int_compare(mp_int a, mp_int b); /* a <=> b */
|
||||
int mp_int_compare_unsigned(mp_int a, mp_int b); /* |a| <=> |b| */
|
||||
int mp_int_compare_zero(mp_int z); /* a <=> 0 */
|
||||
int mp_int_compare_unsigned(mp_int a, mp_int b); /* |a| <=> |b| */
|
||||
int mp_int_compare_zero(mp_int z); /* a <=> 0 */
|
||||
int mp_int_compare_value(mp_int z, int value); /* a <=> v */
|
||||
|
||||
/* Returns true if v|a, false otherwise (including errors) */
|
||||
@ -144,15 +144,15 @@ int mp_int_is_pow2(mp_int z);
|
||||
mp_result mp_int_exptmod(mp_int a, mp_int b, mp_int m,
|
||||
mp_int c); /* c = a^b (mod m) */
|
||||
mp_result mp_int_exptmod_evalue(mp_int a, int value,
|
||||
mp_int m, mp_int c); /* c = a^v (mod m) */
|
||||
mp_int m, mp_int c); /* c = a^v (mod m) */
|
||||
mp_result mp_int_exptmod_bvalue(int value, mp_int b,
|
||||
mp_int m, mp_int c); /* c = v^b (mod m) */
|
||||
mp_int m, mp_int c); /* c = v^b (mod m) */
|
||||
mp_result mp_int_exptmod_known(mp_int a, mp_int b,
|
||||
mp_int m, mp_int mu,
|
||||
mp_int c); /* c = a^b (mod m) */
|
||||
mp_result mp_int_redux_const(mp_int m, mp_int c);
|
||||
|
||||
mp_result mp_int_invmod(mp_int a, mp_int m, mp_int c); /* c = 1/a (mod m) */
|
||||
mp_result mp_int_invmod(mp_int a, mp_int m, mp_int c); /* c = 1/a (mod m) */
|
||||
|
||||
mp_result mp_int_gcd(mp_int a, mp_int b, mp_int c); /* c = gcd(a, b) */
|
||||
|
||||
@ -207,4 +207,4 @@ void s_print(char *tag, mp_int z);
|
||||
void s_print_buf(char *tag, mp_digit *buf, mp_size num);
|
||||
#endif
|
||||
|
||||
#endif /* end IMATH_H_ */
|
||||
#endif /* end IMATH_H_ */
|
||||
|
@ -42,11 +42,11 @@
|
||||
/*
|
||||
* System reseeds should be separated at least this much.
|
||||
*/
|
||||
#define SYSTEM_RESEED_MIN (20*60) /* 20 min */
|
||||
#define SYSTEM_RESEED_MIN (20*60) /* 20 min */
|
||||
/*
|
||||
* How often to roll dice.
|
||||
*/
|
||||
#define SYSTEM_RESEED_CHECK_TIME (10*60) /* 10 min */
|
||||
#define SYSTEM_RESEED_CHECK_TIME (10*60) /* 10 min */
|
||||
/*
|
||||
* The chance is x/256 that the reseed happens.
|
||||
*/
|
||||
|
@ -121,4 +121,4 @@ int pullf_create_mbuf_reader(PullFilter **pf_p, MBuf *mbuf);
|
||||
(dst) = __b; \
|
||||
} while (0)
|
||||
|
||||
#endif /* __PX_MBUF_H */
|
||||
#endif /* __PX_MBUF_H */
|
||||
|
@ -76,4 +76,4 @@ do { \
|
||||
md5_result((x), (y)); \
|
||||
} while (0)
|
||||
|
||||
#endif /* ! _NETINET6_MD5_H_ */
|
||||
#endif /* ! _NETINET6_MD5_H_ */
|
||||
|
@ -155,8 +155,8 @@ struct PGP_Context
|
||||
*/
|
||||
int mdc_checked;
|
||||
int corrupt_prefix; /* prefix failed RFC 4880 "quick check" */
|
||||
int unsupported_compr; /* has bzip2 compression */
|
||||
int unexpected_binary; /* binary data seen in text_mode */
|
||||
int unsupported_compr; /* has bzip2 compression */
|
||||
int unexpected_binary; /* binary data seen in text_mode */
|
||||
int in_mdc_pkt;
|
||||
int use_mdcbuf_filter;
|
||||
PX_MD *mdc_ctx;
|
||||
|
@ -79,4 +79,4 @@ char *px_crypt_des(const char *key, const char *setting);
|
||||
char *px_crypt_md5(const char *pw, const char *salt,
|
||||
char *dst, unsigned dstlen);
|
||||
|
||||
#endif /* _PX_CRYPT_H */
|
||||
#endif /* _PX_CRYPT_H */
|
||||
|
@ -154,7 +154,7 @@ struct px_hmac
|
||||
struct px_cipher
|
||||
{
|
||||
unsigned (*block_size) (PX_Cipher *c);
|
||||
unsigned (*key_size) (PX_Cipher *c); /* max key len */
|
||||
unsigned (*key_size) (PX_Cipher *c); /* max key len */
|
||||
unsigned (*iv_size) (PX_Cipher *c);
|
||||
|
||||
int (*init) (PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv);
|
||||
@ -239,4 +239,4 @@ void px_debug(const char *fmt,...) pg_attribute_printf(1, 2);
|
||||
(c)->decrypt(c, data, dlen, res, rlen)
|
||||
#define px_combo_free(c) (c)->free(c)
|
||||
|
||||
#endif /* __PX_H */
|
||||
#endif /* __PX_H */
|
||||
|
@ -97,7 +97,7 @@ static u4byte il_tab[4][256];
|
||||
#endif
|
||||
|
||||
static u4byte tab_gen = 0;
|
||||
#endif /* !PRE_CALC_TABLES */
|
||||
#endif /* !PRE_CALC_TABLES */
|
||||
|
||||
#define ff_mult(a,b) ((a) && (b) ? pow_tab[(log_tab[a] + log_tab[b]) % 255] : 0)
|
||||
|
||||
@ -250,7 +250,7 @@ gen_tabs(void)
|
||||
}
|
||||
|
||||
tab_gen = 1;
|
||||
#endif /* !PRE_CALC_TABLES */
|
||||
#endif /* !PRE_CALC_TABLES */
|
||||
}
|
||||
|
||||
|
||||
|
@ -56,4 +56,4 @@ void aes_ecb_decrypt(rijndael_ctx *ctx, uint8 *data, unsigned len);
|
||||
void aes_cbc_encrypt(rijndael_ctx *ctx, uint8 *iva, uint8 *data, unsigned len);
|
||||
void aes_cbc_decrypt(rijndael_ctx *ctx, uint8 *iva, uint8 *data, unsigned len);
|
||||
|
||||
#endif /* _RIJNDAEL_H_ */
|
||||
#endif /* _RIJNDAEL_H_ */
|
||||
|
@ -72,4 +72,4 @@ typedef struct sha1_ctxt SHA1_CTX;
|
||||
|
||||
#define SHA1_RESULTLEN (160/8)
|
||||
|
||||
#endif /* _NETINET6_SHA1_H_ */
|
||||
#endif /* _NETINET6_SHA1_H_ */
|
||||
|
Reference in New Issue
Block a user