Lines Matching refs:hi
60 #define __clamp(val, lo, hi) \ argument
61 ((val) >= (hi) ? (hi) : ((val) <= (lo) ? (lo) : (val)))
63 #define __clamp_once(val, lo, hi, unique_val, unique_lo, unique_hi) ({ \ argument
66 typeof(hi) unique_hi = (hi); \
67 static_assert(__builtin_choose_expr(__is_constexpr((lo) > (hi)), \
68 (lo) <= (hi), true), \
69 "clamp() low limit " #lo " greater than high limit " #hi); \
71 static_assert(__types_ok(val, hi), "clamp() 'hi' signedness error"); \
74 #define __careful_clamp(val, lo, hi) ({ \ argument
75 __builtin_choose_expr(__is_constexpr((val) - (lo) + (hi)), \
76 __clamp(val, lo, hi), \
77 __clamp_once(val, lo, hi, __UNIQUE_ID(__val), \
146 #define clamp(val, lo, hi) __careful_clamp(val, lo, hi) argument
224 #define clamp_t(type, val, lo, hi) __careful_clamp((type)(val), (type)(lo), (type)(hi)) argument
237 #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) argument