diff --git a/common/include/common/vector.h b/common/include/common/vector.h index 53f5eb3f..ad736b5d 100644 --- a/common/include/common/vector.h +++ b/common/include/common/vector.h @@ -34,10 +34,18 @@ Vector; Vector * vector_create(size_t itemSize, size_t capacity); void vector_free(Vector * vector); +inline static size_t vector_size(Vector * vector) +{ + return vector->size; +} + +inline static void * vector_data(Vector * vector) +{ + return vector->data; +} + void * vector_push(Vector * vector, void * item); void vector_pop(Vector * vector); -size_t vector_size(Vector * vector); -void * vector_data(Vector * vector); void vector_at(Vector * vector, size_t index, void * data); void * vector_ptrTo(Vector * vector, size_t index); void vector_clear(Vector * vector); @@ -59,7 +67,6 @@ void vector_clear(Vector * vector); index < (vector)->size ? vector_at((vector), index, &(name)), true : false; \ ++index) - #define vector_forEachRefIdx(index, name, vector) \ for (size_t index = 0; \ index < (vector)->size ? (name) = vector_ptrTo((vector), index), true : false; \ diff --git a/common/src/vector.c b/common/src/vector.c index 1288cf16..969c2972 100644 --- a/common/src/vector.c +++ b/common/src/vector.c @@ -82,16 +82,6 @@ void vector_pop(Vector * vector) --vector->size; } -size_t vector_size(Vector * vector) -{ - return vector->size; -} - -void * vector_data(Vector * vector) -{ - return vector->data; -} - void vector_at(Vector * vector, size_t index, void * data) { DEBUG_ASSERT(index < vector->size && "Out of bounds access");