gbranden pushed a commit to branch master
in repository groff.

commit bdbe227428495ac5bce66b81e693178e709ca2ce
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Aug 14 14:11:43 2024 -0500

    src/roff/troff/node.{h,cpp}: Update annotations.
    
    Annotate null pointers with `nullptr` comment to ease any future
    transition to C++11, which defines it as a keyword.
    
    Also add explanatory comments to formal arguments taking default values,
    as a compromise with the Stroustrup-style C++ used in most of groff.
    
    Some of the formal argument names are indeed not very "explanatory".
    This is an area for improvement.
---
 src/roff/troff/node.cpp | 7 ++++---
 src/roff/troff/node.h   | 8 +++++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index c49983b43..6cb5e3235 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -1973,7 +1973,7 @@ class dbreak_node : public node {
   node *pre;
   node *post;
 public:
-  dbreak_node(node *, node *, statem *, int, node * = 0);
+  dbreak_node(node *, node *, statem *, int, node * = 0 /* nullptr */);
   ~dbreak_node();
   node *copy();
   node *merge_glyph_node(glyph_node *);
@@ -1983,8 +1983,9 @@ public:
   hunits italic_correction();
   hunits subscript_correction();
   void tprint(troff_output_file *);
-  breakpoint *get_breakpoints(hunits width, int ns, breakpoint *rest = 0,
-                             bool is_inner = false);
+  breakpoint *get_breakpoints(hunits /* width */, int /* ns */,
+                             breakpoint * /* rest */ = 0 /* nullptr */,
+                             bool /* is_inner */ = false);
   int nbreaks();
   int ends_sentence();
   void split(int, node **, node **);
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index 2db44f56e..5a1b13e14 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
      Written by James Clark ([email protected])
 
 This file is part of groff.
@@ -222,8 +222,10 @@ class word_space_node : public space_node {
 protected:
   width_list *orig_width;
   bool unformat;
-  word_space_node(hunits, int, color *, width_list *, bool, statem *,
-                 int, node * /* x */ = 0 /* nullptr */);
+  word_space_node(hunits /* d */, int /* s */, color * /* c */,
+                 width_list * /* w */, bool /* flag */,
+                 statem * /* st */, int /* divlevel */,
+                 node * /* x */ = 0 /* nullptr */);
 public:
   word_space_node(hunits, color *, width_list *,
                  node * /* x */ = 0 /* nullptr */);

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

Reply via email to