ws-cleanup: type diagnostics 1109 -> 94 unique; lint gate against tools/lint_types_baseline.txt
ws/cleanup-types (merged before) annotated Types, init, core, codecs, containers, ops, host and the formats; this commit fixes the rest in the modules ws-cleanup added (AudioOps, Resample, Vorbis / FLAC / Opus encoders). tools/lint.sh now counts unique diagnostics (the analyzer printed every required src module twice: master's '2499' was 1109 unique) and fails when the count rises above tools/lint_types_baseline.txt (94); LINT_TYPES_UPDATE=1 lowers it.
This commit is contained in:
1 parent
8baa1f1388
commit
3243404374
7 files changed
+39
-24
No files matched your search
@@ -207,7 +207,7 @@ local TO_STEREO: { [string]: { number } } = {
|
||||
|
||||
-- matrix(from, to) -> m[o][i]: output channel o = sum m[o][i] * input i
|
||||
local function matrix(from: number, to: number): { { number } }
|
||||
local m = table.create(to)
|
||||
local m: { { number } } = table.create(to) :: any
|
||||
for o = 1, to do
|
||||
m[o] = table.create(from, 0)
|
||||
end
|
||||
@@ -220,7 +220,7 @@ local function matrix(from: number, to: number): { { number } }
|
||||
local inL, outL = LAYOUT[from], LAYOUT[to]
|
||||
if to < from and inL and outL and to <= 2 then
|
||||
-- down to stereo (then mono = the average of the two)
|
||||
local l, r = table.create(from, 0), table.create(from, 0)
|
||||
local l: { number }, r: { number } = table.create(from, 0), table.create(from, 0)
|
||||
local sl, sr = 0, 0
|
||||
for i, sp in inL do
|
||||
local w = TO_STEREO[sp] or { 0, 0 }
|
||||
@@ -266,10 +266,11 @@ local function matrix(from: number, to: number): { { number } }
|
||||
local o = outIdx[sp]
|
||||
if o then
|
||||
m[o][i] = 1
|
||||
elseif to < from and outIdx.FL and outIdx.FR then
|
||||
elseif to < from and outIdx.FL ~= nil and outIdx.FR ~= nil then
|
||||
local w = TO_STEREO[sp] or { 0, 0 }
|
||||
m[outIdx.FL][i] += w[1]
|
||||
m[outIdx.FR][i] += w[2]
|
||||
local fl, fr = outIdx.FL :: number, outIdx.FR :: number
|
||||
m[fl][i] += w[1]
|
||||
m[fr][i] += w[2]
|
||||
end
|
||||
end
|
||||
if to < from then
|
||||
|
||||
Reference in new issue
Block a user