definitions: unify MAX and MIN macro definitions

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko 2022-03-16 12:13:12 +01:00 committed by Xiang Xiao
parent b207387d48
commit 566be8c7b1
13 changed files with 23 additions and 23 deletions

View file

@ -54,10 +54,10 @@
/* Helpers ******************************************************************/
#ifndef MIN
# define MIN(a,b) (a < b ? a : b)
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef MAX
# define MAX(a,b) (a > b ? a : b)
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
/****************************************************************************

View file

@ -67,11 +67,10 @@
#endif
#ifndef MIN
# define MIN(a, b) (a < b ? a : b)
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef MAX
# define MAX(a, b) (a > b ? a : b)
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
/****************************************************************************

View file

@ -53,7 +53,7 @@
#endif
#ifndef MIN
# define MIN(a,b) (a < b ? a : b)
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/****************************************************************************

View file

@ -154,11 +154,10 @@
/* Helpers */
#ifndef MIN
# define MIN(a,b) (((a) < (b)) ? (a) : (b))
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef MAX
# define MAX(a,b) (((a) > (b)) ? (a) : (b))
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
/****************************************************************************

View file

@ -53,7 +53,7 @@
#endif
#ifndef MIN
# define MIN(a,b) (a < b ? a : b)
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/****************************************************************************

View file

@ -103,7 +103,7 @@
#endif
#ifndef MIN
# define MIN(a,b) ((a)<(b)?(a):(b))
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#define UDPBLASTER_SENDSIZE MIN(UDPBLASTER_MSS, g_udpblaster_strlen)

View file

@ -54,10 +54,10 @@
/* Helpers ******************************************************************/
#ifndef MIN
# define MIN(a,b) (a < b ? a : b)
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef MAX
# define MAX(a,b) (a > b ? a : b)
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
/****************************************************************************

View file

@ -62,10 +62,10 @@
#define MINHEIGHT 0 // had been 32
#define MINWIDTH 0 // had been 60
#define makemult(a,b) ((b==1) ? (a) : (((int)((a) / (b))) * (b)))
#define makemult(a,b) ((b == 1) ? (a) : (((int)((a) / (b))) * (b)))
#ifndef MIN
# define MIN(a,b) (((a) < (b)) ? (a) : (b))
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/////////////////////////////////////////////////////////////////////////////

View file

@ -121,7 +121,7 @@
/* Get the larger value */
#ifndef MAX
# define MAX(a,b) (a > b ? a : b)
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
/****************************************************************************

View file

@ -36,8 +36,11 @@
#define DEFATLT_DISTANCE 10
#define DELAY_MS(ms) usleep((ms) * 1000)
#define ABS(a) (((a) > 0) ? (a) : -(a))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define ABS(a) ((a) > 0 ? (a) : -(a))
#ifndef MAX
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
/****************************************************************************
* Private Types

View file

@ -49,7 +49,7 @@
#define sched_unlock()
#ifndef MIN
# define MIN(a,b) (((a) < (b)) ? (a) : (b))
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/****************************************************************************

View file

@ -50,11 +50,10 @@
#define PRIO_LO_NDX 1
#ifndef MIN
# define MIN(a,b) (((a) < (b)) ? (a) : (b))
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef MAX
# define MAX(a,b) (((a) > (b)) ? (a) : (b))
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
/****************************************************************************

View file

@ -59,7 +59,7 @@
#endif
#ifndef MIN
# define MIN(a,b) (((a) < (b)) ? (a) : (b))
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#define SOCKET_BASE 10000