summaryrefslogtreecommitdiff
path: root/gl
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-10-31 22:30:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2021-10-31 22:36:46 -0700
commitea024067488e4ed7eb0038af8059b2d7ab16f1ff (patch)
treea313d9a069f9f3ed2c47912facfbfe17d22e8957 /gl
parent9f8a38414b12f4a2716763432271ec9c3b201604 (diff)
downloadcoreutils-ea024067488e4ed7eb0038af8059b2d7ab16f1ff.tar.gz
maint: use minmax.h instead of rolling our own
* gl/lib/mbsalign.c, gl/lib/randread.c, src/system.h (MAX, MIN): Remove; include minmax.h instead. * gl/modules/mbsalign, gl/modules/randread (Depends-on): Add minmax. * src/factor.c (MIN): Remove.
Diffstat (limited to 'gl')
-rw-r--r--gl/lib/mbsalign.c6
-rw-r--r--gl/lib/randread.c5
-rw-r--r--gl/modules/mbsalign1
-rw-r--r--gl/modules/randread1
4 files changed, 5 insertions, 8 deletions
diff --git a/gl/lib/mbsalign.c b/gl/lib/mbsalign.c
index 74e28ca1b..0ef9f8d12 100644
--- a/gl/lib/mbsalign.c
+++ b/gl/lib/mbsalign.c
@@ -19,6 +19,8 @@
#include <config.h>
#include "mbsalign.h"
+#include "minmax.h"
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -28,10 +30,6 @@
#include <wchar.h>
#include <wctype.h>
-#ifndef MIN
-# define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
/* Replace non printable chars.
Note \t and \n etc. are non printable.
Return 1 if replacement made, 0 otherwise. */
diff --git a/gl/lib/randread.c b/gl/lib/randread.c
index d8c5cbaf5..6949783e1 100644
--- a/gl/lib/randread.c
+++ b/gl/lib/randread.c
@@ -40,15 +40,12 @@
#include "gettext.h"
#define _(msgid) gettext (msgid)
+#include "minmax.h"
#include "rand-isaac.h"
#include "stdio-safer.h"
#include "unlocked-io.h"
#include "xalloc.h"
-#ifndef MIN
-# define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
#if _STRING_ARCH_unaligned || _STRING_INLINE_unaligned
# define ALIGNED_POINTER(ptr, type) true
#else
diff --git a/gl/modules/mbsalign b/gl/modules/mbsalign
index 7f9c9741b..c27c21225 100644
--- a/gl/modules/mbsalign
+++ b/gl/modules/mbsalign
@@ -6,6 +6,7 @@ lib/mbsalign.c
lib/mbsalign.h
Depends-on:
+minmax
wchar
wctype
wcwidth
diff --git a/gl/modules/randread b/gl/modules/randread
index 5c6824038..cba84db35 100644
--- a/gl/modules/randread
+++ b/gl/modules/randread
@@ -14,6 +14,7 @@ inline
fopen-safer
getrandom
quote
+minmax
stdalign
stdbool
stdint