From: Tobias Oetiker Date: Sat, 23 Mar 2002 08:53:31 +0000 (+0000) Subject: Move CDEF start pointers if start of cdef is a step ahead of the start X-Git-Tag: 1.2rc1~234 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f361676cf5655b70fd31fa2821adf150ef88587;p=thirdparty%2Frrdtool-1.x.git Move CDEF start pointers if start of cdef is a step ahead of the start of the data -- Ashok Mandala git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@100 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 04cdc547..166d5624 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -816,6 +816,17 @@ printf("DEBUG: value from vdef is %f\n",im->gdes[ptr].vf.val); } /* if OP_VARIABLE */ } /* loop through all rpi */ + /* move the data pointers to the correct period */ + for(rpi=0;im->gdes[gdi].rpnp[rpi].op != OP_END;rpi++){ + if(im->gdes[gdi].rpnp[rpi].op == OP_VARIABLE){ + long ptr = im->gdes[gdi].rpnp[rpi].ptr; + if(im->gdes[gdi].start > im->gdes[ptr].start) { + im->gdes[gdi].rpnp[rpi].data += im->gdes[gdi].rpnp[rpi].ds_cnt; + } + } + } + + if(steparray == NULL){ rrd_set_error("rpn expressions without DEF" " or CDEF variables are not supported");