aboutsummaryrefslogtreecommitdiffstats
path: root/src/intervals.h
diff options
context:
space:
mode:
authorBastien2017-07-03 09:06:29 +0200
committerBastien2017-07-03 09:06:29 +0200
commit5ca1888fe670aee7febd4d42665d7372ab2ffebc (patch)
tree1f7f8d8a7580e556fc83cf3a6aaeec567b33a090 /src/intervals.h
parent20e006ffee41062f1b551a92c24d9edc53cd0f56 (diff)
parent1b4f0a92ff3505ef9a465b9b391756e3a73a6443 (diff)
downloademacs-5ca1888fe670aee7febd4d42665d7372ab2ffebc.tar.gz
emacs-5ca1888fe670aee7febd4d42665d7372ab2ffebc.zip
Merge branch 'master' into scratch/org-mode-merge
Diffstat (limited to 'src/intervals.h')
-rw-r--r--src/intervals.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/intervals.h b/src/intervals.h
index db91b3f21a0..a0da6f37801 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -85,10 +85,10 @@ struct interval
85#define LEAF_INTERVAL_P(i) ((i)->left == NULL && (i)->right == NULL) 85#define LEAF_INTERVAL_P(i) ((i)->left == NULL && (i)->right == NULL)
86 86
87/* True if this interval has no parent and is therefore the root. */ 87/* True if this interval has no parent and is therefore the root. */
88#define ROOT_INTERVAL_P(i) (NULL_PARENT (i)) 88#define ROOT_INTERVAL_P(i) NULL_PARENT (i)
89 89
90/* True if this interval is the only interval in the interval tree. */ 90/* True if this interval is the only interval in the interval tree. */
91#define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P ((i)) && LEAF_INTERVAL_P ((i))) 91#define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P (i) && LEAF_INTERVAL_P (i))
92 92
93/* True if this interval has both left and right children. */ 93/* True if this interval has both left and right children. */
94#define BOTH_KIDS_P(i) ((i)->left != NULL && (i)->right != NULL) 94#define BOTH_KIDS_P(i) ((i)->left != NULL && (i)->right != NULL)
@@ -98,13 +98,13 @@ struct interval
98#define TOTAL_LENGTH(i) ((i) == NULL ? 0 : (i)->total_length) 98#define TOTAL_LENGTH(i) ((i) == NULL ? 0 : (i)->total_length)
99 99
100/* The size of text represented by this interval alone. */ 100/* The size of text represented by this interval alone. */
101#define LENGTH(i) ((i) == NULL ? 0 : (TOTAL_LENGTH ((i)) \ 101#define LENGTH(i) ((i)->total_length \
102 - TOTAL_LENGTH ((i)->right) \ 102 - TOTAL_LENGTH ((i)->right) \
103 - TOTAL_LENGTH ((i)->left))) 103 - TOTAL_LENGTH ((i)->left))
104 104
105/* The position of the character just past the end of I. Note that 105/* The position of the character just past the end of I. Note that
106 the position cache i->position must be valid for this to work. */ 106 the position cache i->position must be valid for this to work. */
107#define INTERVAL_LAST_POS(i) ((i)->position + LENGTH ((i))) 107#define INTERVAL_LAST_POS(i) ((i)->position + LENGTH (i))
108 108
109/* The total size of the left subtree of this interval. */ 109/* The total size of the left subtree of this interval. */
110#define LEFT_TOTAL_LENGTH(i) ((i)->left ? (i)->left->total_length : 0) 110#define LEFT_TOTAL_LENGTH(i) ((i)->left ? (i)->left->total_length : 0)