From: Matthew Fernandez Date: Sun, 3 Oct 2021 17:03:07 +0000 (-0700) Subject: Visio plugin: replace redeclaration of 'xml_string' with a #include X-Git-Tag: 2.49.2~19^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2678b7812abc5d262e0ddb6db0b3630ecf803bbb;p=graphviz Visio plugin: replace redeclaration of 'xml_string' with a #include There is no need for this duplicate prototype, or to lie about its type signature. Related to #1868. --- diff --git a/plugin/visio/VisioText.cpp b/plugin/visio/VisioText.cpp index 64eed3448..53021818a 100644 --- a/plugin/visio/VisioText.cpp +++ b/plugin/visio/VisioText.cpp @@ -17,9 +17,7 @@ #include #include -// slight lie that this function takes a const pointer (it does not, but we know -// it does not modify its argument) -extern "C" char *xml_string(const char* str); +#include namespace Visio { @@ -66,7 +64,8 @@ namespace Visio void Run::Print(GVJ_t* job, unsigned int index) const { - gvprintf(job, "%s\n", index, index, xml_string(_text.c_str())); /* para mark + char mark + actual text */ + auto c_str = const_cast(_text.c_str()); + gvprintf(job, "%s\n", index, index, xml_string(c_str)); /* para mark + char mark + actual text */ } Text Text::CreateText(GVJ_t* job, pointf p, textspan_t* span)