diff options
Diffstat (limited to 'src/nvim/garray.h')
-rw-r--r-- | src/nvim/garray.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/garray.h b/src/nvim/garray.h index 56bd5c9130..1623c4db7b 100644 --- a/src/nvim/garray.h +++ b/src/nvim/garray.h @@ -1,10 +1,12 @@ #ifndef NVIM_GARRAY_H #define NVIM_GARRAY_H -#include <stddef.h> // for size_t +#include <stdbool.h> +#include <stddef.h> #include "nvim/log.h" -#include "nvim/types.h" // for char_u +#include "nvim/memory.h" +#include "nvim/types.h" /// Structure used for growing arrays. /// This is used to store information that only grows, is deleted all at @@ -25,7 +27,8 @@ typedef struct growarray { #define GA_APPEND(item_type, gap, item) \ do { \ ga_grow(gap, 1); \ - ((item_type *)(gap)->ga_data)[(gap)->ga_len++] = (item); \ + ((item_type *)(gap)->ga_data)[(gap)->ga_len] = (item); \ + (gap)->ga_len++; \ } while (0) #define GA_APPEND_VIA_PTR(item_type, gap) \ |