diff options
| author | Michael R. Mauger | 2017-07-24 22:15:04 -0400 |
|---|---|---|
| committer | Michael R. Mauger | 2017-07-24 22:15:04 -0400 |
| commit | df1a71272e5cdd10b511e2ffd702ca50ddd8a773 (patch) | |
| tree | 9b9ac725394ee80891e2bff57b6407d0e491e71a /src/intervals.c | |
| parent | eb27fc4d49e8c914cd0e6a8a2d02159601542141 (diff) | |
| parent | 32daa3cb54523006c88717cbeac87964cd687a1b (diff) | |
| download | emacs-df1a71272e5cdd10b511e2ffd702ca50ddd8a773.tar.gz emacs-df1a71272e5cdd10b511e2ffd702ca50ddd8a773.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'src/intervals.c')
| -rw-r--r-- | src/intervals.c | 66 |
1 files changed, 2 insertions, 64 deletions
diff --git a/src/intervals.c b/src/intervals.c index d17d80ac865..0089ecb8dde 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -224,7 +224,8 @@ intervals_equal (INTERVAL i0, INTERVAL i1) | |||
| 224 | Pass FUNCTION two args: an interval, and ARG. */ | 224 | Pass FUNCTION two args: an interval, and ARG. */ |
| 225 | 225 | ||
| 226 | void | 226 | void |
| 227 | traverse_intervals_noorder (INTERVAL tree, void (*function) (INTERVAL, Lisp_Object), Lisp_Object arg) | 227 | traverse_intervals_noorder (INTERVAL tree, void (*function) (INTERVAL, void *), |
| 228 | void *arg) | ||
| 228 | { | 229 | { |
| 229 | /* Minimize stack usage. */ | 230 | /* Minimize stack usage. */ |
| 230 | while (tree) | 231 | while (tree) |
| @@ -257,69 +258,6 @@ traverse_intervals (INTERVAL tree, ptrdiff_t position, | |||
| 257 | } | 258 | } |
| 258 | } | 259 | } |
| 259 | 260 | ||
| 260 | #if 0 | ||
| 261 | |||
| 262 | static int icount; | ||
| 263 | static int idepth; | ||
| 264 | static int zero_length; | ||
| 265 | |||
| 266 | /* These functions are temporary, for debugging purposes only. */ | ||
| 267 | |||
| 268 | INTERVAL search_interval, found_interval; | ||
| 269 | |||
| 270 | void | ||
| 271 | check_for_interval (INTERVAL i) | ||
| 272 | { | ||
| 273 | if (i == search_interval) | ||
| 274 | { | ||
| 275 | found_interval = i; | ||
| 276 | icount++; | ||
| 277 | } | ||
| 278 | } | ||
| 279 | |||
| 280 | INTERVAL | ||
| 281 | search_for_interval (INTERVAL i, INTERVAL tree) | ||
| 282 | { | ||
| 283 | icount = 0; | ||
| 284 | search_interval = i; | ||
| 285 | found_interval = NULL; | ||
| 286 | traverse_intervals_noorder (tree, &check_for_interval, Qnil); | ||
| 287 | return found_interval; | ||
| 288 | } | ||
| 289 | |||
| 290 | static void | ||
| 291 | inc_interval_count (INTERVAL i) | ||
| 292 | { | ||
| 293 | icount++; | ||
| 294 | if (LENGTH (i) == 0) | ||
| 295 | zero_length++; | ||
| 296 | if (depth > idepth) | ||
| 297 | idepth = depth; | ||
| 298 | } | ||
| 299 | |||
| 300 | int | ||
| 301 | count_intervals (INTERVAL i) | ||
| 302 | { | ||
| 303 | icount = 0; | ||
| 304 | idepth = 0; | ||
| 305 | zero_length = 0; | ||
| 306 | traverse_intervals_noorder (i, &inc_interval_count, Qnil); | ||
| 307 | |||
| 308 | return icount; | ||
| 309 | } | ||
| 310 | |||
| 311 | static INTERVAL | ||
| 312 | root_interval (INTERVAL interval) | ||
| 313 | { | ||
| 314 | register INTERVAL i = interval; | ||
| 315 | |||
| 316 | while (! ROOT_INTERVAL_P (i)) | ||
| 317 | i = INTERVAL_PARENT (i); | ||
| 318 | |||
| 319 | return i; | ||
| 320 | } | ||
| 321 | #endif | ||
| 322 | |||
| 323 | /* Assuming that a left child exists, perform the following operation: | 261 | /* Assuming that a left child exists, perform the following operation: |
| 324 | 262 | ||
| 325 | A B | 263 | A B |