groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 12/27: src/preproc/html/pre-html.cpp: Refactor (11/11).


From: G. Branden Robinson
Subject: [groff] 12/27: src/preproc/html/pre-html.cpp: Refactor (11/11).
Date: Sat, 2 Jul 2022 00:43:12 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 73f61a0d2e871cf3d4128d5ad49eee22be033e1d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Jul 1 18:25:06 2022 -0500

    src/preproc/html/pre-html.cpp: Refactor (11/11).
    
    * src/preproc/html/pre-html.cpp (char_buffer::skip_spaces): Drop unused
      member function.
---
 ChangeLog                     |  4 ++--
 src/preproc/html/pre-html.cpp | 26 --------------------------
 2 files changed, 2 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 37f058a5..a9f6d9e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,8 +18,8 @@
        (makeFileName, setupAntiAlias, imageList::createPage,
        imageList::createImage): Update call sites to use
        `make_string()`.
-       (char_buffer::can_see, char_buffer::skip_spaces): Demote return
-       type from `int` to `bool`.
+       (char_buffer::can_see): Demote return type from `int` to `bool`.
+       (char_buffer::skip_spaces): Drop unused member function.
        (char_buffer::read_file, makeTempFiles): Demote return type from
        `int` to `void`.  Stop returning after calling functions that
        don't return.
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index ddf926be..1da57652 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -442,7 +442,6 @@ public:
   void emit_troff_output(int device_format_selector);
   void write_upto_newline(char_block **t, int *i, int is_html);
   bool can_see(char_block **t, int *i, const char *string);
-  bool skip_spaces(char_block **t, int *i);
   void skip_until_newline(char_block **t, int *i);
 private:
   char_block *head;
@@ -717,31 +716,6 @@ bool char_buffer::can_see(char_block **t, int *i, const 
char *str)
   return false;
 }
 
-/*
- *  skip_spaces - Return true if we have not run out of data.
- *                Consume spaces also.
- */
-
-bool char_buffer::skip_spaces(char_block **t, int *i)
-{
-  char_block *s = *t;
-  int k = *i;
-
-  while (s) {
-    while (k < s->used && isspace(s->buffer[k]))
-      k++;
-    if (k == s->used) {
-      k = 0;
-      s = s->next;
-    }
-    else {
-      *i = k;
-      return true;
-    }
-  }
-  return false;
-}
-
 /*
  *  skip_until_newline - Skip all characters until a newline is seen.
  *                       The newline is not consumed.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]