From: Matthew Fernandez Date: Fri, 4 Jun 2021 00:22:20 +0000 (-0700) Subject: remove unnecessary casts of allocation results in mklang.y X-Git-Tag: 2.47.3~5^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16954820d6c4ab7dbe6ef70d72e124b890f699cb;p=graphviz remove unnecessary casts of allocation results in mklang.y This input is only used to generate a C file. In C, void pointers (as are the results of all the allocation functions) implicitly coerce to all other pointer types. --- diff --git a/doc/infosrc/mklang.y b/doc/infosrc/mklang.y index 68b791679..59beba724 100644 --- a/doc/infosrc/mklang.y +++ b/doc/infosrc/mklang.y @@ -45,7 +45,7 @@ gen (char* name, term_t* ts) static term_t* mkLiteral (char c, int kind) { - term_t* nt = (term_t*)malloc(sizeof(term_t)); + term_t* nt = malloc(sizeof(term_t)); nt->kind = kind; nt->u.c = c; nt->next = 0; @@ -55,7 +55,7 @@ mkLiteral (char c, int kind) static term_t* mkID (char* s, int kind) { - term_t* nt = (term_t*)malloc(sizeof(term_t)); + term_t* nt = malloc(sizeof(term_t)); nt->kind = kind; nt->u.s = s; nt->next = 0; @@ -65,7 +65,7 @@ mkID (char* s, int kind) static term_t* mkSeq (term_t* t1, term_t* t2, int kind) { - term_t* nt = (term_t*)malloc(sizeof(term_t)); + term_t* nt = malloc(sizeof(term_t)); nt->kind = kind; nt->u.t = t1; t1->next = t2; @@ -76,7 +76,7 @@ mkSeq (term_t* t1, term_t* t2, int kind) static term_t* mkTerm (term_t* t, int kind) { - term_t* nt = (term_t*)malloc(sizeof(term_t)); + term_t* nt = malloc(sizeof(term_t)); nt->kind = kind; nt->u.t = t; nt->next = 0;