groff-commit
[Top][All Lists]
Advanced

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

[groff] 01/02: src/roff/troff/input.cpp: Add units to diagnostic.


From: G. Branden Robinson
Subject: [groff] 01/02: src/roff/troff/input.cpp: Add units to diagnostic.
Date: Fri, 10 Apr 2020 03:31:28 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 9954b19edf5c118c126433af82561c017ce84fdf
Author: G. Branden Robinson <address@hidden>
AuthorDate: Fri Apr 10 11:57:03 2020 +1000

    src/roff/troff/input.cpp: Add units to diagnostic.
    
    This function works only with device-specific basic units internally;
    users likely think in terms of point size, so add the basic unit suffix
    "u" to offer a hint about what's going on.
    
    Example:
        $ groff -ww >/dev/null
        \s[10]A\s[-12]B
        troff: <standard input>:1: warning: point-size escape results in
        non-positive size -2000u; set to 1u
    
    On a PostScript device with 1000 basic units to the point, the
    difference is important and would be confusing without the unit
    indication.
---
 ChangeLog                | 17 +++++++++++++++++
 src/roff/troff/input.cpp |  4 ++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dc7f9ad..2119c52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2020-04-10  G. Branden Robinson <address@hidden>
+
+       * src/roff/troff/input.cpp (read_size): Add units to diagnostic.
+       This function works only with device-specific basic units
+       internally; users likely think in terms of point size, so add
+       the basic unit suffix "u" to offer a hint about what's going on.
+
+       Example:
+       $ groff -ww >/dev/null
+       \s[10]A\s[-12]B
+       troff: <standard input>:1: warning: point-size escape results in
+       non-positive size -2000u; set to 1u
+
+       On a PostScript device with 1000 basic units to the point, the
+       difference is important and would be confusing without the unit
+       indication.
+
 2020-04-06  G. Branden Robinson <address@hidden>
 
        * src/roff/troff/input.cpp (read_size): Correctly brace 'else'
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 08e28bb..43fc9e5 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5139,8 +5139,8 @@ static int read_size(int *x)
     }
     if (*x <= 0) {
       warning(WARN_RANGE,
-             "point-size escape results in non-positive size %1;"
-             " set to 1", *x);
+             "point-size escape results in non-positive size %1u;"
+             " set to 1u", *x);
       *x = 1;
     }
     return 1;



reply via email to

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