Commit 6ebe6eb1 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Re-instate the explicit casts after malloc in proxy.c that had disappeared by...

Re-instate the explicit casts after malloc in proxy.c that had disappeared by mistake in a bad merge. Matthieu be more carefulgit status!
parent 0bffc309
...@@ -147,14 +147,15 @@ void proxy_addcell_in(struct proxy *p, struct cell *c, int type) { ...@@ -147,14 +147,15 @@ void proxy_addcell_in(struct proxy *p, struct cell *c, int type) {
p->size_cells_in *= proxy_buffgrow; p->size_cells_in *= proxy_buffgrow;
struct cell **temp_cell; struct cell **temp_cell;
if ((temp_cell = malloc(sizeof(struct cell *) * p->size_cells_in)) == NULL) if ((temp_cell = (struct cell **)malloc(sizeof(struct cell *) *
p->size_cells_in)) == NULL)
error("Failed to allocate incoming cell list."); error("Failed to allocate incoming cell list.");
memcpy(temp_cell, p->cells_in, sizeof(struct cell *) * p->nr_cells_in); memcpy(temp_cell, p->cells_in, sizeof(struct cell *) * p->nr_cells_in);
free(p->cells_in); free(p->cells_in);
p->cells_in = temp_cell; p->cells_in = temp_cell;
int *temp_type; int *temp_type;
if ((temp_type = malloc(sizeof(int) * p->size_cells_in)) == NULL) if ((temp_type = (int *)malloc(sizeof(int) * p->size_cells_in)) == NULL)
error("Failed to allocate incoming cell type list."); error("Failed to allocate incoming cell type list.");
memcpy(temp_type, p->cells_in_type, sizeof(int) * p->nr_cells_in); memcpy(temp_type, p->cells_in_type, sizeof(int) * p->nr_cells_in);
free(p->cells_in_type); free(p->cells_in_type);
...@@ -192,14 +193,15 @@ void proxy_addcell_out(struct proxy *p, struct cell *c, int type) { ...@@ -192,14 +193,15 @@ void proxy_addcell_out(struct proxy *p, struct cell *c, int type) {
p->size_cells_out *= proxy_buffgrow; p->size_cells_out *= proxy_buffgrow;
struct cell **temp_cell; struct cell **temp_cell;
if ((temp_cell = malloc(sizeof(struct cell *) * p->size_cells_out)) == NULL) if ((temp_cell = (struct cell **)malloc(sizeof(struct cell *) *
p->size_cells_out)) == NULL)
error("Failed to allocate outgoing cell list."); error("Failed to allocate outgoing cell list.");
memcpy(temp_cell, p->cells_out, sizeof(struct cell *) * p->nr_cells_out); memcpy(temp_cell, p->cells_out, sizeof(struct cell *) * p->nr_cells_out);
free(p->cells_out); free(p->cells_out);
p->cells_out = temp_cell; p->cells_out = temp_cell;
int *temp_type; int *temp_type;
if ((temp_type = malloc(sizeof(int) * p->size_cells_out)) == NULL) if ((temp_type = (int *)malloc(sizeof(int) * p->size_cells_out)) == NULL)
error("Failed to allocate outgoing cell type list."); error("Failed to allocate outgoing cell type list.");
memcpy(temp_type, p->cells_out_type, sizeof(int) * p->nr_cells_out); memcpy(temp_type, p->cells_out_type, sizeof(int) * p->nr_cells_out);
free(p->cells_out_type); free(p->cells_out_type);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment