Minor casts

pull/4317/head
Behdad Esfahbod 2 years ago
parent db3aeeb547
commit 0980e2b748
  1. 4
      src/hb-algs.hh
  2. 8
      src/hb-bit-page.hh

@ -362,10 +362,10 @@ struct
// https://github.com/harfbuzz/harfbuzz/pull/4228#issuecomment-1565079537
template <typename T,
hb_enable_if (std::is_integral<T>::value && sizeof (T) <= sizeof (uint32_t))> constexpr auto
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, v * 2654435761u /* Knuh's multiplicative hash */)
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, (uint32_t) v * 2654435761u /* Knuh's multiplicative hash */)
template <typename T,
hb_enable_if (std::is_integral<T>::value && sizeof (T) > sizeof (uint32_t))> constexpr auto
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, (v ^ (v >> 32)) * 2654435761u /* Knuth's multiplicative hash */)
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, (uint32_t) (v ^ (v >> 32)) * 2654435761u /* Knuth's multiplicative hash */)
template <typename T> constexpr auto
impl (const T& v, hb_priority<0>) const HB_RETURN (uint32_t, std::hash<hb_decay<decltype (hb_deref (v))>>{} (hb_deref (v)))

@ -123,12 +123,12 @@ struct hb_bit_page_t
*la |= (mask (b) << 1) - mask(a);
else
{
*la |= ~(mask (a) - 1);
*la |= ~(mask (a) - 1llu);
la++;
hb_memset (la, 0xff, (char *) lb - (char *) la);
*lb |= ((mask (b) << 1) - 1);
*lb |= ((mask (b) << 1) - 1llu);
}
dirty ();
}
@ -137,7 +137,7 @@ struct hb_bit_page_t
elt_t *la = &elt (a);
elt_t *lb = &elt (b);
if (la == lb)
*la &= ~((mask (b) << 1) - mask(a));
*la &= ~((mask (b) << 1llu) - mask(a));
else
{
*la &= mask (a) - 1;
@ -145,7 +145,7 @@ struct hb_bit_page_t
hb_memset (la, 0, (char *) lb - (char *) la);
*lb &= ~((mask (b) << 1) - 1);
*lb &= ~((mask (b) << 1) - 1llu);
}
dirty ();
}

Loading…
Cancel
Save