X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_hw_update.c;h=90a8a5203dcf12b4a21368feb139c4ff70a73cd9;hb=28a2150521548582386dcadda9e25f8124cb0e9a;hp=89d0c8eabd7e764381c94413f89a79e6f4728238;hpb=51fcea2cbf9721f012f2f0d43c604a3aaf684ee8;p=rrdtool.git diff --git a/src/rrd_hw_update.c b/src/rrd_hw_update.c index 89d0c8e..90a8a52 100644 --- a/src/rrd_hw_update.c +++ b/src/rrd_hw_update.c @@ -2,8 +2,8 @@ * rrd_hw_update.c Functions for updating a Holt-Winters RRA ****************************************************************************/ +#include "rrd_tool.h" #include "rrd_format.h" -#include "rrd_config.h" #include "rrd_hw_math.h" #include "rrd_hw_update.h" @@ -47,6 +47,7 @@ int update_hwpredict( unsigned long dependent_rra_idx, seasonal_cdp_idx; unival *coefs = rrd->cdp_prep[cdp_idx].scratch; rra_def_t *current_rra = &(rrd->rra_def[rra_idx]); + rrd_value_t seasonal_coef; /* save coefficients from current prediction */ coefs[CDP_hw_last_intercept].u_val = coefs[CDP_hw_intercept].u_val; @@ -57,7 +58,7 @@ int update_hwpredict( dependent_rra_idx = current_rra->par[RRA_dependent_rra_idx].u_cnt; seasonal_cdp_idx = dependent_rra_idx * (rrd->stat_head->ds_cnt) + ds_idx; - rrd_value_t seasonal_coef = (dependent_rra_idx < rra_idx) + seasonal_coef = (dependent_rra_idx < rra_idx) ? rrd->cdp_prep[seasonal_cdp_idx].scratch[CDP_hw_last_seasonal].u_val : rrd->cdp_prep[seasonal_cdp_idx].scratch[CDP_hw_seasonal].u_val;