[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 27/48: [troff]: Boolify env.cpp (18/25).
From: |
G. Branden Robinson |
Subject: |
[groff] 27/48: [troff]: Boolify env.cpp (18/25). |
Date: |
Sun, 28 Apr 2024 23:06:31 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit b191eb6287bea5cb5694d3c580945346bf6393c7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Apr 27 04:44:24 2024 -0500
[troff]: Boolify env.cpp (18/25).
[troff]: Boolify more `environment` class member variables, member
function parameters, and local variables.
* src/roff/troff/env.h (class environment): Demote member variable
`composite` from `int` to `bool`.
* src/roff/troff/env.cpp (environment::environment, environment::copy):
* src/roff/troff/env.h (environment::set_composite): Assign Boolean
literals to it.
* src/roff/troff/env.h (environment::is_composite): Return a `bool`, not
an `int`.
---
ChangeLog | 9 +++++++++
src/roff/troff/env.cpp | 6 +++---
src/roff/troff/env.h | 6 +++---
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1af89c441..54c95513e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -144,6 +144,15 @@
* src/roff/troff/input.cpp (input_stack::push): Assign Boolean
literals to it.
+ * src/roff/troff/env.h (class environment): Demote member
+ variable `composite` from `int` to `bool`.
+ * src/roff/troff/env.cpp (environment::environment)
+ (environment::copy):
+ * src/roff/troff/env.h (environment::set_composite): Assign
+ Boolean literals to it.
+ * src/roff/troff/env.h (environment::is_composite): Return a
+ `bool`, not an `int`.
+
2024-04-24 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/env.cpp (tab_stops::to_string)
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 4e9f80dd8..ec29abbdf 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -744,7 +744,7 @@ environment::environment(symbol nm)
hyphen_line_max(-1),
hyphenation_space(H0),
hyphenation_margin(H0),
- composite(0),
+ composite(false),
pending_lines(0),
#ifdef WIDOW_CONTROL
want_widow_control(false),
@@ -838,7 +838,7 @@ environment::environment(const environment *e)
hyphen_line_max(e->hyphen_line_max),
hyphenation_space(e->hyphenation_space),
hyphenation_margin(e->hyphenation_margin),
- composite(0),
+ composite(false),
pending_lines(0),
#ifdef WIDOW_CONTROL
want_widow_control(e->want_widow_control),
@@ -934,7 +934,7 @@ void environment::copy(const environment *e)
hyphen_line_count = 0;
hyphenation_space = e->hyphenation_space;
hyphenation_margin = e->hyphenation_margin;
- composite = 0;
+ composite = false;
glyph_color= e->glyph_color;
prev_glyph_color = e->prev_glyph_color;
fill_color = e->fill_color;
diff --git a/src/roff/troff/env.h b/src/roff/troff/env.h
index 2950a157c..4cae56346 100644
--- a/src/roff/troff/env.h
+++ b/src/roff/troff/env.h
@@ -217,7 +217,7 @@ class environment {
int hyphen_line_max;
hunits hyphenation_space;
hunits hyphenation_margin;
- int composite; // used for construction of composite char?
+ bool composite; // used for construction of composite character
pending_output_line *pending_lines;
#ifdef WIDOW_CONTROL
bool want_widow_control;
@@ -270,8 +270,8 @@ public:
void copy(const environment *);
int is_dummy() { return dummy; }
int is_empty();
- int is_composite() { return composite; }
- void set_composite() { composite = 1; }
+ bool is_composite() { return composite; }
+ void set_composite() { composite = true; }
vunits get_vertical_spacing(); // .v
vunits get_post_vertical_spacing(); // .pvs
int get_line_spacing(); // .L
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 27/48: [troff]: Boolify env.cpp (18/25).,
G. Branden Robinson <=