From e0315b4aadb3fbc6b618de56d643471e8d1f7859 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 10 May 2019 19:48:02 -0700 Subject: [PATCH] [meta] is_integer -> is_integral --- src/hb-algs.hh | 2 +- src/hb-map.hh | 4 ++-- src/hb-meta.hh | 26 +++++++++++++------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/hb-algs.hh b/src/hb-algs.hh index bbf748e..24bdeb1 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -73,7 +73,7 @@ struct impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, hb_deref (v).hash ()) template auto + hb_enable_if (hb_is_integral (T))> auto impl (const T& v, hb_priority<0>) const HB_AUTO_RETURN ( /* Knuth's multiplicative method: */ diff --git a/src/hb-map.hh b/src/hb-map.hh index 942a301..26e4930 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -43,8 +43,8 @@ struct hb_hashmap_t hb_hashmap_t () { init (); } ~hb_hashmap_t () { fini (); } - static_assert (hb_is_integer (K) || hb_is_pointer (K), ""); - static_assert (hb_is_integer (V) || hb_is_pointer (V), ""); + static_assert (hb_is_integral (K) || hb_is_pointer (K), ""); + static_assert (hb_is_integral (V) || hb_is_pointer (V), ""); /* TODO If key type is a pointer, keep hash in item_t and use to: * 1. avoid rehashing when resizing table, and diff --git a/src/hb-meta.hh b/src/hb-meta.hh index 4cf8466..290b41c 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -274,19 +274,19 @@ template <> struct hb_signedness_int { typedef unsigned int value; }; template <> struct hb_signedness_int { typedef signed int value; }; #define hb_signedness_int(T) hb_signedness_int::value -template struct hb_is_integer { static constexpr bool value = false;}; -template <> struct hb_is_integer { static constexpr bool value = true; }; -template <> struct hb_is_integer { static constexpr bool value = true; }; -template <> struct hb_is_integer { static constexpr bool value = true; }; -template <> struct hb_is_integer { static constexpr bool value = true; }; -template <> struct hb_is_integer { static constexpr bool value = true; }; -template <> struct hb_is_integer { static constexpr bool value = true; }; -template <> struct hb_is_integer { static constexpr bool value = true; }; -template <> struct hb_is_integer { static constexpr bool value = true; }; -template <> struct hb_is_integer { static constexpr bool value = true; }; -template <> struct hb_is_integer { static constexpr bool value = true; }; -template <> struct hb_is_integer { static constexpr bool value = true; }; -#define hb_is_integer(T) hb_is_integer::value +template struct hb_is_integral { static constexpr bool value = false;}; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +#define hb_is_integral(T) hb_is_integral::value #endif /* HB_META_HH */ -- 2.7.4