gbranden pushed a commit to branch master
in repository groff.
commit f87ccd21944c3aa07c2903d2c72c10e04695c7d4
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Jan 15 15:58:33 2025 -0600
[grohtml]: Migrate `isspace()` to `csspace()`.
* src/devices/grohtml/html-table.cpp (tabs::compatible, tabs::init):
* src/devices/grohtml/post-html.cpp (text_glob::get_arg)
(text_glob::get_tab_args, html_printer::do_tab_te): Use "libgroff.a"'s
facility for determining character class membership, to conform with
the rest of the code base (except C code that doesn't link with that
library).
---
ChangeLog | 12 ++++++++++++
src/devices/grohtml/html-table.cpp | 18 +++++++++---------
src/devices/grohtml/post-html.cpp | 16 ++++++++--------
3 files changed, 29 insertions(+), 17 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 45440b33f..1c4057b01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2025-01-15 G. Branden Robinson <[email protected]>
+
+ [grohtml]: Migrate `isspace()` to `csspace()`.
+
+ * src/devices/grohtml/html-table.cpp (tabs::compatible)
+ (tabs::init):
+ * src/devices/grohtml/post-html.cpp (text_glob::get_arg)
+ (text_glob::get_tab_args, html_printer::do_tab_te): Use
+ "libgroff.a"'s facility for determining character class
+ membership, to conform with the rest of the code base (except C
+ code that doesn't link with that library).
+
2025-01-15 G. Branden Robinson <[email protected]>
[grohtml]: Fix code style nits.
diff --git a/src/devices/grohtml/html-table.cpp
b/src/devices/grohtml/html-table.cpp
index 5d97c49b4..1ce020fe0 100644
--- a/src/devices/grohtml/html-table.cpp
+++ b/src/devices/grohtml/html-table.cpp
@@ -30,7 +30,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include "driver.h"
#include "stringclass.h"
-#include "cset.h"
+#include "cset.h" // csspace()
#include "html-table.h"
#include "ctype.h"
#include "html.h"
@@ -95,24 +95,24 @@ int tabs::compatible (const char *s)
return FALSE; // no tab stops defined
// move over tag name
- while ((*s != '\0') && !isspace(*s))
+ while ((*s != '\0') && !csspace(*s))
s++;
while (*s != '\0' && last != NULL) {
// move over whitespace
- while ((*s != '\0') && isspace(*s))
+ while ((*s != '\0') && csspace(*s))
s++;
// collect alignment
align = *s;
// move over alignment
s++;
// move over whitespace
- while ((*s != '\0') && isspace(*s))
+ while ((*s != '\0') && csspace(*s))
s++;
// collect tab position
total = atoi(s);
// move over tab position
- while ((*s != '\0') && !isspace(*s))
+ while ((*s != '\0') && !csspace(*s))
s++;
if (last->alignment != align || last->position != total)
return FALSE;
@@ -135,24 +135,24 @@ void tabs::init (const char *s)
clear(); // remove any tab stops
// move over tag name
- while ((*s != '\0') && !isspace(*s))
+ while ((*s != '\0') && !csspace(*s))
s++;
while (*s != '\0') {
// move over whitespace
- while ((*s != '\0') && isspace(*s))
+ while ((*s != '\0') && csspace(*s))
s++;
// collect alignment
align = *s;
// move over alignment
s++;
// move over whitespace
- while ((*s != '\0') && isspace(*s))
+ while ((*s != '\0') && csspace(*s))
s++;
// collect tab position
total = atoi(s);
// move over tab position
- while ((*s != '\0') && !isspace(*s))
+ while ((*s != '\0') && !csspace(*s))
s++;
if (last == NULL) {
tab = new tab_position;
diff --git a/src/devices/grohtml/post-html.cpp
b/src/devices/grohtml/post-html.cpp
index 18594efa4..78c6010c8 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -35,7 +35,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <getopt.h> // getopt_long()
-#include "cset.h"
+#include "cset.h" // csspace()
#include "curtime.h"
#include "driver.h"
#include "stringclass.h"
@@ -892,9 +892,9 @@ int text_glob::get_arg (void)
if (strncmp("devtag:", text_string, strlen("devtag:")) == 0) {
const char *p = text_string;
- while ((*p != '\0') && (!isspace(*p)))
+ while ((*p != '\0') && (!csspace(*p)))
p++;
- while ((*p != '\0') && (isspace(*p)))
+ while ((*p != '\0') && (csspace(*p)))
p++;
if ('\0' == *p)
return -1;
@@ -913,15 +913,15 @@ int text_glob::get_tab_args (char *align)
const char *p = text_string;
// firstly the alignment C|R|L
- while ((*p != '\0') && (!isspace(*p)))
+ while ((*p != '\0') && (!csspace(*p)))
p++;
- while ((*p != '\0') && (isspace(*p)))
+ while ((*p != '\0') && (csspace(*p)))
p++;
*align = *p;
// now the int value
- while ((*p != '\0') && (!isspace(*p)))
+ while ((*p != '\0') && (!csspace(*p)))
p++;
- while ((*p != '\0') && (isspace(*p)))
+ while ((*p != '\0') && (csspace(*p)))
p++;
if ('\0' == *p)
return -1;
@@ -3216,7 +3216,7 @@ void html_printer::do_tab_te (void)
void html_printer::do_tab (char *s)
{
if (table) {
- while (isspace(*s))
+ while (csspace(*s))
s++;
s++;
int col = table->find_column(atoi(s) + pageoffset
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit