From bfa7d1fbe275c6b7551af3afa99f4e90eaa315e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Wed, 14 Oct 2020 15:19:23 +0200 Subject: [PATCH] Mark search parameter in Vector_indexOf const --- Vector.c | 6 +++--- Vector.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Vector.c b/Vector.c index a12d6bb5..aa316805 100644 --- a/Vector.c +++ b/Vector.c @@ -288,9 +288,9 @@ void Vector_add(Vector* this, void* data_) { assert(Vector_isConsistent(this)); } -int Vector_indexOf(Vector* this, void* search_, Object_Compare compare) { - Object* search = search_; - assert(Object_isA((Object*)search, this->type)); +int Vector_indexOf(Vector* this, const void* search_, Object_Compare compare) { + const Object* search = search_; + assert(Object_isA(search, this->type)); assert(compare); assert(Vector_isConsistent(this)); for (int i = 0; i < this->items; i++) { diff --git a/Vector.h b/Vector.h index d0d42c6c..1b599d69 100644 --- a/Vector.h +++ b/Vector.h @@ -61,7 +61,7 @@ int Vector_count(Vector* this); void Vector_add(Vector* this, void* data_); -int Vector_indexOf(Vector* this, void* search_, Object_Compare compare); +int Vector_indexOf(Vector* this, const void* search_, Object_Compare compare); void Vector_splice(Vector* this, Vector* from);