From b62c0c8d9c22ae7fc9ee200733f8312efa6dbced Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Mon, 20 Feb 2023 08:12:59 +0100 Subject: docs: fix typos (#21961) Co-authored-by: Ben Morgan --- src/nvim/garray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/garray.h') diff --git a/src/nvim/garray.h b/src/nvim/garray.h index 1623c4db7b..d3e04cd761 100644 --- a/src/nvim/garray.h +++ b/src/nvim/garray.h @@ -52,7 +52,7 @@ static inline void *ga_append_via_ptr(garray_T *gap, size_t item_size) /// /// @param gap the garray to be freed /// @param item_type type of the item in the garray -/// @param free_item_fn free function that takes (*item_type) as parameter +/// @param free_item_fn free function that takes (item_type *) as parameter #define GA_DEEP_CLEAR(gap, item_type, free_item_fn) \ do { \ garray_T *_gap = (gap); \ -- cgit From 4f8941c1a5f1ef6caa410feeb52e343db22763ce Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 10 Nov 2023 12:23:42 +0100 Subject: refactor: replace manual header guards with #pragma once It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard. --- src/nvim/garray.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/garray.h') diff --git a/src/nvim/garray.h b/src/nvim/garray.h index d3e04cd761..d5322053bb 100644 --- a/src/nvim/garray.h +++ b/src/nvim/garray.h @@ -1,5 +1,4 @@ -#ifndef NVIM_GARRAY_H -#define NVIM_GARRAY_H +#pragma once #include #include @@ -72,5 +71,3 @@ static inline void *ga_append_via_ptr(garray_T *gap, size_t item_size) /// /// @param gap the garray to be freed #define GA_DEEP_CLEAR_PTR(gap) GA_DEEP_CLEAR(gap, void *, FREE_PTR_PTR) - -#endif // NVIM_GARRAY_H -- cgit From 6361806aa28edca55ad3316a58bc3e936df9c0eb Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 26 Nov 2023 22:58:52 +0800 Subject: refactor: move garray_T to garray_defs.h (#26227) --- src/nvim/garray.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/nvim/garray.h') diff --git a/src/nvim/garray.h b/src/nvim/garray.h index d5322053bb..bebf6fc35f 100644 --- a/src/nvim/garray.h +++ b/src/nvim/garray.h @@ -3,24 +3,11 @@ #include #include +#include "nvim/garray_defs.h" #include "nvim/log.h" #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 -/// once, and needs to be accessed by index. See ga_clear() and ga_grow(). -typedef struct growarray { - int ga_len; // current number of items used - int ga_maxlen; // maximum number of items possible - int ga_itemsize; // sizeof(item) - int ga_growsize; // number of items to grow each time - void *ga_data; // pointer to the first item -} garray_T; - -#define GA_EMPTY_INIT_VALUE { 0, 0, 0, 1, NULL } -#define GA_INIT(itemsize, growsize) { 0, 0, (itemsize), (growsize), NULL } - #define GA_EMPTY(ga_ptr) ((ga_ptr)->ga_len <= 0) #define GA_APPEND(item_type, gap, item) \ -- cgit From 09541d514dd18bf86f673d3784d406236fcbdad8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 27 Nov 2023 09:51:26 +0800 Subject: build(IWYU): replace public-to-public mappings with pragmas (#26237) --- src/nvim/garray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/garray.h') diff --git a/src/nvim/garray.h b/src/nvim/garray.h index bebf6fc35f..6bfbb583c4 100644 --- a/src/nvim/garray.h +++ b/src/nvim/garray.h @@ -3,7 +3,7 @@ #include #include -#include "nvim/garray_defs.h" +#include "nvim/garray_defs.h" // IWYU pragma: export #include "nvim/log.h" #include "nvim/memory.h" #include "nvim/types.h" -- cgit From 6c14ae6bfaf51415b555e9a6b85d1d280976358d Mon Sep 17 00:00:00 2001 From: dundargoc Date: Mon, 27 Nov 2023 20:27:32 +0100 Subject: refactor: rename types.h to types_defs.h --- src/nvim/garray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/garray.h') diff --git a/src/nvim/garray.h b/src/nvim/garray.h index 6bfbb583c4..a96deda759 100644 --- a/src/nvim/garray.h +++ b/src/nvim/garray.h @@ -6,7 +6,7 @@ #include "nvim/garray_defs.h" // IWYU pragma: export #include "nvim/log.h" #include "nvim/memory.h" -#include "nvim/types.h" +#include "nvim/types_defs.h" #define GA_EMPTY(ga_ptr) ((ga_ptr)->ga_len <= 0) -- cgit