From: Matthew Fernandez Date: Fri, 4 Jun 2021 00:23:30 +0000 (-0700) Subject: remove unnecessary casts of allocation function results in grammar.y X-Git-Tag: 2.47.3~5^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6f6cdd3074c127a4b9cd87c4fa6ab85992e788e;p=graphviz remove unnecessary casts of allocation function results in grammar.y This input is only used to generate a parser in C. In C, void pointers (as are the results of all the allocation functions) implicitly coerce to all other pointer types. --- diff --git a/lib/cgraph/grammar.y b/lib/cgraph/grammar.y index bfa677345..9dd2a36c8 100644 --- a/lib/cgraph/grammar.y +++ b/lib/cgraph/grammar.y @@ -442,7 +442,7 @@ concat (char* s1, char* s2) size_t len = strlen(s1) + strlen(s2) + 1; if (len <= BUFSIZ) sym = buf; - else sym = (char*)malloc(len); + else sym = malloc(len); strcpy(sym,s1); strcat(sym,s2); s = agstrdup (G,sym); @@ -463,7 +463,7 @@ concatPort (char* s1, char* s2) size_t len = strlen(s1) + strlen(s2) + 2; /* one more for ':' */ if (len <= BUFSIZ) sym = buf; - else sym = (char*)malloc(len); + else sym = malloc(len); sprintf (sym, "%s:%s", s1, s2); s = agstrdup (G,sym); agstrfree (G,s1);