util_math: add MAX3 macro

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
main
Emil Velikov 2015-09-07 14:13:32 +01:00
parent bc2aca9e22
commit 6c88173f7e
1 changed files with 1 additions and 0 deletions

View File

@ -26,6 +26,7 @@
#define MIN2( A, B ) ( (A)<(B) ? (A) : (B) ) #define MIN2( A, B ) ( (A)<(B) ? (A) : (B) )
#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) ) #define MAX2( A, B ) ( (A)>(B) ? (A) : (B) )
#define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
#define __align_mask(value, mask) (((value) + (mask)) & ~(mask)) #define __align_mask(value, mask) (((value) + (mask)) & ~(mask))
#define ALIGN(value, alignment) __align_mask(value, (typeof(value))((alignment) - 1)) #define ALIGN(value, alignment) __align_mask(value, (typeof(value))((alignment) - 1))