From 357cfefb09115292cfb98d504199e6df8201c957 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 10 Oct 2022 08:51:07 +0200 Subject: Use C library functions instead of Abs() for int64 Instead of Abs() for int64, use the C standard functions labs() or llabs() as appropriate. Define a small wrapper around them that matches our definition of int64. (labs() is C90, llabs() is C99.) Reviewed-by: Zhang Mingli Reviewed-by: Tom Lane Discussion: https://www.postgresql.org/message-id/flat/4beb42b5-216b-bce8-d452-d924d5794c63%40enterprisedb.com --- src/backend/utils/adt/dbsize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/utils/adt/dbsize.c') diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c index 34efa121b40..0a9b93f2634 100644 --- a/src/backend/utils/adt/dbsize.c +++ b/src/backend/utils/adt/dbsize.c @@ -564,7 +564,7 @@ pg_size_pretty(PG_FUNCTION_ARGS) uint8 bits; /* use this unit if there are no more units or we're below the limit */ - if (unit[1].name == NULL || Abs(size) < unit->limit) + if (unit[1].name == NULL || i64abs(size) < unit->limit) { if (unit->round) size = half_rounded(size); -- cgit v1.2.3