diff options
Diffstat (limited to 'src/intervals.h')
| -rw-r--r-- | src/intervals.h | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/intervals.h b/src/intervals.h index 40f32645ba0..816ea105bd7 100644 --- a/src/intervals.h +++ b/src/intervals.h | |||
| @@ -42,19 +42,19 @@ struct interval | |||
| 42 | struct interval *interval; | 42 | struct interval *interval; |
| 43 | Lisp_Object obj; | 43 | Lisp_Object obj; |
| 44 | } up; | 44 | } up; |
| 45 | unsigned int up_obj : 1; | 45 | bool_bf up_obj : 1; |
| 46 | 46 | ||
| 47 | unsigned gcmarkbit : 1; | 47 | bool_bf gcmarkbit : 1; |
| 48 | 48 | ||
| 49 | /* The remaining components are `properties' of the interval. | 49 | /* The remaining components are `properties' of the interval. |
| 50 | The first four are duplicates for things which can be on the list, | 50 | The first four are duplicates for things which can be on the list, |
| 51 | for purposes of speed. */ | 51 | for purposes of speed. */ |
| 52 | 52 | ||
| 53 | unsigned int write_protect : 1; /* Non-zero means can't modify. */ | 53 | bool_bf write_protect : 1; /* True means can't modify. */ |
| 54 | unsigned int visible : 1; /* Zero means don't display. */ | 54 | bool_bf visible : 1; /* False means don't display. */ |
| 55 | unsigned int front_sticky : 1; /* Non-zero means text inserted just | 55 | bool_bf front_sticky : 1; /* True means text inserted just |
| 56 | before this interval goes into it. */ | 56 | before this interval goes into it. */ |
| 57 | unsigned int rear_sticky : 1; /* Likewise for just after it. */ | 57 | bool_bf rear_sticky : 1; /* Likewise for just after it. */ |
| 58 | Lisp_Object plist; /* Other properties. */ | 58 | Lisp_Object plist; /* Other properties. */ |
| 59 | }; | 59 | }; |
| 60 | 60 | ||
| @@ -116,7 +116,7 @@ struct interval | |||
| 116 | 116 | ||
| 117 | /* Test what type of parent we have. Three possibilities: another | 117 | /* Test what type of parent we have. Three possibilities: another |
| 118 | interval, a buffer or string object, or NULL. */ | 118 | interval, a buffer or string object, or NULL. */ |
| 119 | #define INTERVAL_HAS_PARENT(i) ((i)->up_obj == 0 && (i)->up.interval != 0) | 119 | #define INTERVAL_HAS_PARENT(i) (! (i)->up_obj && (i)->up.interval != 0) |
| 120 | #define INTERVAL_HAS_OBJECT(i) ((i)->up_obj) | 120 | #define INTERVAL_HAS_OBJECT(i) ((i)->up_obj) |
| 121 | 121 | ||
| 122 | /* Use these macros to get parent of an interval. | 122 | /* Use these macros to get parent of an interval. |
| @@ -126,9 +126,9 @@ struct interval | |||
| 126 | progress. */ | 126 | progress. */ |
| 127 | 127 | ||
| 128 | #define INTERVAL_PARENT(i) \ | 128 | #define INTERVAL_PARENT(i) \ |
| 129 | (eassert ((i) != 0 && (i)->up_obj == 0), (i)->up.interval) | 129 | (eassert ((i) != 0 && ! (i)->up_obj), (i)->up.interval) |
| 130 | 130 | ||
| 131 | #define GET_INTERVAL_OBJECT(d,s) (eassert ((s)->up_obj == 1), (d) = (s)->up.obj) | 131 | #define GET_INTERVAL_OBJECT(d,s) (eassert ((s)->up_obj), (d) = (s)->up.obj) |
| 132 | 132 | ||
| 133 | /* Use these functions to set Lisp_Object | 133 | /* Use these functions to set Lisp_Object |
| 134 | or pointer slots of struct interval. */ | 134 | or pointer slots of struct interval. */ |
| @@ -136,7 +136,7 @@ struct interval | |||
| 136 | INLINE void | 136 | INLINE void |
| 137 | set_interval_parent (INTERVAL i, INTERVAL parent) | 137 | set_interval_parent (INTERVAL i, INTERVAL parent) |
| 138 | { | 138 | { |
| 139 | i->up_obj = 0; | 139 | i->up_obj = false; |
| 140 | i->up.interval = parent; | 140 | i->up.interval = parent; |
| 141 | } | 141 | } |
| 142 | 142 | ||
| @@ -154,33 +154,33 @@ set_interval_plist (INTERVAL i, Lisp_Object plist) | |||
| 154 | 154 | ||
| 155 | /* Reset this interval to its vanilla, or no-property state. */ | 155 | /* Reset this interval to its vanilla, or no-property state. */ |
| 156 | #define RESET_INTERVAL(i) \ | 156 | #define RESET_INTERVAL(i) \ |
| 157 | { \ | 157 | do { \ |
| 158 | (i)->total_length = (i)->position = 0; \ | 158 | (i)->total_length = (i)->position = 0; \ |
| 159 | (i)->left = (i)->right = NULL; \ | 159 | (i)->left = (i)->right = NULL; \ |
| 160 | set_interval_parent (i, NULL); \ | 160 | set_interval_parent (i, NULL); \ |
| 161 | (i)->write_protect = 0; \ | 161 | (i)->write_protect = false; \ |
| 162 | (i)->visible = 0; \ | 162 | (i)->visible = false; \ |
| 163 | (i)->front_sticky = (i)->rear_sticky = 0; \ | 163 | (i)->front_sticky = (i)->rear_sticky = false; \ |
| 164 | set_interval_plist (i, Qnil); \ | 164 | set_interval_plist (i, Qnil); \ |
| 165 | } | 165 | } while (false) |
| 166 | 166 | ||
| 167 | /* Copy the cached property values of interval FROM to interval TO. */ | 167 | /* Copy the cached property values of interval FROM to interval TO. */ |
| 168 | #define COPY_INTERVAL_CACHE(from,to) \ | 168 | #define COPY_INTERVAL_CACHE(from,to) \ |
| 169 | { \ | 169 | do { \ |
| 170 | (to)->write_protect = (from)->write_protect; \ | 170 | (to)->write_protect = (from)->write_protect; \ |
| 171 | (to)->visible = (from)->visible; \ | 171 | (to)->visible = (from)->visible; \ |
| 172 | (to)->front_sticky = (from)->front_sticky; \ | 172 | (to)->front_sticky = (from)->front_sticky; \ |
| 173 | (to)->rear_sticky = (from)->rear_sticky; \ | 173 | (to)->rear_sticky = (from)->rear_sticky; \ |
| 174 | } | 174 | } while (false) |
| 175 | 175 | ||
| 176 | /* Copy only the set bits of FROM's cache. */ | 176 | /* Copy only the set bits of FROM's cache. */ |
| 177 | #define MERGE_INTERVAL_CACHE(from,to) \ | 177 | #define MERGE_INTERVAL_CACHE(from,to) \ |
| 178 | { \ | 178 | do { \ |
| 179 | if ((from)->write_protect) (to)->write_protect = 1; \ | 179 | if ((from)->write_protect) (to)->write_protect = true; \ |
| 180 | if ((from)->visible) (to)->visible = 1; \ | 180 | if ((from)->visible) (to)->visible = true; \ |
| 181 | if ((from)->front_sticky) (to)->front_sticky = 1; \ | 181 | if ((from)->front_sticky) (to)->front_sticky = true; \ |
| 182 | if ((from)->rear_sticky) (to)->rear_sticky = 1; \ | 182 | if ((from)->rear_sticky) (to)->rear_sticky = true; \ |
| 183 | } | 183 | } while (false) |
| 184 | 184 | ||
| 185 | /* Is this interval visible? Replace later with cache access. */ | 185 | /* Is this interval visible? Replace later with cache access. */ |
| 186 | #define INTERVAL_VISIBLE_P(i) \ | 186 | #define INTERVAL_VISIBLE_P(i) \ |
| @@ -198,7 +198,7 @@ set_interval_plist (INTERVAL i, Lisp_Object plist) | |||
| 198 | should stick to it. Now we have Vtext_property_default_nonsticky, | 198 | should stick to it. Now we have Vtext_property_default_nonsticky, |
| 199 | so these macros are unreliable now and never used. */ | 199 | so these macros are unreliable now and never used. */ |
| 200 | 200 | ||
| 201 | #if 0 | 201 | #if false |
| 202 | #define FRONT_STICKY_P(i) \ | 202 | #define FRONT_STICKY_P(i) \ |
| 203 | (i && ! NILP (textget ((i)->plist, Qfront_sticky))) | 203 | (i && ! NILP (textget ((i)->plist, Qfront_sticky))) |
| 204 | #define END_NONSTICKY_P(i) \ | 204 | #define END_NONSTICKY_P(i) \ |