summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6653fca)
I found these uses of calloc, which could be replaced with zmalloc. I
presumed that the reason for using calloc was for the fact that it
initializes the memory to zeroes.
Change-Id: Icd8b84d707978e949c55d9694e6dbc10319c0169
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- op = (ir_op *) calloc(sizeof(struct ir_op), 1);
+ op = (ir_op *) zmalloc(sizeof(struct ir_op));
if (!op)
return NULL;
switch (child->data_type) {
if (!op)
return NULL;
switch (child->data_type) {
- op = (ir_op *) calloc(sizeof(struct ir_op), 1);
+ op = (ir_op *) zmalloc(sizeof(struct ir_op));
if (!op)
return NULL;
op->op = IR_OP_LOAD;
if (!op)
return NULL;
op->op = IR_OP_LOAD;
- op = (ir_op *) calloc(sizeof(struct ir_op), 1);
+ op = (ir_op *) zmalloc(sizeof(struct ir_op));
if (!op)
return NULL;
op->op = IR_OP_LOAD;
if (!op)
return NULL;
op->op = IR_OP_LOAD;
- op = (ir_op *) calloc(sizeof(struct ir_op), 1);
+ op = (ir_op *) zmalloc(sizeof(struct ir_op));
if (!op)
return NULL;
op->op = IR_OP_LOAD;
if (!op)
return NULL;
op->op = IR_OP_LOAD;
node = load_expression_get_forward_chain(node);
if (!node)
return NULL;
node = load_expression_get_forward_chain(node);
if (!node)
return NULL;
- load_exp = (ir_load_expression *) calloc(sizeof(struct ir_load_expression), 1);
+ load_exp = (ir_load_expression *) zmalloc(sizeof(struct ir_load_expression));
if (!load_exp)
return NULL;
/* Root */
if (!load_exp)
return NULL;
/* Root */
- load_exp_op = (ir_load_expression_op *) calloc(sizeof(struct ir_load_expression_op), 1);
+ load_exp_op = (ir_load_expression_op *) zmalloc(sizeof(struct ir_load_expression_op));
if (!load_exp_op)
goto error;
load_exp->child = load_exp_op;
if (!load_exp_op)
goto error;
load_exp->child = load_exp_op;
struct filter_node *bracket_node;
prev_op = load_exp_op;
struct filter_node *bracket_node;
prev_op = load_exp_op;
- load_exp_op = (ir_load_expression_op *) calloc(sizeof(struct ir_load_expression_op), 1);
+ load_exp_op = (ir_load_expression_op *) zmalloc(sizeof(struct ir_load_expression_op));
if (!load_exp_op)
goto error;
prev_op->next = load_exp_op;
if (!load_exp_op)
goto error;
prev_op->next = load_exp_op;
fprintf(stderr, "[error] Expecting constant index in array expression\n");
goto error;
}
fprintf(stderr, "[error] Expecting constant index in array expression\n");
goto error;
}
- load_exp_op = (ir_load_expression_op *) calloc(sizeof(struct ir_load_expression_op), 1);
+ load_exp_op = (ir_load_expression_op *) zmalloc(sizeof(struct ir_load_expression_op));
if (!load_exp_op)
goto error;
prev_op->next = load_exp_op;
if (!load_exp_op)
goto error;
prev_op->next = load_exp_op;
}
/* Add final load field */
prev_op = load_exp_op;
}
/* Add final load field */
prev_op = load_exp_op;
- load_exp_op = (ir_load_expression_op *) calloc(sizeof(struct ir_load_expression_op), 1);
+ load_exp_op = (ir_load_expression_op *) zmalloc(sizeof(struct ir_load_expression_op));
if (!load_exp_op)
goto error;
prev_op->next = load_exp_op;
if (!load_exp_op)
goto error;
prev_op->next = load_exp_op;
- op = (ir_op *) calloc(sizeof(struct ir_op), 1);
+ op = (ir_op *) zmalloc(sizeof(struct ir_op));
if (!op)
return NULL;
op->op = IR_OP_LOAD;
if (!op)
return NULL;
op->op = IR_OP_LOAD;
- op = (ir_op *) calloc(sizeof(struct ir_op), 1);
+ op = (ir_op *) zmalloc(sizeof(struct ir_op));
if (!op)
return NULL;
op->op = IR_OP_UNARY;
if (!op)
return NULL;
op->op = IR_OP_UNARY;
- op = (ir_op *) calloc(sizeof(struct ir_op), 1);
+ op = (ir_op *) zmalloc(sizeof(struct ir_op));
if (!op)
return NULL;
op->op = IR_OP_BINARY;
if (!op)
return NULL;
op->op = IR_OP_BINARY;
- op = (ir_op *) calloc(sizeof(struct ir_op), 1);
+ op = (ir_op *) zmalloc(sizeof(struct ir_op));
if (!op)
return NULL;
op->op = IR_OP_LOGICAL;
if (!op)
return NULL;
op->op = IR_OP_LOGICAL;
- op = (ir_op *) calloc(sizeof(struct ir_op), 1);
+ op = (ir_op *) zmalloc(sizeof(struct ir_op));
if (!op)
return NULL;
op->op = IR_OP_BINARY;
if (!op)
return NULL;
op->op = IR_OP_BINARY;