groff-commit
[Top][All Lists]
Advanced

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

[groff] 27/34: [libgroff]: Fix code style nit.


From: G. Branden Robinson
Subject: [groff] 27/34: [libgroff]: Fix code style nit.
Date: Thu, 2 Sep 2021 02:48:39 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 3c4df711a19ed439e230c845dd30ac6a96f7c292
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Aug 29 00:30:00 2021 +1000

    [libgroff]: Fix code style nit.
    
    * src/libs/libgroff/errarg.cpp (errprint): Replace `assert(0)` with a
      meaningful predicate.
    
    Also add editor aid comments and fix whitespace nits.  Remove old-style
    Emacs file-local variable from top of file.
---
 ChangeLog                    |  7 +++++++
 src/libs/libgroff/errarg.cpp | 13 +++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f9554d2..6fffd83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-08-29  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [libgroff]: Fix code style nit.
+
+       * src/libs/libgroff/errarg.cpp (errprint): Replace `assert(0)`
+       with a meaningful predicate.
+
 2021-08-28  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [libgroff]: Demote `need_space` to Boolean.
diff --git a/src/libs/libgroff/errarg.cpp b/src/libs/libgroff/errarg.cpp
index cfb9340..b6279dc 100644
--- a/src/libs/libgroff/errarg.cpp
+++ b/src/libs/libgroff/errarg.cpp
@@ -1,4 +1,3 @@
-// -*- C++ -*-
 /* Copyright (C) 1989-2020 Free Software Foundation, Inc.
      Written by James Clark (jjc@jclark.com)
 
@@ -68,7 +67,7 @@ extern "C" {
   const char *i_to_a(int);
   const char *ui_to_a(unsigned int);
 }
-           
+
 void errarg::print() const
 {
   switch (type) {
@@ -94,7 +93,7 @@ void errarg::print() const
 
 errarg empty_errarg;
 
-void errprint(const char *format, 
+void errprint(const char *format,
              const errarg &arg1,
              const errarg &arg2,
              const errarg &arg3)
@@ -121,10 +120,16 @@ void errprint(const char *format,
        arg3.print();
        break;
       default:
-       assert(0);
+       assert(0 == "unsupported argument conversion (not in [%123])");
       }
     }
     else
       putc(c, stderr);
   }
 }
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:



reply via email to

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