gbranden pushed a commit to branch master
in repository groff.

commit 1aba5f7e7cfd9db93264e5aaeed00f78a6d09e39
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Mar 22 18:19:22 2026 -0500

    [troff]: Rename some member functions.
    
    * src/roff/troff/request.h (class macro):
    * src/roff/troff/input.cpp (class char_list, class node_list): Rename
      `length()` member function to `get_length()`, like other accessors in
      GNU troff.
    
      (char_list::length)
      (node_list::length)
      (macro::length): Rename these...
      (char_list::get_length)
      (node_list::get_length)
      (macro::get_length): ...to these.
    
      (macro:append, macro_header::json_dump_macro)
      (do_string_case_transform, substring_request): Update call sites.
    
      (do_string_case_transform): Drop unnecessary name space qualification.
---
 ChangeLog                | 20 ++++++++++++++++++++
 src/roff/troff/input.cpp | 20 ++++++++++----------
 src/roff/troff/request.h |  2 +-
 3 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9fb8a61a6..ccc72cb80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2026-03-22  G. Branden Robinson <[email protected]>
+
+       [troff]: Rename some member functions.
+
+       * src/roff/troff/request.h (class macro):
+       * src/roff/troff/input.cpp (class char_list, class node_list):
+       Rename `length()` member function to `get_length()`, like other
+       accessors in GNU troff.
+       (char_list::length)
+       (node_list::length)
+       (macro::length): Rename these...
+       (char_list::get_length)
+       (node_list::get_length)
+       (macro::get_length): ...to these.
+       (macro:append, macro_header::json_dump_macro)
+       (do_string_case_transform, substring_request): Update call
+       sites.
+       (do_string_case_transform): Drop unnecessary name space
+       qualification.
+
 2026-03-21  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp (substring_request): Ignore request
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 799aa8c33..13d4eb046 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -3831,7 +3831,7 @@ public:
   void append(unsigned char);
   void set(unsigned char, int);
   unsigned char get(int);
-  int length();
+  int get_length();
 private:
   unsigned char *ptr;
   int len;
@@ -3856,7 +3856,7 @@ char_list::~char_list()
   }
 }
 
-int char_list::length()
+int char_list::get_length()
 {
   return len;
 }
@@ -3923,7 +3923,7 @@ public:
   node_list();
   ~node_list();
   void append(node *);
-  int length();
+  int get_length();
 
   friend class macro_header;
   friend class string_iterator;
@@ -3941,7 +3941,7 @@ void node_list::append(node *n)
   }
 }
 
-int node_list::length()
+int node_list::get_length()
 {
   int total = 0 /* nullptr */;
   for (node *n = head; n != 0 /* nullptr */; n = n->next)
@@ -4050,7 +4050,7 @@ void macro::append(unsigned char c)
   assert(c != 0);
   if (p == 0 /* nullptr */)
     p = new macro_header;
-  if (p->cl.length() != len) {
+  if (p->cl.get_length() != len) {
     macro_header *tem = p->copy(len);
     if (--(p->count) <= 0)
       delete p;
@@ -4075,7 +4075,7 @@ unsigned char macro::get(int offset)
   return p->cl.get(offset);
 }
 
-int macro::length()
+int macro::get_length()
 {
   return len;
 }
@@ -4097,7 +4097,7 @@ void macro::append(node *n)
   assert(n != 0 /* nullptr */);
   if (p == 0 /* nullptr */)
     p = new macro_header;
-  if (p->cl.length() != len) {
+  if (p->cl.get_length() != len) {
     macro_header *tem = p->copy(len);
     if (--(p->count) <= 0)
       delete p;
@@ -4226,7 +4226,7 @@ void macro_header::json_dump_diversion()
 void macro_header::json_dump_macro()
 {
   errprint("\"contents\": \"");
-  int macro_len = cl.length();
+  int macro_len = cl.get_length();
   for (int i = 0; i < macro_len; i++) {
     json_char jc = json_encode_char(cl.get(i));
     // Write out its JSON representation by character by character to
@@ -5749,7 +5749,7 @@ void do_string_case_transform(case_xform_mode mode)
   }
   string_iterator iter1(*m);
   macro *mac = new macro;
-  int len = m->macro::length();
+  int len = m->get_length();
   for (int l = 0; l < len; l++) {
     int nc, c = iter1.get(0 /* nullptr */);
     if ((PUSH_GROFF_MODE == c)
@@ -5810,7 +5810,7 @@ void substring_request()
     else {
       int end = -1;
       if (!has_arg() || read_integer(&end)) {
-       int len = m->length();
+       int len = m->get_length();
        string_iterator iter1(*m);
        // We don't apply substring operations to internally generated
        // tokens that manage compatibility mode.
diff --git a/src/roff/troff/request.h b/src/roff/troff/request.h
index 3eb024464..6ec29e979 100644
--- a/src/roff/troff/request.h
+++ b/src/roff/troff/request.h
@@ -64,7 +64,7 @@ public:
   void set(unsigned char, int);
   void chop();
   unsigned char get(int);
-  int length();
+  int get_length();
   void invoke(symbol, bool);
   macro *to_macro();
   void print_size();

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

Reply via email to