X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_resize.c;h=d84096cdc278962a7ac2b0528453ecfc5fd705d7;hp=32a501ad8cdb4ef088c7ba46cd96a09b3587c37a;hb=aff0a2728543eee1ac21f3fa02f171caae8d9362;hpb=82d6afdfe67c94910cf72ea0d65c7e0cd1e9af7b diff --git a/src/rrd_resize.c b/src/rrd_resize.c index 32a501a..d84096c 100644 --- a/src/rrd_resize.c +++ b/src/rrd_resize.c @@ -6,6 +6,8 @@ * Initial version by Alex van den Bogaerdt *****************************************************************************/ +#include + #include "rrd_tool.h" int rrd_resize( @@ -88,14 +90,14 @@ int rrd_resize( rrd_init(&rrdnew); /* These need to be initialised before calling rrd_open() with the RRD_CREATE flag */ - if ((rrdnew.stat_head = calloc(1, sizeof(stat_head_t))) == NULL) { + if ((rrdnew.stat_head = (stat_head_t*)calloc(1, sizeof(stat_head_t))) == NULL) { rrd_set_error("allocating stat_head for new RRD"); rrd_free(&rrdold); rrd_close(rrd_file); return (-1); } - if ((rrdnew.rra_def = malloc(sizeof(rra_def_t) * rrdold.stat_head->rra_cnt)) == NULL) { + if ((rrdnew.rra_def = (rra_def_t *)malloc(sizeof(rra_def_t) * rrdold.stat_head->rra_cnt)) == NULL) { rrd_set_error("allocating rra_def for new RRD"); rrd_free(&rrdnew); rrd_free(&rrdold); @@ -125,7 +127,7 @@ int rrd_resize( return (-1); } /*XXX: do one write for those parts of header that are unchanged */ - if ((rrdnew.rra_ptr = malloc(sizeof(rra_ptr_t) * rrdold.stat_head->rra_cnt)) == NULL) { + if ((rrdnew.rra_ptr = (rra_ptr_t *)malloc(sizeof(rra_ptr_t) * rrdold.stat_head->rra_cnt)) == NULL) { rrd_set_error("allocating rra_ptr for new RRD"); rrd_free(&rrdnew); rrd_free(&rrdold);