[rrd-users] CDEF,RPN, no decimal constant possible?

Tobias Oetiker tobi at oetiker.ch
Fri Jul 11 14:17:11 CEST 2014


Hi Steve,

the reason for this is, that the space for storing COMPUTE
instructions is rather limited. things to observe when patching
this:

a) backward compatibility
b) space constraints

maybe an option would be to just throw an error when someone tries
to put a non integer number into a compute rule

cheers
tobi

Today Steve Shipway wrote:

> >[constants in the RPN are stored in doubles, but COMPUTE type DS convert using...]
> >
> >typedef struct rpn_cdefds_t {
> >    char      op;       /* rpn operator type */
> >    short     val;      /* used by OP_NUMBER and OP_VARIABLE */
> >} rpn_cdefds_t;
> >
> >Now val is only a short int.
>
> Well spotted!  I saw the first struct used doubles, but didn't dig deeply enough to spot this one.
>
> I would say this is a bug; however, there might be a reason for it, if Tobi can tell us?
>
> Otherwise, it should probably be a double and not a short -- making a patch for rrdtool should be simple.
>
> Steve
>
> Steve Shipway
> University of Auckland ITS
> UNIX Systems Design Lead
> s.shipway at auckland.ac.nz
> Ph: +64 9 373 7599 ext 86487
>
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
www.oetiker.ch tobi at oetiker.ch +41 62 775 9902



More information about the rrd-users mailing list