diff options
author | Chris Robinson <[email protected]> | 2014-03-21 02:41:46 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-03-21 02:41:46 -0700 |
commit | 40a0692a1c9cc022c224577a3806ae9f0599695f (patch) | |
tree | e24b66ace529f8f7786c8ea5ef2cee252e46313a /Alc/vector.h | |
parent | ff63188cc2eb307eb874350e5281733d9c50f258 (diff) |
Use vectors for the GenModList
Diffstat (limited to 'Alc/vector.h')
-rw-r--r-- | Alc/vector.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Alc/vector.h b/Alc/vector.h index 51e642ee..81ba5baf 100644 --- a/Alc/vector.h +++ b/Alc/vector.h @@ -25,6 +25,7 @@ ALboolean vector_reserve(void *ptr, size_t orig_count, size_t base_size, size_t #define VECTOR_RESERVE(_x, _c) (vector_reserve(&(_x), (_x)->Max, sizeof(*(_x)), (_c), sizeof((_x)->Data[0]))) #define VECTOR_SIZE(_x) ((const ALsizei)(_x)->Size) +#define VECTOR_MAX(_x) ((const ALsizei)(_x)->Max) #define VECTOR_ITER_BEGIN(_x) ((_x)->Data) #define VECTOR_ITER_END(_x) ((_x)->Data + (_x)->Size) @@ -33,6 +34,9 @@ ALboolean vector_reserve(void *ptr, size_t orig_count, size_t base_size, size_t #define VECTOR_PUSH_BACK(_x, _obj) ((void)((_x)->Data[(_x)->Size++] = (_obj))) #define VECTOR_POP_BACK(_x) ((void)((_x)->Size--)) -#define VECTOR_ELEM(_x, _o) ((_x)->Data[_o]) +#define VECTOR_BACK(_x) ((_x)->Data[(_x)->Size-1]) +#define VECTOR_FRONT(_x) ((_x)->Data[0]) + +#define VECTOR_ELEM(_x, _o) ((_x)->Data[(_o)]) #endif /* AL_VECTOR_H */ |