refactor: pos_T macros to functions (#6496)

This commit is contained in:
Felipe Oliveira Carvalho
2017-04-11 22:44:48 +02:00
committed by Justin M. Keyes
parent 1b94852ccb
commit 2d72d85b23
8 changed files with 48 additions and 21 deletions

View File

@@ -28,25 +28,6 @@
/// @return `s, sizeof(s) - 1`
#define S_LEN(s) (s), (sizeof(s) - 1)
/*
* Position comparisons
*/
# define lt(a, b) (((a).lnum != (b).lnum) \
? (a).lnum < (b).lnum \
: (a).col != (b).col \
? (a).col < (b).col \
: (a).coladd < (b).coladd)
# define ltp(a, b) (((a)->lnum != (b)->lnum) \
? (a)->lnum < (b)->lnum \
: (a)->col != (b)->col \
? (a)->col < (b)->col \
: (a)->coladd < (b)->coladd)
# define equalpos(a, b) (((a).lnum == (b).lnum) && ((a).col == (b).col) && \
((a).coladd == (b).coladd))
# define clearpos(a) {(a)->lnum = 0; (a)->col = 0; (a)->coladd = 0; }
#define ltoreq(a, b) (lt(a, b) || equalpos(a, b))
/*
* lineempty() - return TRUE if the line is empty
*/