diff options
author | Chris Robinson <[email protected]> | 2014-03-31 06:13:56 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-03-31 06:13:56 -0700 |
commit | 570eb4e1a7efb15a93a8b70e9293de6523b63284 (patch) | |
tree | 117a7030606dcf864c4ba560a6a00a8a5fe19fff /Alc/vector.h | |
parent | 48b472abb7a7bb88ef225141b0f153d8f49ea77c (diff) |
Don't pass the vector's capacity as a parameter to vector_reserve
Diffstat (limited to 'Alc/vector.h')
-rw-r--r-- | Alc/vector.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Alc/vector.h b/Alc/vector.h index 7ff65146..4c994581 100644 --- a/Alc/vector.h +++ b/Alc/vector.h @@ -22,8 +22,8 @@ typedef const struct vector_##T##_s *const_vector_##T; #define VECTOR_DEINIT(_x) do { free((_x)); (_x) = NULL; } while(0) /* Helper to increase a vector's reserve. Do not call directly. */ -ALboolean vector_reserve(void *ptr, size_t orig_count, size_t base_size, size_t obj_count, size_t obj_size, ALboolean exact); -#define VECTOR_RESERVE(_x, _c) (vector_reserve(&(_x), (_x)->Capacity, sizeof(*(_x)), (_c), sizeof((_x)->Data[0]), AL_TRUE)) +ALboolean vector_reserve(void *ptr, size_t base_size, size_t obj_count, size_t obj_size, ALboolean exact); +#define VECTOR_RESERVE(_x, _c) (vector_reserve(&(_x), sizeof(*(_x)), (_c), sizeof((_x)->Data[0]), AL_TRUE)) /* Helper to change a vector's size. Do not call directly. */ ALboolean vector_resize(void *ptr, size_t base_size, size_t obj_count, size_t obj_size); @@ -35,7 +35,7 @@ ALboolean vector_resize(void *ptr, size_t base_size, size_t obj_count, size_t ob #define VECTOR_ITER_BEGIN(_x) ((_x)->Data) #define VECTOR_ITER_END(_x) ((_x)->Data + (_x)->Size) -#define VECTOR_PUSH_BACK(_x, _obj) (vector_reserve(&(_x), (_x)->Capacity, sizeof(*(_x)), (_x)->Size+1, sizeof((_x)->Data[0]), AL_FALSE) && \ +#define VECTOR_PUSH_BACK(_x, _obj) (vector_reserve(&(_x), sizeof(*(_x)), (_x)->Size+1, sizeof((_x)->Data[0]), AL_FALSE) && \ (((_x)->Data[(_x)->Size++] = (_obj)),AL_TRUE)) #define VECTOR_POP_BACK(_x) ((void)((_x)->Size--)) |