From 62774e43564b166d6907c7abc2e3431a65bd5596 Mon Sep 17 00:00:00 2001 From: Eiichi NISHINA Date: Sun, 12 Feb 2017 02:10:53 +0900 Subject: ci: Check that `#include "*.h"` works as a single include Lesser form of include-what-you-use: at least guarantees that header file did not forget to include something through some other included file. Activate run_single_includes_tests on CI. Fix some IWYU violations. References #5321 --- src/nvim/mark.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/mark.h') diff --git a/src/nvim/mark.h b/src/nvim/mark.h index aff6e7273a..efba9708db 100644 --- a/src/nvim/mark.h +++ b/src/nvim/mark.h @@ -29,7 +29,7 @@ /// Clear given fmark #define CLEAR_FMARK(fmarkp_) \ - RESET_FMARK(fmarkp_, ((pos_T) {0, 0, 0}), 0) + RESET_FMARK(fmarkp_, ((pos_T) { 0, 0, 0 }), 0) /// Set given extended mark (regular mark + file name) #define SET_XFMARK(xfmarkp_, mark_, fnum_, fname_) \ -- cgit From cd0a436622d0eeafcbc79e0a6e53088b881ab5b1 Mon Sep 17 00:00:00 2001 From: dedmass Date: Thu, 6 Apr 2017 17:06:35 -0400 Subject: refactor/single-include Closes #6463 refactor/single-include: file_search.h Closes #6455 refactor/single-include: hardcopy.h Closes #6457 refactor/single-include: if_cscope.h Closes #6458 refactor/single-include: mark.h Closes #6461 refactor/single-include: mbyte.h Closes #6462 refactor/single-include: memline.h Closes #6464 refactor/single-include: menu.h Closes #6468 refactor/single-include: ops.h Closes #6470 --- src/nvim/mark.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/mark.h') diff --git a/src/nvim/mark.h b/src/nvim/mark.h index efba9708db..c22a102926 100644 --- a/src/nvim/mark.h +++ b/src/nvim/mark.h @@ -8,6 +8,7 @@ #include "nvim/memory.h" #include "nvim/pos.h" #include "nvim/os/time.h" +#include "nvim/ex_cmds_defs.h" // for exarg_T /// Set fmark using given value #define SET_FMARK(fmarkp_, mark_, fnum_) \ -- cgit From 2d72d85b23761383ac7838faed2f7b53bdce8817 Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Carvalho Date: Tue, 11 Apr 2017 22:44:48 +0200 Subject: refactor: pos_T macros to functions (#6496) --- src/nvim/mark.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/nvim/mark.h') diff --git a/src/nvim/mark.h b/src/nvim/mark.h index c22a102926..a356c1f398 100644 --- a/src/nvim/mark.h +++ b/src/nvim/mark.h @@ -4,6 +4,7 @@ #include "nvim/macros.h" #include "nvim/ascii.h" #include "nvim/buffer_defs.h" +#include "nvim/func_attr.h" #include "nvim/mark_defs.h" #include "nvim/memory.h" #include "nvim/pos.h" @@ -75,6 +76,45 @@ static inline int mark_local_index(const char name) : -1)))); } +static inline bool lt(pos_T, pos_T) REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE; +static inline bool equalpos(pos_T, pos_T) + REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE; +static inline bool ltoreq(pos_T, pos_T) + REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE; +static inline void clearpos(pos_T *) REAL_FATTR_ALWAYS_INLINE; + +/// Return true if position a is before (less than) position b. +static inline bool lt(pos_T a, pos_T b) +{ + if (a.lnum != b.lnum) { + return a.lnum < b.lnum; + } else if (a.col != b.col) { + return a.col < b.col; + } else { + return a.coladd < b.coladd; + } +} + +/// Return true if position a and b are equal. +static inline bool equalpos(pos_T a, pos_T b) +{ + return (a.lnum == b.lnum) && (a.col == b.col) && (a.coladd == b.coladd); +} + +/// Return true if position a is less than or equal to b. +static inline bool ltoreq(pos_T a, pos_T b) +{ + return lt(a, b) || equalpos(a, b); +} + +/// Clear the pos_T structure pointed to by a. +static inline void clearpos(pos_T *a) +{ + a->lnum = 0; + a->col = 0; + a->coladd = 0; +} + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "mark.h.generated.h" #endif -- cgit From 3f553ac0b9b3866f1254e669eb0c1c019c789a60 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Fri, 2 Jun 2017 15:42:37 +0200 Subject: lint: fix indentation of FUNC_ATTR lines --- src/nvim/mark.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/mark.h') diff --git a/src/nvim/mark.h b/src/nvim/mark.h index a356c1f398..ed4e47907b 100644 --- a/src/nvim/mark.h +++ b/src/nvim/mark.h @@ -81,7 +81,8 @@ static inline bool equalpos(pos_T, pos_T) REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE; static inline bool ltoreq(pos_T, pos_T) REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE; -static inline void clearpos(pos_T *) REAL_FATTR_ALWAYS_INLINE; +static inline void clearpos(pos_T *) + REAL_FATTR_ALWAYS_INLINE; /// Return true if position a is before (less than) position b. static inline bool lt(pos_T a, pos_T b) -- cgit