gbranden pushed a commit to branch master
in repository groff.
commit 00df2d6a74a5d0b766b2922611a412aae2a85c99
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Apr 16 08:37:45 2025 -0500
src/roff/troff/input.cpp: Fix code style nit.
* src/roff/troff/input.cpp (open_file, close_stream, do_write_request)
(write_macro_request): Fix code style nit, using C++-style (static)
type cast instead of C-style cast.
---
ChangeLog | 6 ++++++
src/roff/troff/input.cpp | 13 ++++++++-----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index cdc19b7dc..49f0d6dde 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-16 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp (open_file, close_stream)
+ (do_write_request, write_macro_request): Fix code style nit,
+ using C++-style (static) type cast instead of C-style cast.
+
2025-04-16 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp: Tidy up `grostream` type definition.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index d92e746ac..592a55ed4 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -7672,8 +7672,8 @@ static void open_file(bool appending)
stream_dictionary.remove(stream);
}
else {
- grostream *oldgrost
- = (grostream *)stream_dictionary.lookup(stream);
+ grostream *oldgrost = static_cast<grostream *>(stream_dictionary
+ .lookup(stream));
if (oldgrost != 0 /* nullptr */) {
FILE *oldfp = oldgrost->file;
assert(oldfp != 0 /* nullptr */);
@@ -7731,7 +7731,8 @@ static void close_stream(symbol &stream)
assert(!stream.is_null());
bool is_valid = false;
FILE *fp = 0 /* nullptr */;
- grostream *grost = (grostream *)stream_dictionary.lookup(stream);
+ grostream *grost = static_cast<grostream *>(stream_dictionary
+ .lookup(stream));
if (grost != 0 /* nullptr */) {
fp = grost->file;
// We shouldn't have stored a null pointer in the first place.
@@ -7793,7 +7794,8 @@ void do_write_request(int newline)
skip_line();
return;
}
- grostream *grost = (grostream *)stream_dictionary.lookup(stream);
+ grostream *grost = static_cast<grostream *>(stream_dictionary
+ .lookup(stream));
if (0 /* nullptr */ == grost) {
error("cannot write to nonexistent stream '%1'", stream.contents());
skip_line();
@@ -7841,7 +7843,8 @@ void write_macro_request()
skip_line();
return;
}
- grostream *grost = (grostream *)stream_dictionary.lookup(stream);
+ grostream *grost = static_cast<grostream *>(stream_dictionary
+ .lookup(stream));
FILE *fp = grost->file;
if (0 /* nullptr */ == fp) {
error("no stream named '%1'", stream.contents());
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit