From: Matthew Fernandez Date: Fri, 4 Jun 2021 00:24:33 +0000 (-0700) Subject: remove unnecessary allocation function result casts in scan.l X-Git-Tag: 2.47.3~5^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b446a1c343867305cebac16a710db0a358123813;p=graphviz remove unnecessary allocation function result casts in scan.l This input is only used to create a lexer in C. In C, void pointers (as is the result of realloc) implicitly coerce to all other pointer types. --- diff --git a/lib/cgraph/scan.l b/lib/cgraph/scan.l index 723b386d9..541f4df3e 100644 --- a/lib/cgraph/scan.l +++ b/lib/cgraph/scan.l @@ -85,7 +85,7 @@ static void addstr(char *src) { long sz = Send - Sbuf; long off = Sptr - Sbuf; sz *= 2; - Sbuf = (char*)realloc(Sbuf,sz); + Sbuf = realloc(Sbuf,sz); Send = Sbuf + sz; Sptr = Sbuf + off; } @@ -109,7 +109,7 @@ storeFileName (char* fname, int len) static char* buf; if (len > cnt) { - buf = (char*)realloc (buf, len+1); + buf = realloc (buf, len+1); cnt = len; } strcpy (buf, fname);