From: Ruben Kerkhof Date: Sat, 15 Dec 2018 18:07:56 +0000 (+0100) Subject: utils_db_query.c: fix some minor style issues X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c34955d26af676052d1263978873ce6ff7539f81;p=collectd.git utils_db_query.c: fix some minor style issues --- diff --git a/src/utils_db_query.c b/src/utils_db_query.c index 0279a471..81ad8b5b 100644 --- a/src/utils_db_query.c +++ b/src/utils_db_query.c @@ -347,39 +347,42 @@ static int udb_result_prepare_result(udb_result_t const *r, /* {{{ */ * r->instances_buffer, r->values_buffer, and r->metadata_buffer {{{ */ if (r->instances_num > 0) { prep_area->instances_pos = - (size_t *)calloc(r->instances_num, sizeof(size_t)); + calloc(r->instances_num, sizeof(*prep_area->instances_pos)); if (prep_area->instances_pos == NULL) { P_ERROR("udb_result_prepare_result: calloc failed."); BAIL_OUT(-ENOMEM); } prep_area->instances_buffer = - (char **)calloc(r->instances_num, sizeof(char *)); + calloc(r->instances_num, sizeof(*prep_area->instances_buffer)); if (prep_area->instances_buffer == NULL) { P_ERROR("udb_result_prepare_result: calloc failed."); BAIL_OUT(-ENOMEM); } } /* if (r->instances_num > 0) */ - prep_area->values_pos = (size_t *)calloc(r->values_num, sizeof(size_t)); + prep_area->values_pos = calloc(r->values_num, sizeof(*prep_area->values_pos)); if (prep_area->values_pos == NULL) { P_ERROR("udb_result_prepare_result: calloc failed."); BAIL_OUT(-ENOMEM); } - prep_area->values_buffer = (char **)calloc(r->values_num, sizeof(char *)); + prep_area->values_buffer = + calloc(r->values_num, sizeof(*prep_area->values_buffer)); if (prep_area->values_buffer == NULL) { P_ERROR("udb_result_prepare_result: calloc failed."); BAIL_OUT(-ENOMEM); } - prep_area->metadata_pos = (size_t *)calloc(r->metadata_num, sizeof(size_t)); + prep_area->metadata_pos = + calloc(r->metadata_num, sizeof(*prep_area->metadata_pos)); if (prep_area->metadata_pos == NULL) { P_ERROR("udb_result_prepare_result: calloc failed."); BAIL_OUT(-ENOMEM); } - prep_area->metadata_buffer = (char **)calloc(r->metadata_num, sizeof(char *)); + prep_area->metadata_buffer = + calloc(r->metadata_num, sizeof(*prep_area->metadata_buffer)); if (prep_area->metadata_buffer == NULL) { P_ERROR("udb_result_prepare_result: calloc failed."); BAIL_OUT(-ENOMEM);