[Libguestfs] [PATCH nbdkit 3/6] common/include/minmax.h: Remove MIN3/MAX3 macros.

Richard W.M. Jones rjones at redhat.com
Tue Jan 26 21:51:49 UTC 2021


These were added to support the checkwrite filter, but the original
change didn't work on platforms that lack __auto_type, resulting in an
additional hack.  However as part of changing checkwrite to use
nbdkit_extents_full these macros (and hack) are no longer needed, so
remove them.

Updates: commit acaa3db5b39759d9e7e65f4e5ef10a5383e50b29
Updates: commit 2d0954dd6431cfd8d82e873a5b99285b0fddbeb8
---
 common/include/minmax.h | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/common/include/minmax.h b/common/include/minmax.h
index aa95207e..d3e667ea 100644
--- a/common/include/minmax.h
+++ b/common/include/minmax.h
@@ -76,18 +76,4 @@
 
 #endif
 
-/* Helpful to have MIN3, MAX3 and maybe more in future. */
-#ifdef HAVE_AUTO_TYPE
-#define MIN3(x0, x1, x2) (MIN (MIN ((x0), (x1)), (x2)))
-#define MAX3(x0, x1, x2) (MAX (MAX ((x0), (x1)), (x2)))
-#else
-/* Unfortunately without __auto_type nesting the macros is not
- * possible so we must use this unclean macro instead.
- */
-#define MIN_UNCLEAN(x,y) ((x) < (y) ? (x) : (y))
-#define MAX_UNCLEAN(x,y) ((x) > (y) ? (x) : (y))
-#define MIN3(x0, x1, x2) (MIN_UNCLEAN (MIN_UNCLEAN ((x0), (x1)), (x2)))
-#define MAX3(x0, x1, x2) (MAX_UNCLEAN (MAX_UNCLEAN ((x0), (x1)), (x2)))
-#endif
-
 #endif /* NBDKIT_MINMAX_H */
-- 
2.29.0.rc2




More information about the Libguestfs mailing list