{
difference = curr_counter - prev_counter;
}
- rate = ((double) difference) / ((double) vl->interval);
+ rate = ((double) difference) / CDTIME_T_TO_DOUBLE (vl->interval);
/* Modify the rate. */
if (!isnan (data->factor))
rate += data->offset;
/* Calculate the internal counter. */
- int_fraction += (rate * ((double) vl->interval));
+ int_fraction += (rate * CDTIME_T_TO_DOUBLE (vl->interval));
difference = (uint64_t) int_fraction;
int_fraction -= ((double) difference);
int_counter += difference;
/* Calcualte the rate */
difference = curr_derive - prev_derive;
- rate = ((double) difference) / ((double) vl->interval);
+ rate = ((double) difference) / CDTIME_T_TO_DOUBLE (vl->interval);
/* Modify the rate. */
if (!isnan (data->factor))
rate += data->offset;
/* Calculate the internal derive. */
- int_fraction += (rate * ((double) vl->interval));
+ int_fraction += (rate * CDTIME_T_TO_DOUBLE (vl->interval));
if (int_fraction < 0.0) /* handle negative integer rounding correctly */
difference = ((int64_t) int_fraction) - 1;
else
if (status != 0)
int_fraction = 0.0;
- rate = ((double) curr_absolute) / ((double) vl->interval);
+ rate = ((double) curr_absolute) / CDTIME_T_TO_DOUBLE (vl->interval);
/* Modify the rate. */
if (!isnan (data->factor))
rate += data->offset;
/* Calculate the new absolute. */
- int_fraction += (rate * ((double) vl->interval));
+ int_fraction += (rate * CDTIME_T_TO_DOUBLE (vl->interval));
curr_absolute = (uint64_t) int_fraction;
int_fraction -= ((double) curr_absolute);