gbranden pushed a commit to branch master
in repository groff.
commit e9c51070a9042cf76a6a581cca0534d5238cb593
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Apr 16 08:02:09 2025 -0500
src/roff/troff/input.cpp: Tidy `grostream` defn.
* src/roff/troff/input.cpp: Tidy up `grostream` type definition.
(class grostream): Convert (back) from this...
(struct grostream): ...to this, since all its members are public
anyway. Also drop `public` access specifier from `object` base class
since we require no visibility of its members. Also mark member
variables as `const` since they should be immutable after
construction.
---
ChangeLog | 10 ++++++++++
src/roff/troff/input.cpp | 9 ++++-----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 205a20e08..cdc19b7dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2025-04-16 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp: Tidy up `grostream` type definition.
+ (class grostream): Convert (back) from this...
+ (struct grostream): ...to this, since all its members are public
+ anyway. Also drop `public` access specifier from `object` base
+ class since we require no visibility of its members. Also mark
+ member variables as `const` since they should be immutable after
+ construction.
+
2025-04-13 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp: Refactor `grostream` class for
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index eb015a5b3..d92e746ac 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -7605,11 +7605,10 @@ void terminal_continue()
do_terminal(0, 1);
}
-class grostream : public object {
-public:
- symbol filename;
- symbol mode;
- FILE *file;
+struct grostream : object {
+ const symbol filename;
+ const symbol mode;
+ FILE * const file;
grostream(const char *fn, symbol m, FILE *fp);
~grostream();
};
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit