groff-commit
[Top][All Lists]
Advanced

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

[groff] 07/14: [troff]: Fix code style nits.


From: G. Branden Robinson
Subject: [groff] 07/14: [troff]: Fix code style nits.
Date: Fri, 29 Dec 2023 21:07:19 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 70a3d4d886277ded371837c903ac3aa7620fd9e7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Dec 29 13:18:14 2023 -0600

    [troff]: Fix code style nits.
    
    * src/roff/troff/charinfo.h: Update editor aid comments; drop old-style
      Emacs file-local variable setting.
    * src/roff/troff/input.cpp (charinfo::contains): Wrap long line.
    * src/roff/troff/node.cpp (make_glyph_node): Annotate null pointers with
      `nullptr` comment to ease any future transition to C++11, which
      defines it as a keyword.
---
 src/roff/troff/charinfo.h | 7 ++++++-
 src/roff/troff/input.cpp  | 5 ++---
 src/roff/troff/node.cpp   | 8 ++++----
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/roff/troff/charinfo.h b/src/roff/troff/charinfo.h
index 0a7a48150..02be5aa95 100644
--- a/src/roff/troff/charinfo.h
+++ b/src/roff/troff/charinfo.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
 /* Copyright (C) 1989-2020 Free Software Foundation, Inc.
      Written by James Clark (jjc@jclark.com)
 
@@ -299,3 +298,9 @@ inline bool charinfo::is_class()
 {
   return (!ranges.empty() || !nested_classes.empty());
 }
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 28f7c306f..27ed9d57a 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -9293,9 +9293,8 @@ int charinfo::get_number()
 bool charinfo::contains(int c, bool already_called)
 {
   if (already_called) {
-    warning(WARN_SYNTAX,
-           "cyclic nested class detected while processing character code %1",
-           c);
+    warning(WARN_SYNTAX, "cyclic nested class detected while processing"
+           " character code %1", c);
     return false;
   }
   std::vector<std::pair<int, int> >::const_iterator ranges_iter;
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 9fabb48cc..f1130b8d7 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -229,7 +229,7 @@ inline int env_definite_font(environment *env)
 
 /* font_info functions */
 
-static font_info **font_table = 0;
+static font_info **font_table = 0 /* nullptr */;
 static int font_table_size = 0;
 
 font_info::font_info(symbol nm, int n, symbol enm, font *f)
@@ -4907,7 +4907,7 @@ static node *make_glyph_node(charinfo *s, environment 
*env,
   int fontno = env_definite_font(env);
   if (fontno < 0) {
     error("cannot format glyph: no current font");
-    return 0;
+    return 0 /* nullptr */;
   }
   assert(fontno < font_table_size && font_table[fontno] != 0);
   int fn = fontno;
@@ -4920,7 +4920,7 @@ static node *make_glyph_node(charinfo *s, environment 
*env,
       if (want_warnings)
        warning(WARN_CHAR, "character code %1 not defined in current"
                " font", s->get_number());
-      return 0;
+      return 0 /* nullptr */;
     }
     special_font_list *sf = font_table[fontno]->sf;
     while (sf != 0 && !found) {
@@ -4978,7 +4978,7 @@ static node *make_glyph_node(charinfo *s, environment 
*env,
                  backslash, nm);
        }
       }
-      return 0;
+      return 0 /* nullptr */;
     }
   }
   font_size fs = env->get_font_size();



reply via email to

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