From 00151562145df50cc65e9902d52d5fa77f89fe50 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 9 Jun 2022 06:52:47 +0200 Subject: Merging upstream version 1.35.0. Signed-off-by: Daniel Baumann --- web/api/queries/max/max.c | 15 ++++++--------- web/api/queries/max/max.h | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'web/api/queries/max') diff --git a/web/api/queries/max/max.c b/web/api/queries/max/max.c index a4be36add..b6e723314 100644 --- a/web/api/queries/max/max.c +++ b/web/api/queries/max/max.c @@ -10,9 +10,8 @@ struct grouping_max { size_t count; }; -void *grouping_create_max(RRDR *r) { - (void)r; - return callocz(1, sizeof(struct grouping_max)); +void grouping_create_max(RRDR *r) { + r->internal.grouping_data = callocz(1, sizeof(struct grouping_max)); } // resets when switches dimensions @@ -29,13 +28,11 @@ void grouping_free_max(RRDR *r) { } void grouping_add_max(RRDR *r, calculated_number value) { - if(!isnan(value)) { - struct grouping_max *g = (struct grouping_max *)r->internal.grouping_data; + struct grouping_max *g = (struct grouping_max *)r->internal.grouping_data; - if(!g->count || calculated_number_fabs(value) > calculated_number_fabs(g->max)) { - g->max = value; - g->count++; - } + if(!g->count || calculated_number_fabs(value) > calculated_number_fabs(g->max)) { + g->max = value; + g->count++; } } diff --git a/web/api/queries/max/max.h b/web/api/queries/max/max.h index d839fe3f9..7b606ce34 100644 --- a/web/api/queries/max/max.h +++ b/web/api/queries/max/max.h @@ -6,7 +6,7 @@ #include "../query.h" #include "../rrdr.h" -extern void *grouping_create_max(RRDR *r); +extern void grouping_create_max(RRDR *r); extern void grouping_reset_max(RRDR *r); extern void grouping_free_max(RRDR *r); extern void grouping_add_max(RRDR *r, calculated_number value); -- cgit v1.2.3