From 70aa5071d89dbba792c4c9fb4df7ca716304656a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 7 Dec 2019 22:35:34 -0600 Subject: [PATCH] [algs] Adjust return value of hb_ctz(0) to be 32 instead of 0 --- src/hb-algs.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-algs.hh b/src/hb-algs.hh index edafeab3f..d6f643d05 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -486,7 +486,7 @@ template static inline HB_CONST_FUNC unsigned int hb_ctz (T v) { - if (unlikely (!v)) return 0; + if (unlikely (!v)) return 8 * sizeof (T); #if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) if (sizeof (T) <= sizeof (unsigned int))