diff options
| author | dundargoc <gocdundar@gmail.com> | 2023-11-10 12:23:42 +0100 |
|---|---|---|
| committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-11-12 22:01:28 +0100 |
| commit | 4f8941c1a5f1ef6caa410feeb52e343db22763ce (patch) | |
| tree | 6e801079d088533198d526cb9aac8eb7981dc568 /src/nvim/eval | |
| parent | 353a4be7e84fdc101318215bdcc8a7e780d737fe (diff) | |
| download | rneovim-4f8941c1a5f1ef6caa410feeb52e343db22763ce.tar.gz rneovim-4f8941c1a5f1ef6caa410feeb52e343db22763ce.tar.bz2 rneovim-4f8941c1a5f1ef6caa410feeb52e343db22763ce.zip | |
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.
Diffstat (limited to 'src/nvim/eval')
| -rw-r--r-- | src/nvim/eval/buffer.h | 4 | ||||
| -rw-r--r-- | src/nvim/eval/decode.h | 4 | ||||
| -rw-r--r-- | src/nvim/eval/encode.h | 4 | ||||
| -rw-r--r-- | src/nvim/eval/executor.h | 4 | ||||
| -rw-r--r-- | src/nvim/eval/funcs.h | 4 | ||||
| -rw-r--r-- | src/nvim/eval/gc.h | 4 | ||||
| -rw-r--r-- | src/nvim/eval/typval.h | 5 | ||||
| -rw-r--r-- | src/nvim/eval/typval_defs.h | 5 | ||||
| -rw-r--r-- | src/nvim/eval/typval_encode.h | 5 | ||||
| -rw-r--r-- | src/nvim/eval/userfunc.h | 4 | ||||
| -rw-r--r-- | src/nvim/eval/vars.h | 4 | ||||
| -rw-r--r-- | src/nvim/eval/window.h | 4 |
12 files changed, 12 insertions, 39 deletions
diff --git a/src/nvim/eval/buffer.h b/src/nvim/eval/buffer.h index 4a2f8f9e94..fdd146885a 100644 --- a/src/nvim/eval/buffer.h +++ b/src/nvim/eval/buffer.h @@ -1,5 +1,4 @@ -#ifndef NVIM_EVAL_BUFFER_H -#define NVIM_EVAL_BUFFER_H +#pragma once #include "nvim/buffer_defs.h" #include "nvim/eval/typval_defs.h" @@ -7,4 +6,3 @@ #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/buffer.h.generated.h" #endif -#endif // NVIM_EVAL_BUFFER_H diff --git a/src/nvim/eval/decode.h b/src/nvim/eval/decode.h index 7455130221..3000cd3211 100644 --- a/src/nvim/eval/decode.h +++ b/src/nvim/eval/decode.h @@ -1,5 +1,4 @@ -#ifndef NVIM_EVAL_DECODE_H -#define NVIM_EVAL_DECODE_H +#pragma once #include <msgpack.h> #include <stddef.h> @@ -10,4 +9,3 @@ #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/decode.h.generated.h" #endif -#endif // NVIM_EVAL_DECODE_H diff --git a/src/nvim/eval/encode.h b/src/nvim/eval/encode.h index b589b8b13f..a30016e724 100644 --- a/src/nvim/eval/encode.h +++ b/src/nvim/eval/encode.h @@ -1,5 +1,4 @@ -#ifndef NVIM_EVAL_ENCODE_H -#define NVIM_EVAL_ENCODE_H +#pragma once #include <msgpack.h> #include <msgpack/pack.h> @@ -74,4 +73,3 @@ extern const char *const encode_special_var_names[]; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/encode.h.generated.h" #endif -#endif // NVIM_EVAL_ENCODE_H diff --git a/src/nvim/eval/executor.h b/src/nvim/eval/executor.h index e8bf147245..58edf7216b 100644 --- a/src/nvim/eval/executor.h +++ b/src/nvim/eval/executor.h @@ -1,5 +1,4 @@ -#ifndef NVIM_EVAL_EXECUTOR_H -#define NVIM_EVAL_EXECUTOR_H +#pragma once #include "nvim/eval/typval_defs.h" @@ -8,4 +7,3 @@ extern char *e_list_index_out_of_range_nr; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/executor.h.generated.h" #endif -#endif // NVIM_EVAL_EXECUTOR_H diff --git a/src/nvim/eval/funcs.h b/src/nvim/eval/funcs.h index 5f6132f68c..858da53e13 100644 --- a/src/nvim/eval/funcs.h +++ b/src/nvim/eval/funcs.h @@ -1,5 +1,4 @@ -#ifndef NVIM_EVAL_FUNCS_H -#define NVIM_EVAL_FUNCS_H +#pragma once #include <stdbool.h> #include <stdint.h> @@ -31,4 +30,3 @@ typedef struct { #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/funcs.h.generated.h" #endif -#endif // NVIM_EVAL_FUNCS_H diff --git a/src/nvim/eval/gc.h b/src/nvim/eval/gc.h index 66e959ced5..ea91952fff 100644 --- a/src/nvim/eval/gc.h +++ b/src/nvim/eval/gc.h @@ -1,5 +1,4 @@ -#ifndef NVIM_EVAL_GC_H -#define NVIM_EVAL_GC_H +#pragma once #include "nvim/eval/typval_defs.h" @@ -9,4 +8,3 @@ extern list_T *gc_first_list; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/gc.h.generated.h" #endif -#endif // NVIM_EVAL_GC_H diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h index d2baabb424..751b9646b3 100644 --- a/src/nvim/eval/typval.h +++ b/src/nvim/eval/typval.h @@ -1,5 +1,4 @@ -#ifndef NVIM_EVAL_TYPVAL_H -#define NVIM_EVAL_TYPVAL_H +#pragma once #include <assert.h> #include <stdbool.h> @@ -492,5 +491,3 @@ EXTERN const size_t kTVTranslate INIT( = TV_TRANSLATE); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/typval.h.generated.h" #endif - -#endif // NVIM_EVAL_TYPVAL_H diff --git a/src/nvim/eval/typval_defs.h b/src/nvim/eval/typval_defs.h index c0b5416a05..996dac20bc 100644 --- a/src/nvim/eval/typval_defs.h +++ b/src/nvim/eval/typval_defs.h @@ -1,5 +1,4 @@ -#ifndef NVIM_EVAL_TYPVAL_DEFS_H -#define NVIM_EVAL_TYPVAL_DEFS_H +#pragma once #include <inttypes.h> #include <limits.h> @@ -385,5 +384,3 @@ typedef struct list_stack_S { list_T *list; struct list_stack_S *prev; } list_stack_T; - -#endif // NVIM_EVAL_TYPVAL_DEFS_H diff --git a/src/nvim/eval/typval_encode.h b/src/nvim/eval/typval_encode.h index cf01926030..743acd8800 100644 --- a/src/nvim/eval/typval_encode.h +++ b/src/nvim/eval/typval_encode.h @@ -2,8 +2,7 @@ /// /// Contains common definitions for eval/typval_encode.c.h. Most of time should /// not be included directly. -#ifndef NVIM_EVAL_TYPVAL_ENCODE_H -#define NVIM_EVAL_TYPVAL_ENCODE_H +#pragma once #include <assert.h> #include <inttypes.h> @@ -140,5 +139,3 @@ static inline size_t tv_strlen(const typval_T *const tv) /// Name of the dummy const dict_T *const variable #define TYPVAL_ENCODE_NODICT_VAR \ _TYPVAL_ENCODE_FUNC_NAME(_typval_encode_, _nodict_var) - -#endif // NVIM_EVAL_TYPVAL_ENCODE_H diff --git a/src/nvim/eval/userfunc.h b/src/nvim/eval/userfunc.h index c3fe56d30c..7f77b55f27 100644 --- a/src/nvim/eval/userfunc.h +++ b/src/nvim/eval/userfunc.h @@ -1,5 +1,4 @@ -#ifndef NVIM_EVAL_USERFUNC_H -#define NVIM_EVAL_USERFUNC_H +#pragma once #include <stdbool.h> #include <stddef.h> @@ -97,4 +96,3 @@ typedef struct { #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/userfunc.h.generated.h" #endif -#endif // NVIM_EVAL_USERFUNC_H diff --git a/src/nvim/eval/vars.h b/src/nvim/eval/vars.h index 12ff5b11cb..124d73825b 100644 --- a/src/nvim/eval/vars.h +++ b/src/nvim/eval/vars.h @@ -1,5 +1,4 @@ -#ifndef NVIM_EVAL_VARS_H -#define NVIM_EVAL_VARS_H +#pragma once #include "nvim/ex_cmds_defs.h" #include "nvim/option_defs.h" @@ -7,4 +6,3 @@ #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/vars.h.generated.h" #endif -#endif // NVIM_EVAL_VARS_H diff --git a/src/nvim/eval/window.h b/src/nvim/eval/window.h index 671c8fbf79..8502978ac1 100644 --- a/src/nvim/eval/window.h +++ b/src/nvim/eval/window.h @@ -1,5 +1,4 @@ -#ifndef NVIM_EVAL_WINDOW_H -#define NVIM_EVAL_WINDOW_H +#pragma once #include <stdbool.h> #include <string.h> @@ -76,4 +75,3 @@ typedef struct { #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/window.h.generated.h" #endif -#endif // NVIM_EVAL_WINDOW_H |