X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fst%2Fst.c;h=e1204c3101ce2a35cd1db481584aeb8fc2fc077d;hb=0850a3224410b24400a5552feff23cf85bf443c3;hp=c589c5f97707e3e9a82b9c54dc3020513b9bd6cc;hpb=5d2f7c6eca2173a427ccf35a4b8ac793706de2e9;p=libfirm diff --git a/ir/st/st.c b/ir/st/st.c index c589c5f97..e1204c310 100644 --- a/ir/st/st.c +++ b/ir/st/st.c @@ -28,6 +28,9 @@ #ifdef HAVE_STDLIB_H # include #endif +#ifdef HAVE_MALLOC_H +# include +#endif # include "st.h" # include "irgwalk.h" @@ -116,9 +119,9 @@ static dt_t *new_dt (ir_graph *graph) res->n_blocks = n_blocks; res->graph = graph; - res->blocks = (ir_node**) calloc (n_blocks, sizeof (ir_node*)); - res->idoms = (ir_node**) calloc (n_blocks, sizeof (ir_node*)); - res->masks = (bs_t*) calloc (n_blocks, sizeof (bs_t)); + res->blocks = calloc(n_blocks, sizeof(*res->blocks)); + res->idoms = calloc(n_blocks, sizeof(*res->idoms)); + res->masks = calloc(n_blocks, sizeof(*res->masks)); assert (res && "no dt"); @@ -435,7 +438,7 @@ ir_node *get_idom (ir_graph *g, ir_node *a) */ dom_env_t *get_dom_env (ir_graph *graph, ir_node *a) { - dom_env_t *env = (dom_env_t*) calloc (1, sizeof (dom_env_t)); + dom_env_t *env = calloc(1, sizeof(*env)); env->graph = graph; env->dt = get_dominator_tree (graph);