diff --git a/include/villas/hist.h b/include/villas/hist.h index 234b83074..c68a066c5 100644 --- a/include/villas/hist.h +++ b/include/villas/hist.h @@ -44,7 +44,7 @@ struct hist { }; /** Initialize struct hist with supplied values and allocate memory for buckets. */ -int hist_create(struct hist *h, double start, double end, double resolution); +int hist_init(struct hist *h, double start, double end, double resolution); /** Free the dynamically allocated memory. */ int hist_destroy(struct hist *h); @@ -79,8 +79,6 @@ char * hist_dump(struct hist *h); /** Prints Matlab struct containing all infos to file. */ int hist_dump_matlab(struct hist *h, FILE *f); -#ifdef WITH_JANSSON int hist_dump_json(struct hist *h, FILE *f); json_t * hist_json(struct hist *h); -#endif \ No newline at end of file diff --git a/lib/hist.c b/lib/hist.c index 8595c4834..e45ad2c8a 100644 --- a/lib/hist.c +++ b/lib/hist.c @@ -17,7 +17,7 @@ #define VAL(h, i) ((h)->low + (i) * (h)->resolution) #define INDEX(h, v) round((v - (h)->low) / (h)->resolution) -int hist_create(struct hist *h, double low, double high, double resolution) +int hist_init(struct hist *h, double low, double high, double resolution) { h->low = low; h->high = high; diff --git a/lib/stats.c b/lib/stats.c index c5b995cab..492c51635 100644 --- a/lib/stats.c +++ b/lib/stats.c @@ -36,7 +36,7 @@ int stats_init(struct stats *s) { for (int i = 0; i < STATS_COUNT; i++) { struct stats_desc *desc = &stats_table[i]; - hist_create(&s->histograms[i], desc->hist.min, desc->hist.max, desc->hist.resolution); + hist_init(&s->histograms[i], desc->hist.min, desc->hist.max, desc->hist.resolution); } s->delta = alloc(sizeof(struct stats_delta));