aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/dbsize.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2020-09-15 15:07:57 +1200
committerDavid Rowley <drowley@postgresql.org>2020-09-15 15:07:57 +1200
commitfe4f36bcde182d57dee5dba898076aba5d826515 (patch)
treee18ca73ba92a727bb293729fd6e63ca3bf9f7954 /src/backend/utils/adt/dbsize.c
parentf560209c6e99e000f3f6c972f34f1d9dc3857f25 (diff)
downloadpostgresql-fe4f36bcde182d57dee5dba898076aba5d826515.tar.gz
postgresql-fe4f36bcde182d57dee5dba898076aba5d826515.zip
Fix compiler warning
Introduced in 0aa8f7640. MSVC warned about performing 32-bit bit shifting when it appeared like we might like a 64-bit result. We did, but it just so happened that none of the calls to this function could have caused the 32-bit shift to overflow. Here we just cast the constant to int64 to make the compiler happy. Discussion: https://postgr.es/m/CAApHDvofA_vsrpC13mq_hZyuye5B-ssKEaer04OouXYCO5-uXQ@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/dbsize.c')
-rw-r--r--src/backend/utils/adt/dbsize.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c
index 7def7392b95..3319e9761e4 100644
--- a/src/backend/utils/adt/dbsize.c
+++ b/src/backend/utils/adt/dbsize.c
@@ -627,7 +627,7 @@ numeric_shift_right(Numeric n, unsigned count)
Datum divisor_numeric;
Datum result;
- divisor_numeric = NumericGetDatum(int64_to_numeric(1 << count));
+ divisor_numeric = NumericGetDatum(int64_to_numeric(((int64) 1) << count));
result = DirectFunctionCall2(numeric_div_trunc, d, divisor_numeric);
return DatumGetNumeric(result);
}