gbranden pushed a commit to branch master
in repository groff.

commit 178eda45d8130cd170dd3fd7d2c0cec1538b48b1
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Jun 4 07:56:12 2025 -0500

    [grohtml]: Fix code style nits (2/4).
    
    * src/devices/grohtml/post-html.cpp
      (files::get_file)
      (page::add_and_encode)
      (assert_state::check_value_error)
      (html_printer::do_tab_te)
      (html_printer::do_tab)
      (html_printer::do_tab0)
      (html_printer::do_col)
      (html_printer::set_numbered_char)
      (html_printer::set_char_and_width): Explicitly compare value of
      pointer type to null pointer literal instead of letting it pun down to
      a Boolean.
---
 ChangeLog                         | 11 +++++++++++
 src/devices/grohtml/post-html.cpp | 18 +++++++++---------
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5a27b964f..0a5c2dfa9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2025-06-04  G. Branden Robinson <[email protected]>
+
+       * src/devices/grohtml/post-html.cpp
+       (html_printer::do_tab_te)
+       (html_printer::do_tab)
+       (html_printer::do_tab0)
+       (html_printer::do_col)
+       (html_printer::set_char_and_width): Explicitly compare value of
+       pointer type to null pointer literal instead of letting it pun
+       down to a Boolean.
+
 2025-06-04  G. Branden Robinson <[email protected]>
 
        * src/devices/grohtml/post-html.cpp
diff --git a/src/devices/grohtml/post-html.cpp 
b/src/devices/grohtml/post-html.cpp
index 0f7166e57..7eaa1be68 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -215,7 +215,7 @@ files::files ()
 
 FILE *files::get_file (void)
 {
-  if (ptr)
+  if (ptr != 0 /* nullptr */)
     return ptr->fp;
   else
     return 0 /* nullptr */;
@@ -1471,7 +1471,7 @@ void page::add_and_encode (style *s, const string &str,
       if (i > 0) {
        string troff_charname = str.substring(a, i - a);
        html_glyph = get_html_translation(s->f, troff_charname);
-       if (html_glyph)
+       if (html_glyph != 0 /* nullptr */)
          html_string += html_glyph;
        else {
          glyph *g = name_to_glyph((troff_charname + '\0').contents());
@@ -1960,7 +1960,7 @@ int assert_state::check_value_error (int c, int v, const 
char *s,
                                     const char *name, const char *f,
                                     const char *l, int flag)
 {
-  if (! c) {
+  if (0 /* nullptr */ == c) {
     if (0 /* nullptr */ == f)
       f = "stdin";
     if (0 /* nullptr */ == l)
@@ -3240,7 +3240,7 @@ void html_printer::do_tab_ts (text_glob *g)
 
 void html_printer::do_tab_te (void)
 {
-  if (table) {
+  if (table != 0 /* nullptr */) {
     current_paragraph->done_para();
     current_paragraph->remove_para_space();
     table->emit_finish_table();
@@ -3257,7 +3257,7 @@ void html_printer::do_tab_te (void)
 void html_printer::do_tab (char *s)
 {
   assert(s != 0 /* nullptr */);
-  if (table) {
+  if (table != 0 /* nullptr */) {
     while (csspace(*s))
       s++;
     s++;
@@ -3276,7 +3276,7 @@ void html_printer::do_tab (char *s)
 
 void html_printer::do_tab0 (void)
 {
-  if (table) {
+  if (table != 0 /* nullptr */) {
     int col = table->find_column(pageoffset+get_troff_indent());
     if (col > 0) {
       current_paragraph->done_para();
@@ -3292,7 +3292,7 @@ void html_printer::do_tab0 (void)
 void html_printer::do_col (char *s)
 {
   assert(s != 0 /* nullptr */);
-  if (table) {
+  if (table != 0 /* nullptr */) {
     if (atoi(s) < current_column)
       row_space = seen_space;
 
@@ -4940,7 +4940,7 @@ void html_printer::set_numbered_char(int num, const 
environment *env,
   else
     w = f->get_width(g, env->size);
   w = round_width(w);
-  if (widthp)
+  if (widthp != 0 /* nullptr */)
     *widthp = w;
   set_char(g, f, env, w, 0 /* nullptr */);
 }
@@ -4974,7 +4974,7 @@ glyph *html_printer::set_char_and_width(const char *nm,
   }
   int w = (*f)->get_width(g, env->size);
   w = round_width(w);
-  if (widthp)
+  if (widthp != 0 /* nullptr */)
     *widthp = w;
   return g;
 }

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

Reply via email to