From 7914ec201ef19fa0c0caed99dc150a953eb9bc19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Wed, 21 Oct 2020 21:25:59 +0200 Subject: Hashtable update - use consistent type for key by introducing a new typedef - use unsigned types for sizes - name parameters in foreach function typedef --- Vector.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Vector.c') diff --git a/Vector.c b/Vector.c index 09d1612e..721ebdd3 100644 --- a/Vector.c +++ b/Vector.c @@ -60,14 +60,14 @@ static bool Vector_isConsistent(const Vector* this) { } } -int Vector_count(const Vector* this) { - int items = 0; +unsigned int Vector_count(const Vector* this) { + unsigned int items = 0; for (int i = 0; i < this->items; i++) { if (this->array[i]) { items++; } } - assert(items == this->items); + assert(items == (unsigned int)this->items); return items; } -- cgit v1.2.3