mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Run pgindent with new pg_bsd_indent version 2.1.1.
Thomas Munro fixed a longstanding annoyance in pg_bsd_indent, that it would misformat lines containing IsA() macros on the assumption that the IsA() call should be treated like a cast. This improves some other cases involving field/variable names that match typedefs, too. The only places that get worse are a couple of uses of the OpenSSL macro STACK_OF(); we'll gladly take that trade-off. Discussion: https://postgr.es/m/20200114221814.GA19630@alvherre.pgsql
This commit is contained in:
@ -138,7 +138,7 @@ detzcode(const char *const codep)
|
||||
* Do two's-complement negation even on non-two's-complement machines.
|
||||
* If the result would be minval - 1, return minval.
|
||||
*/
|
||||
result -= !TWOS_COMPLEMENT(int32) &&result != 0;
|
||||
result -= !TWOS_COMPLEMENT(int32) && result != 0;
|
||||
result += minval;
|
||||
}
|
||||
return result;
|
||||
@ -152,7 +152,7 @@ detzcode64(const char *const codep)
|
||||
int64 one = 1;
|
||||
int64 halfmaxval = one << (64 - 2);
|
||||
int64 maxval = halfmaxval - 1 + halfmaxval;
|
||||
int64 minval = -TWOS_COMPLEMENT(int64) -maxval;
|
||||
int64 minval = -TWOS_COMPLEMENT(int64) - maxval;
|
||||
|
||||
result = codep[0] & 0x7f;
|
||||
for (i = 1; i < 8; ++i)
|
||||
@ -164,7 +164,7 @@ detzcode64(const char *const codep)
|
||||
* Do two's-complement negation even on non-two's-complement machines.
|
||||
* If the result would be minval - 1, return minval.
|
||||
*/
|
||||
result -= !TWOS_COMPLEMENT(int64) &&result != 0;
|
||||
result -= !TWOS_COMPLEMENT(int64) && result != 0;
|
||||
result += minval;
|
||||
}
|
||||
return result;
|
||||
@ -173,7 +173,7 @@ detzcode64(const char *const codep)
|
||||
static bool
|
||||
differ_by_repeat(const pg_time_t t1, const pg_time_t t0)
|
||||
{
|
||||
if (TYPE_BIT(pg_time_t) -TYPE_SIGNED(pg_time_t) <SECSPERREPEAT_BITS)
|
||||
if (TYPE_BIT(pg_time_t) - TYPE_SIGNED(pg_time_t) < SECSPERREPEAT_BITS)
|
||||
return 0;
|
||||
return t1 - t0 == SECSPERREPEAT;
|
||||
}
|
||||
@ -1480,7 +1480,7 @@ timesub(const pg_time_t *timep, int32 offset,
|
||||
int leapdays;
|
||||
|
||||
tdelta = tdays / DAYSPERLYEAR;
|
||||
if (!((!TYPE_SIGNED(pg_time_t) ||INT_MIN <= tdelta)
|
||||
if (!((!TYPE_SIGNED(pg_time_t) || INT_MIN <= tdelta)
|
||||
&& tdelta <= INT_MAX))
|
||||
goto out_of_range;
|
||||
idelta = tdelta;
|
||||
|
@ -505,7 +505,7 @@ _fmt(const char *format, const struct pg_tm *t, char *pt,
|
||||
static char *
|
||||
_conv(int n, const char *format, char *pt, const char *ptlim)
|
||||
{
|
||||
char buf[INT_STRLEN_MAXIMUM(int) +1];
|
||||
char buf[INT_STRLEN_MAXIMUM(int) + 1];
|
||||
|
||||
sprintf(buf, format, n);
|
||||
return _add(buf, pt, ptlim);
|
||||
|
@ -652,7 +652,7 @@ main(int argc, char **argv)
|
||||
umask(umask(S_IWGRP | S_IWOTH) | (S_IWGRP | S_IWOTH));
|
||||
#endif
|
||||
progname = argv[0];
|
||||
if (TYPE_BIT(zic_t) <64)
|
||||
if (TYPE_BIT(zic_t) < 64)
|
||||
{
|
||||
fprintf(stderr, "%s: %s\n", progname,
|
||||
_("wild compilation-time specification of zic_t"));
|
||||
@ -3444,7 +3444,7 @@ yearistype(zic_t year, const char *type)
|
||||
if (type == NULL || *type == '\0')
|
||||
return true;
|
||||
buf = emalloc(1 + 4 * strlen(yitcommand) + 2
|
||||
+ INT_STRLEN_MAXIMUM(zic_t) +2 + 4 * strlen(type) + 2);
|
||||
+ INT_STRLEN_MAXIMUM(zic_t) + 2 + 4 * strlen(type) + 2);
|
||||
b = shellquote(buf, yitcommand);
|
||||
*b++ = ' ';
|
||||
b += sprintf(b, INT64_FORMAT, year);
|
||||
|
Reference in New Issue
Block a user