parent
558f922788
commit
b398748d8b
|
@ -360,6 +360,13 @@ struct
|
||||||
(hb_forward<T> (a) >= hb_forward<T2> (b) ? hb_forward<T> (a) : hb_forward<T2> (b))
|
(hb_forward<T> (a) >= hb_forward<T2> (b) ? hb_forward<T> (a) : hb_forward<T2> (b))
|
||||||
}
|
}
|
||||||
HB_FUNCOBJ (hb_max);
|
HB_FUNCOBJ (hb_max);
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
template <typename T, typename T2, typename T3> constexpr auto
|
||||||
|
operator () (T&& x, T2&& min, T3&& max) const HB_AUTO_RETURN
|
||||||
|
(hb_min (hb_max (hb_forward<T> (x), hb_forward<T2> (min)), hb_forward<T3> (max)))
|
||||||
|
}
|
||||||
|
HB_FUNCOBJ (hb_clamp);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -229,7 +229,7 @@ struct fvar
|
||||||
hb_ot_var_axis_info_t axis;
|
hb_ot_var_axis_info_t axis;
|
||||||
get_axis_info (axis_index, &axis);
|
get_axis_info (axis_index, &axis);
|
||||||
|
|
||||||
v = hb_max (hb_min (v, axis.max_value), axis.min_value); /* Clamp. */
|
v = hb_clamp (v, axis.min_value, axis.max_value);
|
||||||
|
|
||||||
if (v == axis.default_value)
|
if (v == axis.default_value)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -201,9 +201,9 @@ struct hb_sanitize_context_t :
|
||||||
if (unlikely (hb_unsigned_mul_overflows (this->end - this->start, HB_SANITIZE_MAX_OPS_FACTOR)))
|
if (unlikely (hb_unsigned_mul_overflows (this->end - this->start, HB_SANITIZE_MAX_OPS_FACTOR)))
|
||||||
this->max_ops = HB_SANITIZE_MAX_OPS_MAX;
|
this->max_ops = HB_SANITIZE_MAX_OPS_MAX;
|
||||||
else
|
else
|
||||||
this->max_ops = hb_min (hb_max ((unsigned int) (this->end - this->start) * HB_SANITIZE_MAX_OPS_FACTOR,
|
this->max_ops = hb_clamp ((unsigned) (this->end - this->start) * HB_SANITIZE_MAX_OPS_FACTOR,
|
||||||
(unsigned) HB_SANITIZE_MAX_OPS_MIN),
|
(unsigned) HB_SANITIZE_MAX_OPS_MIN,
|
||||||
(unsigned) HB_SANITIZE_MAX_OPS_MAX);
|
(unsigned) HB_SANITIZE_MAX_OPS_MAX);
|
||||||
this->edit_count = 0;
|
this->edit_count = 0;
|
||||||
this->debug_depth = 0;
|
this->debug_depth = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue