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/api/private/converter.h | 5 +---- src/nvim/api/private/defs.h | 5 +---- src/nvim/api/private/dispatch.h | 5 +---- src/nvim/api/private/helpers.h | 5 +---- src/nvim/api/private/validate.h | 5 +---- 5 files changed, 5 insertions(+), 20 deletions(-) (limited to 'src/nvim/api/private') diff --git a/src/nvim/api/private/converter.h b/src/nvim/api/private/converter.h index 28ae71983b..47e1d5a6bb 100644 --- a/src/nvim/api/private/converter.h +++ b/src/nvim/api/private/converter.h @@ -1,5 +1,4 @@ -#ifndef NVIM_API_PRIVATE_CONVERTER_H -#define NVIM_API_PRIVATE_CONVERTER_H +#pragma once #include "nvim/api/private/defs.h" #include "nvim/eval/typval_defs.h" @@ -7,5 +6,3 @@ #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/private/converter.h.generated.h" #endif - -#endif // NVIM_API_PRIVATE_CONVERTER_H diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h index b467ce75a9..067592ed4e 100644 --- a/src/nvim/api/private/defs.h +++ b/src/nvim/api/private/defs.h @@ -1,5 +1,4 @@ -#ifndef NVIM_API_PRIVATE_DEFS_H -#define NVIM_API_PRIVATE_DEFS_H +#pragma once #include #include @@ -139,5 +138,3 @@ typedef struct { } KeySetLink; typedef KeySetLink *(*FieldHashfn)(const char *str, size_t len); - -#endif // NVIM_API_PRIVATE_DEFS_H diff --git a/src/nvim/api/private/dispatch.h b/src/nvim/api/private/dispatch.h index 78fcf88d7b..49332bfecc 100644 --- a/src/nvim/api/private/dispatch.h +++ b/src/nvim/api/private/dispatch.h @@ -1,5 +1,4 @@ -#ifndef NVIM_API_PRIVATE_DISPATCH_H -#define NVIM_API_PRIVATE_DISPATCH_H +#pragma once #include #include @@ -30,5 +29,3 @@ extern const MsgpackRpcRequestHandler method_handlers[]; # include "api/private/dispatch_wrappers.h.generated.h" # include "keysets_defs.generated.h" #endif - -#endif // NVIM_API_PRIVATE_DISPATCH_H diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index 8911e145e7..82c24b7c65 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -1,5 +1,4 @@ -#ifndef NVIM_API_PRIVATE_HELPERS_H -#define NVIM_API_PRIVATE_HELPERS_H +#pragma once #include #include @@ -199,5 +198,3 @@ typedef struct { current_channel_id = save_channel_id; \ current_sctx = save_current_sctx; \ } while (0); - -#endif // NVIM_API_PRIVATE_HELPERS_H diff --git a/src/nvim/api/private/validate.h b/src/nvim/api/private/validate.h index 089b8d2f9c..29ca6242f3 100644 --- a/src/nvim/api/private/validate.h +++ b/src/nvim/api/private/validate.h @@ -1,5 +1,4 @@ -#ifndef NVIM_API_PRIVATE_VALIDATE_H -#define NVIM_API_PRIVATE_VALIDATE_H +#pragma once #include #include @@ -95,5 +94,3 @@ #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/private/validate.h.generated.h" #endif - -#endif // NVIM_API_PRIVATE_VALIDATE_H -- cgit