Skip to content

Commit

Permalink
reformat and change max/min generic, test to fix macos build
Browse files Browse the repository at this point in the history
  • Loading branch information
radkesvat committed Aug 3, 2024
1 parent d6fa120 commit f8c94da
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions ww/utils/mathutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
unsigned long long: maxULL, \
unsigned long int: maxULInt, \
unsigned int: maxUInt, \
signed long int: maxSLInt, \
int: maxInt, \
double: maxDouble, \
ssize_t: maxSsize)(a, b)
double: maxDouble)(a, b)

static inline unsigned long long maxULL(unsigned long long a, unsigned long long b)
{
Expand All @@ -36,18 +36,20 @@ static inline unsigned int maxUInt(unsigned int a, unsigned int b)
{
return a > b ? a : b;
}
static inline int maxInt(int a, int b)
static inline signed long int maxSLInt(signed long int a, signed long int b)
{
return a > b ? a : b;
}
static inline double maxDouble(double a, double b)

static inline int maxInt(int a, int b)
{
return a > b ? a : b;
}
static inline ssize_t maxSsize(ssize_t a, ssize_t b)
static inline double maxDouble(double a, double b)
{
return a > b ? a : b;
}

static inline long maxLong(long a, long b)
{
return a > b ? a : b;
Expand All @@ -59,9 +61,9 @@ static inline long maxLong(long a, long b)
unsigned long long: minULL, \
unsigned long int: minULInt, \
unsigned int: minUInt, \
signed long int: minSLInt, \
int: minInt, \
double: minDouble, \
ssize_t: minSsize)(a, b)
double: minDouble)(a, b)

static inline unsigned long long minULL(unsigned long long a, unsigned long long b)
{
Expand All @@ -70,26 +72,29 @@ static inline unsigned long long minULL(unsigned long long a, unsigned long long

static inline unsigned long int minULInt(unsigned long int a, unsigned long int b)
{
return a > b ? a : b;
return a < b ? a : b;
}

static inline unsigned int minUInt(unsigned int a, unsigned int b)
{
return a < b ? a : b;
}

static inline int minInt(int a, int b)
static inline signed long int minSLInt(signed long int a, signed long int b)
{
return a < b ? a : b;
}
static inline double minDouble(double a, double b)

static inline int minInt(int a, int b)
{
return a < b ? a : b;
}
static inline ssize_t minSsize(ssize_t a, ssize_t b)

static inline double minDouble(double a, double b)
{
return a < b ? a : b;
}

static inline long minLong(long a, long b)
{
return a < b ? a : b;
Expand Down

0 comments on commit f8c94da

Please sign in to comment.