groff-commit
[Top][All Lists]
Advanced

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

[groff] 07/35: [grotty]: Eliminate some type casts.


From: G. Branden Robinson
Subject: [groff] 07/35: [grotty]: Eliminate some type casts.
Date: Mon, 25 Oct 2021 03:32:34 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 6187997f7caf067c4aa49503ac7079b8c34f7414
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Oct 22 15:51:46 2021 +1100

    [grotty]: Eliminate some type casts.
    
    * src/devices/grotty/tty.cpp (tty_printer::special_link): Eliminate
      casts by retyping `uri` and `pair` to pointers to `const char`s.
---
 ChangeLog                  | 6 ++++++
 src/devices/grotty/tty.cpp | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d7e5847..65944b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,12 @@
 
 2021-10-21  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * src/devices/grotty/tty.cpp (tty_printer::special_link):
+       Eliminate casts by retyping `uri` and `pair` to pointers to
+       `const char`s.
+
+2021-10-21  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * tmac/tmac.am: Build more quietly.
        (tmac/stamp-wrap): Prefix all rule commands with `$(AM_V_at)`;
        since this target is a stamp file instead of a useful artifact
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index a440142..fcdc1fa 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -497,19 +497,19 @@ void tty_printer::special_link(const char *arg, const 
environment *env)
     while (c == ' ' || c == '\t');
     arg--;
     // The first argument is the URI.
-    char *uri = (char *)arg;
+    const char *uri = arg;
     do
       c = *arg++;
     while (c != '\0' && c != ' ' && c != '\t');
     arg--;
     ptrdiff_t uri_len = arg - uri;
     // Any remaining arguments are "key=value" pairs.
-    char *pair = 0;
+    const char *pair = 0;
     bool done = false;
     do {
       if (pair != 0)
        simple_add_char(':', env);
-      pair = (char *)arg;
+      pair = arg;
       bool in_pair = true;
       do {
        c = *arg++;



reply via email to

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