gbranden pushed a commit to branch master
in repository groff.

commit 075c2c5ffdfa2fa5a92015e825b9975d85f9bb62
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Apr 25 00:31:30 2025 -0500

    src/roff/troff/node.cpp: Fix code style nits.
    
    * src/roff/troff/node.cpp (is_valid_font_mounting_position):
      Parenthesize formally complex expression.
    
     (read_font_identifier): Favor C++-style `const_cast` over C-style
      omnipotent cast.
---
 ChangeLog               | 8 ++++++++
 src/roff/troff/node.cpp | 8 ++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 274ef8621..cf472d2b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-04-25  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/node.cpp: Fix code style nits.
+       (is_valid_font_mounting_position): Parenthesize formally complex
+       expression.
+       (read_font_identifier): Favor C++-style `const_cast` over
+       C-style omnipotent cast.
+
 2025-04-24  G. Branden Robinson <[email protected]>
 
        [troff]: Favor C++-style `static_cast` over C-style omnipotent
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 161844f6d..f6ab84298 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -6726,9 +6726,9 @@ static void font_lookup_error(font_lookup_info& finfo,
 
 bool is_valid_font_mounting_position(int n)
 {
-  return (n >= 0)
-        && (n < font_table_size)
-        && (font_table[n] != 0 /* nullptr */);
+  return ((n >= 0)
+         && (n < font_table_size)
+         && (font_table[n] != 0 /* nullptr */));
 }
 
 // Read the next token and look it up as a font name or position number.
@@ -6740,7 +6740,7 @@ static bool read_font_identifier(font_lookup_info *finfo)
   tok.skip();
   if (tok.is_usable_as_delimiter()) {
     symbol s = get_name(true /* required */);
-    finfo->requested_name = (char *)s.contents();
+    finfo->requested_name = const_cast<char *>(s.contents());
     if (!s.is_null()) {
       n = symbol_fontno(s);
       if (n < 0) {

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to