]> granicus.if.org Git - graphviz/commitdiff
remove unnecessary casts of allocation results in gmlparse.y
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 4 Jun 2021 00:19:55 +0000 (17:19 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 9 Jun 2021 14:18:52 +0000 (07:18 -0700)
These functions all return void pointers and this input is only used for
generating a parser in C. In C, void pointers implicitly coerce to all other
pointers.

cmd/tools/gmlparse.y

index ee22c34fa774e7f3c8603a2ffa7e85e377eb2bed..7dfc64e4dc6d3e9d3e75370ed0cb2b6ade9e898f 100644 (file)
@@ -25,9 +25,9 @@
 #include <agxbuf.h>
 #include <assert.h>
 
-#define NEW(t)       (t*)malloc(sizeof(t))
-#define N_NEW(n,t)   (t*)calloc((n),sizeof(t))
-#define RALLOC(size,ptr,type) ((type*)realloc(ptr,(size)*sizeof(type)))
+#define NEW(t)       malloc(sizeof(t))
+#define N_NEW(n,t)   calloc((n),sizeof(t))
+#define RALLOC(size,ptr,type) realloc(ptr,(size)*sizeof(type))
 
 typedef unsigned short ushort;