2
2
* File: elst.h (Formerly elist.h)
3
3
* Description: Embedded list module include file.
4
4
* Author: Phil Cheatle
5
- * Created: Mon Jan 07 08:35:34 GMT 1991
6
5
*
7
6
* (C) Copyright 1991, Hewlett-Packard Ltd.
8
7
** Licensed under the Apache License, Version 2.0 (the "License");
21
20
#define ELST_H
22
21
23
22
#include < cstdio>
24
- #include " host.h"
25
23
#include " serialis.h"
26
24
#include " lsterr.h"
27
25
@@ -307,9 +305,9 @@ inline void ELIST_ITERATOR::set_to_list( //change list
307
305
current = list->First ();
308
306
next = current ? current->next : nullptr ;
309
307
cycle_pt = nullptr ; // await explicit set
310
- started_cycling = FALSE ;
311
- ex_current_was_last = FALSE ;
312
- ex_current_was_cycle_pt = FALSE ;
308
+ started_cycling = false ;
309
+ ex_current_was_last = false ;
310
+ ex_current_was_cycle_pt = false ;
313
311
}
314
312
315
313
@@ -392,7 +390,7 @@ inline void ELIST_ITERATOR::add_after_stay_put( // element to add
392
390
new_element->next = new_element;
393
391
list->last = new_element;
394
392
prev = next = new_element;
395
- ex_current_was_last = FALSE ;
393
+ ex_current_was_last = false ;
396
394
current = nullptr ;
397
395
}
398
396
else {
@@ -409,7 +407,7 @@ inline void ELIST_ITERATOR::add_after_stay_put( // element to add
409
407
prev->next = new_element;
410
408
if (ex_current_was_last) {
411
409
list->last = new_element;
412
- ex_current_was_last = FALSE ;
410
+ ex_current_was_last = false ;
413
411
}
414
412
}
415
413
next = new_element;
@@ -481,7 +479,7 @@ inline void ELIST_ITERATOR::add_before_stay_put( // element to add
481
479
new_element->next = new_element;
482
480
list->last = new_element;
483
481
prev = next = new_element;
484
- ex_current_was_last = TRUE ;
482
+ ex_current_was_last = true ;
485
483
current = nullptr ;
486
484
}
487
485
else {
@@ -522,7 +520,7 @@ inline void ELIST_ITERATOR::add_list_after(ELIST *list_to_add) {
522
520
list->last = list_to_add->last ;
523
521
prev = list->last ;
524
522
next = list->First ();
525
- ex_current_was_last = TRUE ;
523
+ ex_current_was_last = true ;
526
524
current = nullptr ;
527
525
}
528
526
else {
@@ -537,7 +535,7 @@ inline void ELIST_ITERATOR::add_list_after(ELIST *list_to_add) {
537
535
prev->next = list_to_add->First ();
538
536
if (ex_current_was_last) {
539
537
list->last = list_to_add->last ;
540
- ex_current_was_last = FALSE ;
538
+ ex_current_was_last = false ;
541
539
}
542
540
list_to_add->last ->next = next;
543
541
next = prev->next ;
@@ -571,7 +569,7 @@ inline void ELIST_ITERATOR::add_list_before(ELIST *list_to_add) {
571
569
prev = list->last ;
572
570
current = list->First ();
573
571
next = current->next ;
574
- ex_current_was_last = FALSE ;
572
+ ex_current_was_last = false ;
575
573
}
576
574
else {
577
575
prev->next = list_to_add->First ();
@@ -620,15 +618,11 @@ inline ELIST_LINK *ELIST_ITERATOR::extract() {
620
618
} else {
621
619
prev->next = next; // remove from list
622
620
623
- if (current == list->last ) {
624
- list->last = prev;
625
- ex_current_was_last = TRUE ;
626
- } else {
627
- ex_current_was_last = FALSE ;
628
- }
621
+ ex_current_was_last = (current == list->last );
622
+ if (ex_current_was_last) list->last = prev;
629
623
}
630
624
// Always set ex_current_was_cycle_pt so an add/forward will work in a loop.
631
- ex_current_was_cycle_pt = (current == cycle_pt) ? TRUE : FALSE ;
625
+ ex_current_was_cycle_pt = (current == cycle_pt);
632
626
extracted_link = current;
633
627
extracted_link->next = nullptr ; // for safety
634
628
current = nullptr ;
@@ -676,8 +670,8 @@ inline void ELIST_ITERATOR::mark_cycle_pt() {
676
670
if (current)
677
671
cycle_pt = current;
678
672
else
679
- ex_current_was_cycle_pt = TRUE ;
680
- started_cycling = FALSE ;
673
+ ex_current_was_cycle_pt = true ;
674
+ started_cycling = false ;
681
675
}
682
676
683
677
0 commit comments