projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
search for tcpd.h with <>
[rrdtool.git]
/
src
/
rrd_rpncalc.c
diff --git
a/src/rrd_rpncalc.c
b/src/rrd_rpncalc.c
index
c1a61c2
..
2bd1474
100644
(file)
--- a/
src/rrd_rpncalc.c
+++ b/
src/rrd_rpncalc.c
@@
-33,8
+33,8
@@
short rpn_compact(
while (rpnp[*count].op != OP_END)
(*count)++;
if (++(*count) > DS_CDEF_MAX_RPN_NODES) {
while (rpnp[*count].op != OP_END)
(*count)++;
if (++(*count) > DS_CDEF_MAX_RPN_NODES) {
- rrd_set_error("Maximum %d RPN nodes permitted",
- DS_CDEF_MAX_RPN_NODES);
+ rrd_set_error("Maximum %d RPN nodes permitted
. Got %d RPN nodes at present.
",
+ DS_CDEF_MAX_RPN_NODES
-1,(*count)-1
);
return -1;
}
return -1;
}
@@
-236,9
+236,11
@@
void parseCDEF_DS(
* occur too often. */
for (i = 0; rpnp[i].op != OP_END; i++) {
if (rpnp[i].op == OP_TIME || rpnp[i].op == OP_LTIME ||
* occur too often. */
for (i = 0; rpnp[i].op != OP_END; i++) {
if (rpnp[i].op == OP_TIME || rpnp[i].op == OP_LTIME ||
- rpnp[i].op == OP_PREV || rpnp[i].op == OP_COUNT) {
+ rpnp[i].op == OP_PREV || rpnp[i].op == OP_COUNT ||
+ rpnp[i].op == OP_TREND || rpnp[i].op == OP_TRENDNAN ||
+ rpnp[i].op == OP_PREDICT || rpnp[i].op == OP_PREDICTSIGMA ) {
rrd_set_error
rrd_set_error
- ("operators
time, ltime, prev and count
not supported with DS COMPUTE");
+ ("operators
TIME, LTIME, PREV COUNT TREND TRENDNAN PREDICT PREDICTSIGMA are
not supported with DS COMPUTE");
free(rpnp);
return;
}
free(rpnp);
return;
}
@@
-881,7
+883,7
@@
short rpn_calc(
time_t dur = (time_t) rpnstack->s[stptr];
time_t step = (time_t) rpnp[rpi - 2].step;
time_t dur = (time_t) rpnstack->s[stptr];
time_t step = (time_t) rpnp[rpi - 2].step;
- if (output_idx
>
(int) ceil((float) dur / (float) step)) {
+ if (output_idx
+ 1 >=
(int) ceil((float) dur / (float) step)) {
int ignorenan = (rpnp[rpi].op == OP_TREND);
double accum = 0.0;
int i = 0;
int ignorenan = (rpnp[rpi].op == OP_TREND);
double accum = 0.0;
int i = 0;