diff options
Diffstat (limited to 'src/intervals.h')
-rw-r--r-- | src/intervals.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/intervals.h b/src/intervals.h index db91b3f21a0..7dec6e5c765 100644 --- a/src/intervals.h +++ b/src/intervals.h @@ -14,7 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ +along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #ifndef EMACS_INTERVALS_H #define EMACS_INTERVALS_H @@ -85,10 +85,10 @@ struct interval #define LEAF_INTERVAL_P(i) ((i)->left == NULL && (i)->right == NULL) /* True if this interval has no parent and is therefore the root. */ -#define ROOT_INTERVAL_P(i) (NULL_PARENT (i)) +#define ROOT_INTERVAL_P(i) NULL_PARENT (i) /* True if this interval is the only interval in the interval tree. */ -#define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P ((i)) && LEAF_INTERVAL_P ((i))) +#define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P (i) && LEAF_INTERVAL_P (i)) /* True if this interval has both left and right children. */ #define BOTH_KIDS_P(i) ((i)->left != NULL && (i)->right != NULL) @@ -98,13 +98,13 @@ struct interval #define TOTAL_LENGTH(i) ((i) == NULL ? 0 : (i)->total_length) /* The size of text represented by this interval alone. */ -#define LENGTH(i) ((i) == NULL ? 0 : (TOTAL_LENGTH ((i)) \ - - TOTAL_LENGTH ((i)->right) \ - - TOTAL_LENGTH ((i)->left))) +#define LENGTH(i) ((i)->total_length \ + - TOTAL_LENGTH ((i)->right) \ + - TOTAL_LENGTH ((i)->left)) /* The position of the character just past the end of I. Note that the position cache i->position must be valid for this to work. */ -#define INTERVAL_LAST_POS(i) ((i)->position + LENGTH ((i))) +#define INTERVAL_LAST_POS(i) ((i)->position + LENGTH (i)) /* The total size of the left subtree of this interval. */ #define LEFT_TOTAL_LENGTH(i) ((i)->left ? (i)->left->total_length : 0) @@ -242,8 +242,7 @@ extern void traverse_intervals (INTERVAL, ptrdiff_t, void (*) (INTERVAL, Lisp_Object), Lisp_Object); extern void traverse_intervals_noorder (INTERVAL, - void (*) (INTERVAL, Lisp_Object), - Lisp_Object); + void (*) (INTERVAL, void *), void *); extern INTERVAL split_interval_right (INTERVAL, ptrdiff_t); extern INTERVAL split_interval_left (INTERVAL, ptrdiff_t); extern INTERVAL find_interval (INTERVAL, ptrdiff_t); |