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/pos.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/pos.h') diff --git a/src/nvim/pos.h b/src/nvim/pos.h index 1b7e6273fd..98a1762a5c 100644 --- a/src/nvim/pos.h +++ b/src/nvim/pos.h @@ -1,5 +1,4 @@ -#ifndef NVIM_POS_H -#define NVIM_POS_H +#pragma once #include @@ -39,5 +38,3 @@ typedef struct { linenr_T lnum; ///< line number colnr_T col; ///< column number } lpos_T; - -#endif // NVIM_POS_H -- cgit From f4aedbae4cb1f206f5b7c6142697b71dd473059b Mon Sep 17 00:00:00 2001 From: dundargoc Date: Mon, 27 Nov 2023 18:39:38 +0100 Subject: build(IWYU): fix includes for undo_defs.h --- src/nvim/pos.h | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/nvim/pos.h (limited to 'src/nvim/pos.h') diff --git a/src/nvim/pos.h b/src/nvim/pos.h deleted file mode 100644 index 98a1762a5c..0000000000 --- a/src/nvim/pos.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include - -/// Line number type -typedef int32_t linenr_T; -/// Format used to print values which have linenr_T type -#define PRIdLINENR PRId32 - -/// Column number type -typedef int colnr_T; -/// Format used to print values which have colnr_T type -#define PRIdCOLNR "d" - -/// Maximal (invalid) line number -enum { MAXLNUM = 0x7fffffff, }; - -/// Maximal column number -/// MAXCOL used to be INT_MAX, but with 64 bit ints that results in running -/// out of memory when trying to allocate a very long line. -enum { MAXCOL = 0x7fffffff, }; - -/// Minimum line number -enum { MINLNUM = 1, }; - -/// Minimum column number -enum { MINCOL = 1, }; - -/// position in file or buffer -typedef struct { - linenr_T lnum; ///< line number - colnr_T col; ///< column number - colnr_T coladd; -} pos_T; - -/// position in file or buffer, but without coladd -typedef struct { - linenr_T lnum; ///< line number - colnr_T col; ///< column number -} lpos_T; -- cgit