Loading...
Searching...
No Matches
Go to the documentation of this file. 1#ifndef __LINUX_MINMAX_H__
2#define __LINUX_MINMAX_H__
24#define min(a, b) (((a) < (b)) ? (a) : (b))
28#define max(a, b) (((a) > (b)) ? (a) : (b))
32#define min_t(type, a, b) ((type)(a) < (type)(b) ? (type)(a) : (type)(b))
36#define max_t(type, a, b) ((type)(a) > (type)(b) ? (type)(a) : (type)(b))
50#define MAX_T(type, a, b) max_t(type, a, b)
54#define MIN_T(type, a, b) min_t(type, a, b)
74 do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
78#define clamp(val, lo, hi) ((val) < (lo) ? (lo) : ((val) > (hi) ? (hi) : (val)))
92#define clamp_val(val, lo, hi) clamp((val), (lo), (hi))
96#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))