ws-cleanup-types: archive, audio, data, font, image, layered, music, playlist, subtitle, vector, video: annotations, casts, one value per re-assignment where the solver loses the type
This commit is contained in:
1 parent
dc98aec2ec
commit
f459b2dcdf
44 files changed
+172
-119
No files matched your search
@@ -153,7 +153,7 @@ function Render.timeline(midi: Types.Midi): Timeline
|
||||
end
|
||||
return a[3] < b[3]
|
||||
end)
|
||||
local tl: Timeline = { time = table.create(#items), status = table.create(#items), d1 = table.create(#items), d2 = table.create(#items), length = Render.length(midi) }
|
||||
local tl: Timeline = { time = table.create(#items) :: { number }, status = table.create(#items) :: { number }, d1 = table.create(#items) :: { number }, d2 = table.create(#items) :: { number }, length = Render.length(midi) }
|
||||
for i, it in items do
|
||||
tl.time[i], tl.status[i], tl.d1[i], tl.d2[i] = it[1], it[4], it[5] % 128, it[6] % 128
|
||||
end
|
||||
@@ -192,7 +192,7 @@ function Render.decoder(midi: Types.Midi, opts: RenderOptions?): (Types.Decoder?
|
||||
local tail = o.tail or 1
|
||||
local frames = math.max(0, math.ceil((tl.length + tail) * rate))
|
||||
local nev = #tl.time
|
||||
local evFrame = table.create(nev)
|
||||
local evFrame: { number } = table.create(nev) :: { number }
|
||||
for i = 1, nev do
|
||||
evFrame[i] = math.floor(tl.time[i] * rate + 0.5)
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ export type WriteOptions = {
|
||||
}
|
||||
|
||||
local function bytesOf(b: buffer, p: number, n: number): { number }
|
||||
local t: { number } = table.create(n)
|
||||
local t: { number } = table.create(n) :: { number }
|
||||
for i = 0, n - 1 do
|
||||
t[i + 1] = readu8(b, p + i)
|
||||
end
|
||||
@@ -309,7 +309,7 @@ function Smf.write(midi: Types.Midi, opts: WriteOptions?): (buffer?, Err.Err?)
|
||||
end
|
||||
last = ev.tick
|
||||
end
|
||||
local list = events
|
||||
local list: { any } = events
|
||||
if not sorted then
|
||||
list = table.clone(events)
|
||||
local order: { [any]: number } = {}
|
||||
|
||||
@@ -204,7 +204,8 @@ function S3m.decode(r: Bytes.Reader, opts: DecodeOptions?): (any, Err.Err?)
|
||||
vol = math.min(pr:u8(), 64) + 1
|
||||
end
|
||||
if bit32.band(what, 0x80) ~= 0 then
|
||||
cmd, info = pr:u8(), pr:u8()
|
||||
cmd = pr:u8()
|
||||
info = pr:u8()
|
||||
if cmd > 26 then
|
||||
cmd, info = 0, 0
|
||||
end
|
||||
|
||||
@@ -149,7 +149,11 @@ function Xm.decode(r: Bytes.Reader, opts: DecodeOptions?): (any, Err.Err?)
|
||||
param = pr:u8()
|
||||
end
|
||||
else
|
||||
note, ins, vol, fx, param = b, pr:u8(), pr:u8(), pr:u8(), pr:u8()
|
||||
note = b
|
||||
ins = pr:u8()
|
||||
vol = pr:u8()
|
||||
fx = pr:u8()
|
||||
param = pr:u8()
|
||||
end
|
||||
if pr.err then
|
||||
break -- a short pattern: the rest stays empty
|
||||
|
||||
Reference in new issue
Block a user