From 499248c533eaf88f20920bc438a939989a359956 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 16 Apr 2021 13:14:48 -0600 Subject: [PATCH] [blob] Use min_size, instead of null_size in .as() Part of https://github.com/harfbuzz/harfbuzz/pull/2067 --- src/hb-array.hh | 2 +- src/hb-null.hh | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/hb-array.hh b/src/hb-array.hh index 02bd8d81c..9af98b103 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -219,7 +219,7 @@ struct hb_array_t : hb_iter_with_fallback_t, Type&> unsigned P = sizeof (Type), hb_enable_if (P == 1)> const T *as () const - { return length < hb_null_size (T) ? &Null (T) : reinterpret_cast (arrayZ); } + { return length < hb_min_size (T) ? &Null (T) : reinterpret_cast (arrayZ); } template struct _hb_null_size : hb_integral_constant {}; template struct _hb_null_size> : hb_integral_constant {}; - template using hb_null_size = _hb_null_size; #define hb_null_size(T) hb_null_size::value @@ -68,6 +67,14 @@ template using hb_static_size = _hb_static_size; #define hb_static_size(T) hb_static_size::value +template +struct _hb_min_size : hb_integral_constant {}; +template +struct _hb_min_size> : hb_integral_constant {}; +template +using hb_min_size = _hb_min_size; +#define hb_min_size(T) hb_min_size::value + /* * Null()