Skip to content

Commit fe4f36b

Browse files
committed
Fix compiler warning
Introduced in 0aa8f76. 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
1 parent f560209 commit fe4f36b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/utils/adt/dbsize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ numeric_shift_right(Numeric n, unsigned count)
627627
Datum divisor_numeric;
628628
Datum result;
629629

630-
divisor_numeric = NumericGetDatum(int64_to_numeric(1 << count));
630+
divisor_numeric = NumericGetDatum(int64_to_numeric(((int64) 1) << count));
631631
result = DirectFunctionCall2(numeric_div_trunc, d, divisor_numeric);
632632
return DatumGetNumeric(result);
633633
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy