diff options
author | Tom Lane | 2020-05-16 15:54:51 +0000 |
---|---|---|
committer | Tom Lane | 2020-05-16 15:54:51 +0000 |
commit | fa27dd40d5c5f56a1ee837a75c97549e992e32a4 (patch) | |
tree | 029cb03671144ee7b0c48efe8469990003e3bc86 /src/timezone/localtime.c | |
parent | e02ad575d8ab6b44500d2a3fd8c3212345e3aa2b (diff) |
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
Diffstat (limited to 'src/timezone/localtime.c')
-rw-r--r-- | src/timezone/localtime.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/timezone/localtime.c b/src/timezone/localtime.c index 333f27300aa..787f0b69d63 100644 --- a/src/timezone/localtime.c +++ b/src/timezone/localtime.c @@ -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; |