groff-commit
[Top][All Lists]
Advanced

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

[groff] 22/44: [troff]: Internally align diagnostic wording.


From: G. Branden Robinson
Subject: [groff] 22/44: [troff]: Internally align diagnostic wording.
Date: Tue, 3 Sep 2024 08:05:45 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 8e1478e469c334a751d982c09cd92674a8c47df1
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Sep 2 21:33:39 2024 -0500

    [troff]: Internally align diagnostic wording.
    
    * src/roff/troff/input.cpp (define_color, device_request):
    * src/roff/troff/node.cpp (translate_font, set_special_fonts)
      (zoom_font): Align diagnostic wording with similar messages.
    
    * src/roff/troff/input.cpp (define_color): Add an assertion for
      paranoia's sake.
---
 ChangeLog                |  9 +++++++++
 src/roff/troff/input.cpp | 11 ++++++-----
 src/roff/troff/node.cpp  | 11 +++++------
 3 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c5d0ba9df..ee089ce13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-09-02  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp (define_color, device_request):
+       * src/roff/troff/node.cpp (translate_font, set_special_fonts)
+       (zoom_font): Align diagnostic wording with similar messages.
+
+       * src/roff/troff/input.cpp (define_color): Add an assertion for
+       paranoia's sake.
+
 2024-09-02  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/troff/input.cpp (pipe_source, open_request)
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index c371ce34c..a9a380c26 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -1509,13 +1509,14 @@ static void activate_color()
 
 static void define_color()
 {
-  symbol color_name = get_long_name();
-  if (color_name.is_null()) {
-    warning(WARN_MISSING, "missing identifier in color definition"
-           " request");
+  if (!has_arg()) {
+    warning(WARN_MISSING, "color definition request expects arguments");
     skip_line();
     return;
   }
+  symbol color_name = get_long_name();
+  // Testing has_arg() should have ensured this.
+  assert(color_name != 0 /* nullptr */);
   if (color_name == default_symbol) {
     warning(WARN_COLOR, "default color cannot be redefined");
     skip_line();
@@ -5899,7 +5900,7 @@ static node *do_device_control() // \X
 static void device_request()
 {
   if (!has_arg(true /* peek; we want to read in copy mode */)) {
-    warning(WARN_MISSING, "device control request expects arguments");
+    warning(WARN_MISSING, "device control request expects an argument");
     skip_line();
     return;
   }
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index cc3ae211f..cc995b842 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -6136,8 +6136,8 @@ static bool is_nonnegative_integer(const char *str)
 static void translate_font()
 {
   if (!(has_arg())) {
-    warning(WARN_MISSING, "one or two font names expected in font"
-           " translation request");
+    warning(WARN_MISSING, "font translation request expects one or two"
+           " font name arguments");
     skip_line();
     return;
   }
@@ -6472,8 +6472,7 @@ static void set_special_fonts()
 static void zoom_font()
 {
   if (!(has_arg())) {
-    warning(WARN_MISSING, "font name expected in zoom factor setting"
-           " request");
+    warning(WARN_MISSING, "font zoom factor request expects arguments");
     skip_line();
     return;
   }
@@ -6487,8 +6486,8 @@ static void zoom_font()
     return;
   }
   if (!(has_arg())) {
-    warning(WARN_MISSING, "zoom factor expected in zoom factor setting"
-           " request");
+    warning(WARN_MISSING, "font zoom factor request expects zoom factor"
+           " argument");
     skip_line();
     return;
   }



reply via email to

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