[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #61187] [grohtml] post-html.cpp: address used instead of the value
From: |
G. Branden Robinson |
Subject: |
[bug #61187] [grohtml] post-html.cpp: address used instead of the value |
Date: |
Sun, 19 Sep 2021 21:00:29 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 |
Update of bug #61187 (project groff):
Status: None => In Progress
Assigned to: None => gbranden
_______________________________________________________
Follow-up Comment #1:
Hi Bjarni,
Thanks for the report; this is a valid catch that my compiler settings did not
see, which kind of surprised me given the severity of the type mismatch.
It arose from the following commit.
commit 2dff87d3edba3c82f93dd4b07a95bb42543a5d86
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date: Fri Sep 17 18:56:08 2021 +1000
[...]
* src/include/font.h (font::load_font): Drop second parameter. It was
never used for its intended purpose.
[...]
It turns out I missed this call site in grohtml, and it looks like I didn't
miss any others (though simple grepping makes this nontrivial, since libdriver
provides another, different, load_font() function).
Funnily enough, grohtml's use of load_font _also_ turned out to be a dead
store, as with all other callers of `font::load_font()`.
Here's a patch I have in preparation. If you examine the file you will see
that this `found` variable is never read.
diff --git a/src/devices/grohtml/post-html.cpp
b/src/devices/grohtml/post-html.cpp
index 0795abf32..575828063 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -5302,11 +5302,8 @@ void html_printer::special(char *s, const environment
*env, char type)
int r=font::res; /* resolution of the device */
font *f=sbuf_style.f;
- if (f == NULL) {
- int found=FALSE;
-
- f = font::load_font("TR", &found);
- }
+ if (f == NULL)
+ f = font::load_font("TR");
/*
* need to pass rest of string through to html output during flush
@@ -5330,11 +5327,8 @@ void html_printer::special(char *s, const environment
*env, char type)
font *f=sbuf_style.f;
string t;
- if (f == NULL) {
- int found=FALSE;
-
- f = font::load_font("TR", &found);
- }
+ if (f == NULL)
+ f = font::load_font("TR");
if (strncmp(s, "math<?p>:", 9) == 0) {
if (strncmp((char *)&s[9], "<math>", 6) == 0) {
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?61187>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/