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
@@ -769,7 +769,7 @@ function Encode.encode(src: Source, opts: Options): (buffer?, string?)
|
||||
local mbuf = buffer.create(bs * ch * mbytes)
|
||||
local scale = POW[bps]
|
||||
local maxv, minv = scale - 1, -scale
|
||||
local X = table.create(ch)
|
||||
local X: { { number } } = table.create(ch) :: any
|
||||
for c = 1, ch do
|
||||
X[c] = table.create(bs, 0)
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ local floor = math.floor
|
||||
|
||||
-- encode(audio | decoder, opts) -> buffer | nil, Err
|
||||
function Encode.encode(value: any, opts: Options?): (buffer?, Err.Err?)
|
||||
local o = opts or {}
|
||||
local o: Options = opts or {}
|
||||
local src, serr = Pcm.source(value)
|
||||
if not src then
|
||||
return nil, serr
|
||||
|
||||
@@ -604,7 +604,7 @@ function Encode.encode(src: Source, opts: Options): (buffer?, string?)
|
||||
local plan = Mdct.new(N) :: Mdct.Plan
|
||||
local win = Mdct.window("vorbis", N) :: { number }
|
||||
-- input ring: per channel the samples of the current frame [k*1024 - 1024, k*1024 + 1024)
|
||||
local frame = table.create(ch)
|
||||
local frame: { { number } } = table.create(ch) :: any
|
||||
for c = 1, ch do
|
||||
frame[c] = table.create(N, 0)
|
||||
end
|
||||
@@ -617,8 +617,8 @@ function Encode.encode(src: Source, opts: Options): (buffer?, string?)
|
||||
end
|
||||
end
|
||||
local blk = table.create(N, 0)
|
||||
local X = table.create(ch)
|
||||
local R = table.create(ch)
|
||||
local X: { { number } } = table.create(ch) :: any
|
||||
local R: { { number } } = table.create(ch) :: any
|
||||
for c = 1, ch do
|
||||
X[c] = table.create(N2, 0)
|
||||
R[c] = table.create(N2, 0)
|
||||
|
||||
Reference in new issue
Block a user