diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/intervals.h | 12 |
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) |