int cf_id = -1;
int token_min = 4;
const char *parsetime_error = NULL;
-
+ double tmpdbl;
+
memset(rra_def, 0, sizeof(rra_def_t));
argvcopy = strdup(def);
rrd_set_error("Invalid row count %s: %s", token, parsetime_error);
break;
default:
- double xff;
- if (rrd_strtodbl(token, NULL, &xff, NULL) != 2
- || xff < 0.0 || xff >= 1.0 ){
+ if (rrd_strtodbl(token, NULL, &tmpdbl, NULL) != 2
+ || tmpdbl < 0.0 || tmpdbl >= 1.0 ){
rrd_set_error
("Invalid xff: must be between 0 and 1");
}
- rra_def->par[RRA_cdp_xff_val].u_val = xff;
+ rra_def->par[RRA_cdp_xff_val].u_val = tmpdbl;
break;
}
break;
(rra_def->cf_nam)) {
case CF_HWPREDICT:
case CF_MHWPREDICT:
- double hw_alpha;
- if (rrd_strtodbl(token, NULL, &hw_alpha, NULL) != 2
- || hw_alpha <= 0.0 || hw_alpha >= 1.0){
+ if (rrd_strtodbl(token, NULL, &tmpdbl, NULL) != 2
+ || tmpdbl <= 0.0 || tmpdbl >= 1.0){
rrd_set_error
("Invalid alpha: must be between 0 and 1");
}
- rra_def->par[RRA_hw_alpha].u_val = hw_alpha;
+ rra_def->par[RRA_hw_alpha].u_val = tmpdbl;
break;
case CF_DEVSEASONAL:
case CF_SEASONAL:
- double gamma;
- if (rrd_strtodbl(token, NULL, &gamma, NULL) != 2
- || gamma <= 0.0 || gamma >= 1.0){
+ if (rrd_strtodbl(token, NULL, &tmpdbl, NULL) != 2
+ || tmpdbl <= 0.0 || tmpdbl >= 1.0){
rrd_set_error
("Invalid gamma: must be between 0 and 1");
}
- rra_def->par[RRA_seasonal_gamma].u_val = gamma;
+ rra_def->par[RRA_seasonal_gamma].u_val = tmpdbl;
rra_def->par[RRA_seasonal_smooth_idx].u_cnt =
hash % rra_def->row_cnt;
break;
switch (cf_conv(rra_def->cf_nam)) {
case CF_HWPREDICT:
case CF_MHWPREDICT:
- double beta;
- if (rrd_strtodbl(token, NULL, &beta, NULL) != 2
- || beta < 0.0 || beta > 1.0){
+ if (rrd_strtodbl(token, NULL, &tmpdbl, NULL) != 2
+ || tmpdbl < 0.0 || tmpdbl > 1.0){
rrd_set_error
("Invalid beta: must be between 0 and 1");
}
- rra_def->par[RRA_hw_beta].u_val = beta;
+ rra_def->par[RRA_hw_beta].u_val = tmpdbl;
break;
case CF_DEVSEASONAL:
case CF_SEASONAL: