]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: define min/max once and use them everywhere
authorDave Chinner <dchinner@redhat.com>
Wed, 4 Sep 2013 22:05:16 +0000 (22:05 +0000)
committerRich Johnston <rjohnston@sgi.com>
Mon, 16 Sep 2013 20:14:41 +0000 (15:14 -0500)
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Review-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
include/libxfs.h
include/platform_defs.h.in
io/init.h
libxfs/rdwr.c

index bd74ca55a95151bab60b8f959b5255efa8b61c3c..e776211e363a5e5ca8989b6ce7050f2c7536c988 100644 (file)
@@ -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().
index 3c0106e0d8efc95441d4312d46f569aa3c78c465..ac260bcdd319cfe3eefd66b0ae424d9bc9d69086 100644 (file)
@@ -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__ */
index 1dac211d267c67a324bdab48af8ab726cd3e1049..d773b1bcf0b936afab186724bfbd3ee09a5d694f 100644 (file)
--- 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);
index c679f816e30d791ccff394559cb6cd84a20ac895..93beb23f9b3c12a879beb038379dbb3fe9ae479b 100644 (file)
@@ -22,7 +22,6 @@
 #include "init.h"
 
 #define BDSTRAT_SIZE   (256 * 1024)
-#define min(x, y)      ((x) < (y) ? (x) : (y))
 
 #define IO_BCOMPARE_CHECK