Skip to content

Commit 4e0c726

Browse files
committed
ccutil: replace TRUE, FALSE by true, false
Signed-off-by: Stefan Weil <[email protected]>
1 parent da0c14a commit 4e0c726

File tree

6 files changed

+28
-42
lines changed

6 files changed

+28
-42
lines changed

src/ccutil/clst.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* File: clst.cpp (Formerly clist.c)
33
* Description: CONS cell list handling code which is not in the include file.
44
* Author: Phil Cheatle
5-
* Created: Mon Jan 28 08:33:13 GMT 1991
65
*
76
* (C) Copyright 1991, Hewlett-Packard Ltd.
87
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -253,7 +252,7 @@ void *CLIST_ITERATOR::forward() {
253252
if (current) { //not removed so
254253
//set previous
255254
prev = current;
256-
started_cycling = TRUE;
255+
started_cycling = true;
257256
// In case next is deleted by another iterator, get next from current.
258257
current = current->next;
259258
} else {

src/ccutil/clst.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* File: clst.h (Formerly clist.h)
33
* Description: CONS cell list module include file.
44
* Author: Phil Cheatle
5-
* Created: Mon Jan 28 08:33:13 GMT 1991
65
*
76
* (C) Copyright 1991, Hewlett-Packard Ltd.
87
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +20,6 @@
2120
#define CLST_H
2221

2322
#include <cstdio>
24-
#include "host.h"
2523
#include "serialis.h"
2624
#include "lsterr.h"
2725

@@ -639,8 +637,8 @@ inline void CLIST_ITERATOR::mark_cycle_pt() {
639637
if (current)
640638
cycle_pt = current;
641639
else
642-
ex_current_was_cycle_pt = TRUE;
643-
started_cycling = FALSE;
640+
ex_current_was_cycle_pt = true;
641+
started_cycling = false;
644642
}
645643

646644
/***********************************************************************

src/ccutil/elst.cpp

+7-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* File: elst.cpp (Formerly elist.c)
33
* Description: Embedded list handling code which is not in the include file.
44
* Author: Phil Cheatle
5-
* Created: Fri Jan 04 13:55:49 GMT 1991
65
*
76
* (C) Copyright 1991, Hewlett-Packard Ltd.
87
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -202,7 +201,7 @@ ELIST_LINK *ELIST_ITERATOR::forward() {
202201
if (current) { //not removed so
203202
//set previous
204203
prev = current;
205-
started_cycling = TRUE;
204+
started_cycling = true;
206205
// In case next is deleted by another iterator, get next from current.
207206
current = current->next;
208207
} else {
@@ -415,9 +414,9 @@ ELIST_LINK *ELIST_ITERATOR::extract_sublist( //from
415414
nullptr);
416415
#endif
417416

418-
ex_current_was_last = other_it->ex_current_was_last = FALSE;
419-
ex_current_was_cycle_pt = FALSE;
420-
other_it->ex_current_was_cycle_pt = FALSE;
417+
ex_current_was_last = other_it->ex_current_was_last = false;
418+
ex_current_was_cycle_pt = false;
419+
other_it->ex_current_was_cycle_pt = false;
421420

422421
temp_it.mark_cycle_pt ();
423422
do { //walk sublist
@@ -426,14 +425,14 @@ ELIST_LINK *ELIST_ITERATOR::extract_sublist( //from
426425

427426
if (temp_it.at_last ()) {
428427
list->last = prev;
429-
ex_current_was_last = other_it->ex_current_was_last = TRUE;
428+
ex_current_was_last = other_it->ex_current_was_last = true;
430429
}
431430

432431
if (temp_it.current == cycle_pt)
433-
ex_current_was_cycle_pt = TRUE;
432+
ex_current_was_cycle_pt = true;
434433

435434
if (temp_it.current == other_it->cycle_pt)
436-
other_it->ex_current_was_cycle_pt = TRUE;
435+
other_it->ex_current_was_cycle_pt = true;
437436

438437
temp_it.forward ();
439438
}

src/ccutil/elst.h

+14-20
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* File: elst.h (Formerly elist.h)
33
* Description: Embedded list module include file.
44
* Author: Phil Cheatle
5-
* Created: Mon Jan 07 08:35:34 GMT 1991
65
*
76
* (C) Copyright 1991, Hewlett-Packard Ltd.
87
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +20,6 @@
2120
#define ELST_H
2221

2322
#include <cstdio>
24-
#include "host.h"
2523
#include "serialis.h"
2624
#include "lsterr.h"
2725

@@ -307,9 +305,9 @@ inline void ELIST_ITERATOR::set_to_list( //change list
307305
current = list->First ();
308306
next = current ? current->next : nullptr;
309307
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;
313311
}
314312

315313

@@ -392,7 +390,7 @@ inline void ELIST_ITERATOR::add_after_stay_put( // element to add
392390
new_element->next = new_element;
393391
list->last = new_element;
394392
prev = next = new_element;
395-
ex_current_was_last = FALSE;
393+
ex_current_was_last = false;
396394
current = nullptr;
397395
}
398396
else {
@@ -409,7 +407,7 @@ inline void ELIST_ITERATOR::add_after_stay_put( // element to add
409407
prev->next = new_element;
410408
if (ex_current_was_last) {
411409
list->last = new_element;
412-
ex_current_was_last = FALSE;
410+
ex_current_was_last = false;
413411
}
414412
}
415413
next = new_element;
@@ -481,7 +479,7 @@ inline void ELIST_ITERATOR::add_before_stay_put( // element to add
481479
new_element->next = new_element;
482480
list->last = new_element;
483481
prev = next = new_element;
484-
ex_current_was_last = TRUE;
482+
ex_current_was_last = true;
485483
current = nullptr;
486484
}
487485
else {
@@ -522,7 +520,7 @@ inline void ELIST_ITERATOR::add_list_after(ELIST *list_to_add) {
522520
list->last = list_to_add->last;
523521
prev = list->last;
524522
next = list->First ();
525-
ex_current_was_last = TRUE;
523+
ex_current_was_last = true;
526524
current = nullptr;
527525
}
528526
else {
@@ -537,7 +535,7 @@ inline void ELIST_ITERATOR::add_list_after(ELIST *list_to_add) {
537535
prev->next = list_to_add->First ();
538536
if (ex_current_was_last) {
539537
list->last = list_to_add->last;
540-
ex_current_was_last = FALSE;
538+
ex_current_was_last = false;
541539
}
542540
list_to_add->last->next = next;
543541
next = prev->next;
@@ -571,7 +569,7 @@ inline void ELIST_ITERATOR::add_list_before(ELIST *list_to_add) {
571569
prev = list->last;
572570
current = list->First ();
573571
next = current->next;
574-
ex_current_was_last = FALSE;
572+
ex_current_was_last = false;
575573
}
576574
else {
577575
prev->next = list_to_add->First ();
@@ -620,15 +618,11 @@ inline ELIST_LINK *ELIST_ITERATOR::extract() {
620618
} else {
621619
prev->next = next; //remove from list
622620

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;
629623
}
630624
// 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);
632626
extracted_link = current;
633627
extracted_link->next = nullptr; //for safety
634628
current = nullptr;
@@ -676,8 +670,8 @@ inline void ELIST_ITERATOR::mark_cycle_pt() {
676670
if (current)
677671
cycle_pt = current;
678672
else
679-
ex_current_was_cycle_pt = TRUE;
680-
started_cycling = FALSE;
673+
ex_current_was_cycle_pt = true;
674+
started_cycling = false;
681675
}
682676

683677

src/ccutil/elst2.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* File: elst2.cpp (Formerly elist2.c)
33
* Description: Doubly linked embedded list code not in the include file.
44
* Author: Phil Cheatle
5-
* Created: Wed Jan 23 11:04:47 GMT 1991
65
*
76
* (C) Copyright 1991, Hewlett-Packard Ltd.
87
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,7 +17,6 @@
1817
**********************************************************************/
1918

2019
#include <cstdlib>
21-
#include "host.h"
2220
#include "elst2.h"
2321

2422
/***********************************************************************
@@ -195,7 +193,7 @@ ELIST2_LINK *ELIST2_ITERATOR::forward() {
195193
if (current) { //not removed so
196194
//set previous
197195
prev = current;
198-
started_cycling = TRUE;
196+
started_cycling = true;
199197
// In case next is deleted by another iterator, get it from the current.
200198
current = current->next;
201199
}
@@ -239,7 +237,7 @@ ELIST2_LINK *ELIST2_ITERATOR::backward() {
239237
if (current) { //not removed so
240238
//set previous
241239
next = current;
242-
started_cycling = TRUE;
240+
started_cycling = true;
243241
// In case prev is deleted by another iterator, get it from current.
244242
current = current->prev;
245243
} else {

src/ccutil/elst2.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* File: elst2.h (Formerly elist2.h)
33
* Description: Double linked embedded list module include file.
44
* Author: Phil Cheatle
5-
* Created: Wed Jan 23 11:04:47 GMT 1991
65
*
76
* (C) Copyright 1991, Hewlett-Packard Ltd.
87
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +20,6 @@
2120
#define ELST2_H
2221

2322
#include <cstdio>
24-
#include "host.h"
2523
#include "serialis.h"
2624
#include "lsterr.h"
2725

@@ -682,8 +680,8 @@ inline void ELIST2_ITERATOR::mark_cycle_pt() {
682680
if (current)
683681
cycle_pt = current;
684682
else
685-
ex_current_was_cycle_pt = TRUE;
686-
started_cycling = FALSE;
683+
ex_current_was_cycle_pt = true;
684+
started_cycling = false;
687685
}
688686

689687
/***********************************************************************

0 commit comments

Comments
 (0)