Lua 5.3+ compat fixes

This commit is contained in:
Simone Mainardi 2018-11-26 14:57:58 +01:00
parent 5a9f75dd0a
commit 12d4f54c9e
4 changed files with 10 additions and 10 deletions

View file

@ -192,7 +192,7 @@ function rrd_interval_integrate(epoch_start, epoch_end, resolution, start, rawda
if start < epoch_start then
local toskip = math.min(math.ceil((epoch_start - start) / rawstep), npoints)
local prevtime = start + rawstep * (toskip-1)
local alignment = (1 - (epoch_start - prevtime) / rawstep)
local alignment = math.floor((1 - (epoch_start - prevtime) / rawstep))
-- skip starting rows
src_idx = toskip + 1
@ -225,7 +225,7 @@ function rrd_interval_integrate(epoch_start, epoch_end, resolution, start, rawda
--~ tprint(prefix_t)
-- Calculate the time fraction belonging to previous step
prefix_slice = prefix_t / rawstep
prefix_slice = math.floor(prefix_t / rawstep)
times[dst_idx] = time_sum
for_each_counter_do_update(integer_ctrs, c_dump_slice)