comparison src/intervals.h @ 10112:3fc246695491

(INTERVAL_LAST_POS): Don't subtract 1 here.
author Richard M. Stallman <rms@gnu.org>
date Sun, 04 Dec 1994 21:06:42 +0000
parents d67be35351e5
children 66bf8ed1727b
comparison
equal deleted inserted replaced
10111:add3c6d21876 10112:3fc246695491
78 /* The size of text represented by this interval alone. */ 78 /* The size of text represented by this interval alone. */
79 #define LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (TOTAL_LENGTH ((i)) \ 79 #define LENGTH(i) ((i) == NULL_INTERVAL ? 0 : (TOTAL_LENGTH ((i)) \
80 - TOTAL_LENGTH ((i)->right) \ 80 - TOTAL_LENGTH ((i)->right) \
81 - TOTAL_LENGTH ((i)->left))) 81 - TOTAL_LENGTH ((i)->left)))
82 82
83 /* The absolute index of the last character belonging to I. Note that 83 /* The position of the character just past the end of I. Note that
84 the position cache i->position must be valid for this to work. */ 84 the position cache i->position must be valid for this to work. */
85 #define INTERVAL_LAST_POS(i) ((i)->position + LENGTH ((i)) - 1) 85 #define INTERVAL_LAST_POS(i) ((i)->position + LENGTH ((i)))
86 86
87 /* The total size of the left subtree of this interval. */ 87 /* The total size of the left subtree of this interval. */
88 #define LEFT_TOTAL_LENGTH(i) ((i)->left ? (i)->left->total_length : 0) 88 #define LEFT_TOTAL_LENGTH(i) ((i)->left ? (i)->left->total_length : 0)
89 89
90 /* The total size of the right subtree of this interval. */ 90 /* The total size of the right subtree of this interval. */