Re: get rid of Abs()
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-10-04T13:29:36Z
Lists: pgsql-hackers
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes: > I was wondering why we have a definition of Abs() in c.h when there are > more standard functions such as abs() and fabs() in widespread use. I > think this one is left over from pre-ANSI-C days. The attached patches > replace all uses of Abs() with more standard functions. I'm not in favor of the llabs() changes. I think what we really want in those places, or at least most of them, is "abs() for int64". That could be had by #define'ing "iabs64" (or some name along that line) as labs or llabs depending on which type we are using for int64. Seems OK beyond that nitpick. regards, tom lane
Commits
-
Remove Abs()
- a699b7a7aa9f 16.0 landed
-
Use C library functions instead of Abs() for int64
- 357cfefb0911 16.0 landed
-
Use fabsf() instead of Abs() or fabs() where appropriate
- e4c61bedcb79 16.0 landed
-
Remove unnecessary uses of Abs()
- f14aad5169ba 16.0 landed