]> granicus.if.org Git - graphviz/commitdiff
take a const pointer in agstrbind
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 4 Jul 2021 04:09:18 +0000 (21:09 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 18 Jul 2021 00:31:35 +0000 (17:31 -0700)
This function does not modify its string argument, so it is more accurate to
qualify it as const. Related to #634.

lib/cgraph/cgraph.h
lib/cgraph/refstr.c

index 1e91f4a0f912663491964bc558ce1b75e17535f9..d1687e9bb912b11aafc32ac1e38ccced8ee0fede 100644 (file)
@@ -305,7 +305,7 @@ CGRAPH_API int agobjkind(void *);
 CGRAPH_API char *agstrdup(Agraph_t *, const char *);
 CGRAPH_API char *agstrdup_html(Agraph_t *, const char *);
 CGRAPH_API int aghtmlstr(const char *);
-CGRAPH_API char *agstrbind(Agraph_t * g, char *);
+CGRAPH_API char *agstrbind(Agraph_t * g, const char *);
 CGRAPH_API int agstrfree(Agraph_t *, char *);
 CGRAPH_API char *agcanon(char *, int);
 CGRAPH_API char *agstrcanon(char *, char *);
index a534618226cb5687e062a16b1b95585b76a1db08..db14202bf782c203e7428238454e8b772c8ae68d 100644 (file)
@@ -89,7 +89,7 @@ static char *refstrbind(Dict_t * strdict, const char *s)
        return NULL;
 }
 
-char *agstrbind(Agraph_t * g, char *s)
+char *agstrbind(Agraph_t * g, const char *s)
 {
     return refstrbind(refdict(g), s);
 }