summaryrefslogtreecommitdiffstats
path: root/web/api/queries/sum
diff options
context:
space:
mode:
Diffstat (limited to 'web/api/queries/sum')
-rw-r--r--web/api/queries/sum/sum.c13
-rw-r--r--web/api/queries/sum/sum.h2
2 files changed, 6 insertions, 9 deletions
diff --git a/web/api/queries/sum/sum.c b/web/api/queries/sum/sum.c
index 0da9937a..6bb012bb 100644
--- a/web/api/queries/sum/sum.c
+++ b/web/api/queries/sum/sum.c
@@ -10,9 +10,8 @@ struct grouping_sum {
size_t count;
};
-void *grouping_create_sum(RRDR *r) {
- (void)r;
- return callocz(1, sizeof(struct grouping_sum));
+void grouping_create_sum(RRDR *r) {
+ r->internal.grouping_data = callocz(1, sizeof(struct grouping_sum));
}
// resets when switches dimensions
@@ -29,11 +28,9 @@ void grouping_free_sum(RRDR *r) {
}
void grouping_add_sum(RRDR *r, calculated_number value) {
- if(!isnan(value)) {
- struct grouping_sum *g = (struct grouping_sum *)r->internal.grouping_data;
- g->sum += value;
- g->count++;
- }
+ struct grouping_sum *g = (struct grouping_sum *)r->internal.grouping_data;
+ g->sum += value;
+ g->count++;
}
calculated_number grouping_flush_sum(RRDR *r, RRDR_VALUE_FLAGS *rrdr_value_options_ptr) {
diff --git a/web/api/queries/sum/sum.h b/web/api/queries/sum/sum.h
index 9dc8d209..05cb6185 100644
--- a/web/api/queries/sum/sum.h
+++ b/web/api/queries/sum/sum.h
@@ -6,7 +6,7 @@
#include "../query.h"
#include "../rrdr.h"
-extern void *grouping_create_sum(RRDR *r);
+extern void grouping_create_sum(RRDR *r);
extern void grouping_reset_sum(RRDR *r);
extern void grouping_free_sum(RRDR *r);
extern void grouping_add_sum(RRDR *r, calculated_number value);