1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

Standardize on using the Min, Max, and Abs macros that are in our c.h file,

getting rid of numerous ad-hoc versions that have popped up in various
places.  Shortens code and avoids conflict with Windows min() and max()
macros.
This commit is contained in:
Tom Lane
2004-10-21 19:28:36 +00:00
parent a171fc1a4f
commit 380bd04c16
22 changed files with 34 additions and 77 deletions

View File

@ -20,8 +20,6 @@
/* define this if you want to see iso-8859 characters */
#define ISO8859
#undef MIN
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define VALUE(char) ((char) - '0')
#define DIGIT(val) ((val) + '0')
#define ISOCTAL(c) (((c) >= '0') && ((c) <= '7'))
@ -229,7 +227,7 @@ string_input(unsigned char *str, int size, int hdrsize, int *rtn_size)
else
/* result has variable length with maximum size */
if (size < 0)
size = MIN(len, -size) + 1;
size = Min(len, -size) + 1;
result = (char *) palloc(hdrsize + size);
memset(result, 0, hdrsize + size);