From: Dave Chinner Date: Wed, 4 Sep 2013 22:05:16 +0000 (+0000) Subject: xfsprogs: define min/max once and use them everywhere X-Git-Tag: v3.2.0-alpha1~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a7c6ada99b3739193e6269f6a34c9f88d660000;p=thirdparty%2Fxfsprogs-dev.git xfsprogs: define min/max once and use them everywhere Signed-off-by: Dave Chinner Review-by: Mark Tinguely Signed-off-by: Rich Johnston --- diff --git a/include/libxfs.h b/include/libxfs.h index bd74ca55a..e776211e3 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -72,7 +72,6 @@ #define __round_mask(x, y) ((__typeof__(x))((y)-1)) #define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) #define round_down(x, y) ((x) & ~__round_mask(x, y)) -#define min(a,b) ((a) < (b) ? (a) : (b)) /* * Argument structure for libxfs_init(). diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in index 3c0106e0d..ac260bcdd 100644 --- a/include/platform_defs.h.in +++ b/include/platform_defs.h.in @@ -173,4 +173,9 @@ typedef unsigned short umode_t; #define __arch_pack #endif +#ifndef min +#define min(a,b) (((a)<(b))?(a):(b)) +#define max(a,b) (((a)>(b))?(a):(b)) +#endif + #endif /* __XFS_PLATFORM_DEFS_H__ */ diff --git a/io/init.h b/io/init.h index 1dac211d2..d773b1bcf 100644 --- a/io/init.h +++ b/io/init.h @@ -26,7 +26,4 @@ extern int expert; extern size_t pagesize; extern struct timeval stopwatch; -#define min(a,b) (((a)<(b))?(a):(b)) -#define max(a,b) (((a)>(b))?(a):(b)) - extern void init_cvtnum(size_t *blocksize, size_t *sectsize); diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index c679f816e..93beb23f9 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -22,7 +22,6 @@ #include "init.h" #define BDSTRAT_SIZE (256 * 1024) -#define min(x, y) ((x) < (y) ? (x) : (y)) #define IO_BCOMPARE_CHECK