From 54c0a1731069a17ae4f3b79b419af75709f03f5b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 27 Dec 2018 18:27:36 -0500 Subject: [PATCH] [vector] Fix warning --- src/hb-vector.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-vector.hh b/src/hb-vector.hh index 7d615bf6a..587a85fb8 100644 --- a/src/hb-vector.hh +++ b/src/hb-vector.hh @@ -146,7 +146,7 @@ struct hb_vector_t if (unlikely (allocated < 0)) return false; - if (likely (size <= allocated)) + if (likely (size <= (unsigned) allocated)) return true; /* Reallocate */ @@ -158,7 +158,7 @@ struct hb_vector_t Type *new_array = nullptr; bool overflows = (int) new_allocated < 0 || - (new_allocated < allocated) || + (new_allocated < (unsigned) allocated) || hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); if (likely (!overflows)) new_array = (Type *) realloc (arrayZ_, new_allocated * sizeof (Type));