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/msgpack_rpc/channel.h | 4 +--- src/nvim/msgpack_rpc/channel_defs.h | 5 +---- src/nvim/msgpack_rpc/helpers.h | 5 +---- src/nvim/msgpack_rpc/server.h | 4 +--- src/nvim/msgpack_rpc/unpacker.h | 5 +---- 5 files changed, 5 insertions(+), 18 deletions(-) (limited to 'src/nvim/msgpack_rpc') diff --git a/src/nvim/msgpack_rpc/channel.h b/src/nvim/msgpack_rpc/channel.h index 2a6626a6e1..e2b7f5d8d1 100644 --- a/src/nvim/msgpack_rpc/channel.h +++ b/src/nvim/msgpack_rpc/channel.h @@ -1,5 +1,4 @@ -#ifndef NVIM_MSGPACK_RPC_CHANNEL_H -#define NVIM_MSGPACK_RPC_CHANNEL_H +#pragma once #include #include @@ -22,4 +21,3 @@ EXTERN MultiQueue *ch_before_blocking_events INIT( = NULL); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "msgpack_rpc/channel.h.generated.h" #endif -#endif // NVIM_MSGPACK_RPC_CHANNEL_H diff --git a/src/nvim/msgpack_rpc/channel_defs.h b/src/nvim/msgpack_rpc/channel_defs.h index 79aa8c1b13..0bbffb8beb 100644 --- a/src/nvim/msgpack_rpc/channel_defs.h +++ b/src/nvim/msgpack_rpc/channel_defs.h @@ -1,5 +1,4 @@ -#ifndef NVIM_MSGPACK_RPC_CHANNEL_DEFS_H -#define NVIM_MSGPACK_RPC_CHANNEL_DEFS_H +#pragma once #include #include @@ -49,5 +48,3 @@ typedef struct { Dictionary info; ClientType client_type; } RpcState; - -#endif // NVIM_MSGPACK_RPC_CHANNEL_DEFS_H diff --git a/src/nvim/msgpack_rpc/helpers.h b/src/nvim/msgpack_rpc/helpers.h index dab8a16b6b..dd2096f305 100644 --- a/src/nvim/msgpack_rpc/helpers.h +++ b/src/nvim/msgpack_rpc/helpers.h @@ -1,5 +1,4 @@ -#ifndef NVIM_MSGPACK_RPC_HELPERS_H -#define NVIM_MSGPACK_RPC_HELPERS_H +#pragma once #include #include @@ -19,5 +18,3 @@ #ifdef INCLUDE_GENERATED_DECLARATIONS # include "msgpack_rpc/helpers.h.generated.h" #endif - -#endif // NVIM_MSGPACK_RPC_HELPERS_H diff --git a/src/nvim/msgpack_rpc/server.h b/src/nvim/msgpack_rpc/server.h index 5446e40e0b..c6a240cd55 100644 --- a/src/nvim/msgpack_rpc/server.h +++ b/src/nvim/msgpack_rpc/server.h @@ -1,9 +1,7 @@ -#ifndef NVIM_MSGPACK_RPC_SERVER_H -#define NVIM_MSGPACK_RPC_SERVER_H +#pragma once #include #ifdef INCLUDE_GENERATED_DECLARATIONS # include "msgpack_rpc/server.h.generated.h" #endif -#endif // NVIM_MSGPACK_RPC_SERVER_H diff --git a/src/nvim/msgpack_rpc/unpacker.h b/src/nvim/msgpack_rpc/unpacker.h index b8b2d38d3b..72e1b04511 100644 --- a/src/nvim/msgpack_rpc/unpacker.h +++ b/src/nvim/msgpack_rpc/unpacker.h @@ -1,5 +1,4 @@ -#ifndef NVIM_MSGPACK_RPC_UNPACKER_H -#define NVIM_MSGPACK_RPC_UNPACKER_H +#pragma once #include #include @@ -49,5 +48,3 @@ struct Unpacker { #ifdef INCLUDE_GENERATED_DECLARATIONS # include "msgpack_rpc/unpacker.h.generated.h" #endif - -#endif // NVIM_MSGPACK_RPC_UNPACKER_H -- cgit