gbranden pushed a commit to branch master
in repository groff.
commit 6187997f7caf067c4aa49503ac7079b8c34f7414
Author: G. Branden Robinson <[email protected]>
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 <[email protected]>
+ * 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 <[email protected]>
+
* 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++;
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit