diff options
author | Angelo Mantellini <manangel@cisco.com> | 2019-02-05 08:50:26 +0100 |
---|---|---|
committer | Angelo Mantellini <manangel@cisco.com> | 2019-02-06 16:23:04 +0100 |
commit | 9f68541e0f55495d61dd9e583bec38740a247597 (patch) | |
tree | 55519e34159ac1eb691e080e4c1eab5b0e4847bd /libparc/parc/statistics | |
parent | b77148ddc3def71e6c412c3afb5f1c20be2d77cd (diff) |
[HICN-26] Windows compatibilty for libparc
Change-Id: I6ebff82a81a2bf42fa3bf210ff0e6e530ce21915
Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'libparc/parc/statistics')
-rw-r--r--[-rwxr-xr-x] | libparc/parc/statistics/parc_BasicStats.h | 0 | ||||
-rw-r--r-- | libparc/parc/statistics/parc_EWMA.c | 6 | ||||
-rw-r--r--[-rwxr-xr-x] | libparc/parc/statistics/parc_EWMA.h | 0 |
3 files changed, 3 insertions, 3 deletions
diff --git a/libparc/parc/statistics/parc_BasicStats.h b/libparc/parc/statistics/parc_BasicStats.h index 5f82e582..5f82e582 100755..100644 --- a/libparc/parc/statistics/parc_BasicStats.h +++ b/libparc/parc/statistics/parc_BasicStats.h diff --git a/libparc/parc/statistics/parc_EWMA.c b/libparc/parc/statistics/parc_EWMA.c index 92046ac2..911aba34 100644 --- a/libparc/parc/statistics/parc_EWMA.c +++ b/libparc/parc/statistics/parc_EWMA.c @@ -93,7 +93,7 @@ parcEWMA_Compare(const PARCEWMA *instance, const PARCEWMA *other) } else if (other == NULL) { result = 1; } else { - result = instance->value - other->value; + result = (int)(instance->value - other->value); } return result; @@ -132,7 +132,7 @@ parcEWMA_Equals(const PARCEWMA *x, const PARCEWMA *y) } else { if (x->initialized == y->initialized) { if (_parcEWMA_FloatEquals(x->coefficient, y->coefficient, 0.00001)) { - if (_parcEWMA_FloatEquals(x->value, y->value, 0.00001)) { + if (_parcEWMA_FloatEquals((double)(x->value), (double)(y->value), 0.00001)) { result = true; } } @@ -192,7 +192,7 @@ parcEWMA_Update(PARCEWMA *ewma, const int64_t value) double x = (ewma->coefficient * value); double y = (ewma->coefficient_r * ewma->value); - ewma->value = x + y; + ewma->value = (int64_t)(x + y); } else { ewma->value = value; ewma->initialized = true; diff --git a/libparc/parc/statistics/parc_EWMA.h b/libparc/parc/statistics/parc_EWMA.h index bbcb53df..bbcb53df 100755..100644 --- a/libparc/parc/statistics/parc_EWMA.h +++ b/libparc/parc/statistics/parc_EWMA.h |