Make VEC_GET take an index along with the type
Since most use cases require indexing the data directly, and the macro implies you're retrieving data from it, may as well take the index. If you wanted a pointer to that data, &VEC_GET(vec, index, type) works just fine.
This commit is contained in:
@@ -40,7 +40,7 @@ void sys_cleanup(sys_t *sys)
|
||||
// Iterate through each cons currently allocated and free them
|
||||
for (size_t i = 0; i < VEC_SIZE(&sys->conses, lisp_t **); ++i)
|
||||
{
|
||||
lisp_t *allocated = VEC_GET(&sys->conses, lisp_t *)[i];
|
||||
lisp_t *allocated = VEC_GET(&sys->conses, i, lisp_t *);
|
||||
switch (get_tag(allocated))
|
||||
{
|
||||
case TAG_CONS:
|
||||
|
||||
Reference in New Issue
Block a user