提交 54c0a173 编写于 作者: B Behdad Esfahbod

[vector] Fix warning

上级 1043ddbe
...@@ -146,7 +146,7 @@ struct hb_vector_t ...@@ -146,7 +146,7 @@ struct hb_vector_t
if (unlikely (allocated < 0)) if (unlikely (allocated < 0))
return false; return false;
if (likely (size <= allocated)) if (likely (size <= (unsigned) allocated))
return true; return true;
/* Reallocate */ /* Reallocate */
...@@ -158,7 +158,7 @@ struct hb_vector_t ...@@ -158,7 +158,7 @@ struct hb_vector_t
Type *new_array = nullptr; Type *new_array = nullptr;
bool overflows = bool overflows =
(int) new_allocated < 0 || (int) new_allocated < 0 ||
(new_allocated < allocated) || (new_allocated < (unsigned) allocated) ||
hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); hb_unsigned_mul_overflows (new_allocated, sizeof (Type));
if (likely (!overflows)) if (likely (!overflows))
new_array = (Type *) realloc (arrayZ_, new_allocated * sizeof (Type)); new_array = (Type *) realloc (arrayZ_, new_allocated * sizeof (Type));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册