From: Matthew Fernandez Date: Thu, 11 Feb 2021 04:55:55 +0000 (-0800) Subject: remove some unnecessary void* casts X-Git-Tag: 2.47.0~69^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99a35995df89b3e13757577caffac206fae6674f;p=graphviz remove some unnecessary void* casts --- diff --git a/lib/expr/exgram.h b/lib/expr/exgram.h index dd73052dc..ee2b12d55 100644 --- a/lib/expr/exgram.h +++ b/lib/expr/exgram.h @@ -35,7 +35,7 @@ extern "C" { #define exlex() extoken_fn(expr.program) -#define ALLOCATE(p,x) (x*)exalloc(p,sizeof(x)) +#define ALLOCATE(p,x) exalloc(p,sizeof(x)) #define QUALIFY(r,s) ((r)&&(expr.program->disc->flags&EX_QUALIFY)?qualify(r,s):(s)) static int a2t[] = { 0, FLOATING, INTEGER, STRING }; diff --git a/lib/expr/exparse.y b/lib/expr/exparse.y index 45baa5585..dc6b0d0b9 100644 --- a/lib/expr/exparse.y +++ b/lib/expr/exparse.y @@ -452,7 +452,7 @@ switch_item : case_list statement_list sw->lastcase = $$; n = sw->cur - sw->base; sw->cur = sw->base; - $$->data.select.constant = (Extype_t**)exalloc(expr.program, (n + 1) * sizeof(Extype_t*)); + $$->data.select.constant = exalloc(expr.program, (n + 1) * sizeof(Extype_t*)); memcpy($$->data.select.constant, sw->base, n * sizeof(Extype_t*)); $$->data.select.constant[n] = 0; } diff --git a/lib/vmalloc/vmalloc.h b/lib/vmalloc/vmalloc.h index 7d1f12175..f8b6645d3 100644 --- a/lib/vmalloc/vmalloc.h +++ b/lib/vmalloc/vmalloc.h @@ -62,7 +62,7 @@ extern "C" { #ifndef vmfree #define vmfree(vm,d) (*(_VM_(vm)->meth.freef))((vm),(void*)(d)) #endif -#define vmnewof(v,p,t,n,x) (t*)vmresize((v), (p), sizeof(t)*(n)+(x)) +#define vmnewof(v,p,t,n,x) vmresize((v), (p), sizeof(t)*(n)+(x)) #ifdef __cplusplus } #endif