- Fixes the following clang compiler warnings:
rrd_rpncalc.c:999:11: warning: using integer absolute value function
'abs' when argument is of floating point type [-Wabsolute-value]
if (abs(percentile) > 100) {
rrd_rpncalc.c:1103:24: warning: using integer absolute value function
'abs' when argument is of floating point type [-Wabsolute-value]
int idx = round(abs(idxf));
rrd_hw.c:519:36: warning: absolute value function 'abs' given an
argument of type 'long' but has parameter of type 'int' which may
cause truncation of value [-Wabsolute-value]
new_val = ((unsigned long) abs(val)) % mod;
unsigned long new_val;
if (val < 0)
- new_val = ((unsigned long) abs(val)) % mod;
+ new_val = ((unsigned long) labs(val)) % mod;
else
new_val = (val % mod);
if (rpnp[rpi].op == OP_PREDICTPERC) {
stackunderflow(1);
percentile = rpnstack->s[--stptr];
- if (abs(percentile) > 100) {
+ if (fabs(percentile) > 100) {
rrd_set_error("unsupported percentile: %f",percentile);
return -1;
}
/* get the percentile selected */
double idxf = percentile * ((float)count-1.0);
if (percentile < 0) { /* take the next best */
- int idx = round(abs(idxf));
+ int idx = round(fabs(idxf));
val = extra[idx];
} else { /* interpolate */
int idx = floor(idxf);