Mercurial > emacs
comparison src/intervals.h @ 50470:c7a0b787faef
(CHECK_TOTAL_LENGTH): New macro.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 06 Apr 2003 20:29:13 +0000 |
parents | ce84fbc6175f |
children | 4370ce3fabb3 |
comparison
equal
deleted
inserted
replaced
50469:0bdc2fd19631 | 50470:c7a0b787faef |
---|---|
122 | 122 |
123 /* Get the parent interval, if any, otherwise a null pointer. Useful | 123 /* Get the parent interval, if any, otherwise a null pointer. Useful |
124 for walking up to the root in a "for" loop; use this to get the | 124 for walking up to the root in a "for" loop; use this to get the |
125 "next" value, and test the result to see if it's NULL_INTERVAL. */ | 125 "next" value, and test the result to see if it's NULL_INTERVAL. */ |
126 #define INTERVAL_PARENT_OR_NULL(i) (INTERVAL_HAS_PARENT (i) ? INTERVAL_PARENT (i) : 0) | 126 #define INTERVAL_PARENT_OR_NULL(i) (INTERVAL_HAS_PARENT (i) ? INTERVAL_PARENT (i) : 0) |
127 | |
128 /* Abort if interval I's size is negative. */ | |
129 #define CHECK_TOTAL_LENGTH(i) \ | |
130 if ((int) (i)->total_length < 0) abort (); else | |
127 | 131 |
128 /* Reset this interval to its vanilla, or no-property state. */ | 132 /* Reset this interval to its vanilla, or no-property state. */ |
129 #define RESET_INTERVAL(i) \ | 133 #define RESET_INTERVAL(i) \ |
130 { \ | 134 { \ |
131 (i)->total_length = (i)->position = 0; \ | 135 (i)->total_length = (i)->position = 0; \ |