gbranden pushed a commit to branch master
in repository groff.

commit 1f243fd244541ed29c981fab822ad7ba630c9884
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Jun 19 01:17:00 2026 -0500

    [libgroff]: Disable unused `string` functions.
    
    * src/include/stringclass.h: "`#if 0`"-out `string` constructor taking a
      `char` parameter and collation operator `friend` function
      declarations.
    
    * src/libs/libgroff/string.cpp (string::string)
      (operator<, operator<=, operator>, operator>=): "`#if 0`"-out
      corresponding function definitions.
---
 ChangeLog                    | 10 ++++++++++
 src/include/stringclass.h    |  4 ++++
 src/libs/libgroff/string.cpp |  4 ++++
 3 files changed, 18 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 9ff0c060e..036c3ef81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2026-06-19  G. Branden Robinson <[email protected]>
+
+       [libgroff]: Disable unused `string` functions.
+       * src/include/stringclass.h: "`#if 0`"-out `string` constructor
+       taking a `char` parameter and collation operator `friend`
+       function declarations.
+       * src/libs/libgroff/string.cpp (string::string)
+       (operator<, operator<=, operator>, operator>=): "`#if 0`"-out
+       corresponding function definitions.
+
 2026-06-19  G. Branden Robinson <[email protected]>
 
        * src/libs/libgroff/string.cpp: Refactor.
diff --git a/src/include/stringclass.h b/src/include/stringclass.h
index e75405e26..1b4a47fb9 100644
--- a/src/include/stringclass.h
+++ b/src/include/stringclass.h
@@ -47,7 +47,9 @@ public:
   string(const string &);
   string(const char *);
   string(const char *, size_t);
+#if 0
   string(char);
+#endif
 
   ~string();
 
@@ -90,10 +92,12 @@ public:
 
   friend bool operator==(const string &, const string &);
   friend bool operator!=(const string &, const string &);
+#if 0
   friend bool operator<=(const string &, const string &);
   friend bool operator<(const string &, const string &);
   friend bool operator>=(const string &, const string &);
   friend bool operator>(const string &, const string &);
+#endif
 
 private:
   char *ptr;
diff --git a/src/libs/libgroff/string.cpp b/src/libs/libgroff/string.cpp
index 13fcdb822..f0b4746ef 100644
--- a/src/libs/libgroff/string.cpp
+++ b/src/libs/libgroff/string.cpp
@@ -156,12 +156,14 @@ string::string(const char *p)
   }
 }
 
+#if 0
 string::string(char c) : len(1)
 {
   ptr = salloc(1, &sz);
   assert(ptr != 0 /* nullptr */);
   *ptr = c;
 }
+#endif
 
 string::string(const string &s) : len(s.len)
 {
@@ -288,6 +290,7 @@ string::string(const char *s1, size_t n1, const char *s2, 
size_t n2)
   }
 }
 
+#if 0
 bool operator<=(const string &s1, const string &s2)
 {
   return ((s1.len <= s2.len)
@@ -315,6 +318,7 @@ bool operator>(const string &s1, const string &s2)
          ? ((s2.len == 0) || (memcmp(s1.ptr, s2.ptr, s2.len) >= 0))
          : ((s1.len != 0) && (memcmp(s1.ptr, s2.ptr, s1.len) > 0)));
 }
+#endif
 
 void string::set_length(size_t i)
 {

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

Reply via email to