mirror of https://github.com/xzeldon/htop.git
Mark search parameter in Vector_indexOf const
This commit is contained in:
parent
2f9381d867
commit
bfa7d1fbe2
6
Vector.c
6
Vector.c
|
@ -288,9 +288,9 @@ void Vector_add(Vector* this, void* data_) {
|
||||||
assert(Vector_isConsistent(this));
|
assert(Vector_isConsistent(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
int Vector_indexOf(Vector* this, void* search_, Object_Compare compare) {
|
int Vector_indexOf(Vector* this, const void* search_, Object_Compare compare) {
|
||||||
Object* search = search_;
|
const Object* search = search_;
|
||||||
assert(Object_isA((Object*)search, this->type));
|
assert(Object_isA(search, this->type));
|
||||||
assert(compare);
|
assert(compare);
|
||||||
assert(Vector_isConsistent(this));
|
assert(Vector_isConsistent(this));
|
||||||
for (int i = 0; i < this->items; i++) {
|
for (int i = 0; i < this->items; i++) {
|
||||||
|
|
2
Vector.h
2
Vector.h
|
@ -61,7 +61,7 @@ int Vector_count(Vector* this);
|
||||||
|
|
||||||
void Vector_add(Vector* this, void* data_);
|
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);
|
void Vector_splice(Vector* this, Vector* from);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue