diff --git a/src/Formats/audio/aac/init.luau b/src/Formats/audio/aac/init.luau index 6c3e45d..84ded12 100644 --- a/src/Formats/audio/aac/init.luau +++ b/src/Formats/audio/aac/init.luau @@ -136,7 +136,7 @@ local function index(r: Bytes.Reader, maxFrames: number): ({ number }, { number end function AacFormat.open(r: Bytes.Reader, opts: DecodeOptions?): (Types.Decoder?, Err.Err?) - local o = opts or {} + local o: DecodeOptions = opts or {} local offs, sizes, first, ierr = index(r, o.maxFrames or 2 ^ 22) if ierr then return nil, ierr diff --git a/src/Formats/audio/mp3/Index.luau b/src/Formats/audio/mp3/Index.luau index 97ca48f..ae84e7f 100644 --- a/src/Formats/audio/mp3/Index.luau +++ b/src/Formats/audio/mp3/Index.luau @@ -101,7 +101,7 @@ function Index.build(b: buffer, start: number, stop: number): Index? if first then first = false - hz, nch, layer, spf = fHz, fCh, fLayer, Header.frameSamples(h1) + hz, nch, layer, spf = fHz, fCh, fLayer, Header.frameSamples(h1) :: number version = if band(h1, 8) ~= 0 then 1 elseif band(h1, 0x10) ~= 0 then 2 else 2.5 if fLayer == 3 then local ret, frames, d, p = Core.vbrTag(b, pos, fs) @@ -150,7 +150,7 @@ function Index.build(b: buffer, start: number, stop: number): Index? end if n == cap then cap *= 2 - OFF, SIZE, FLAGS, OUT, MAIN = grow(OFF, cap * 4), grow(SIZE, cap * 2), grow(FLAGS, cap), grow(OUT, cap * 4), grow(MAIN, cap * 2) + OFF, SIZE, FLAGS, OUT, MAIN = grow(OFF, cap * 4), grow(SIZE, cap * 2), grow(FLAGS, cap), grow(OUT, cap * 4), grow(MAIN, cap * 2) :: buffer end buffer.writeu32(OFF, n * 4, pos) buffer.writeu16(SIZE, n * 2, fs) diff --git a/src/Formats/codecs/TrueType/Tables.luau b/src/Formats/codecs/TrueType/Tables.luau index 87e5833..7287007 100644 --- a/src/Formats/codecs/TrueType/Tables.luau +++ b/src/Formats/codecs/TrueType/Tables.luau @@ -452,7 +452,7 @@ local function macRoman(b: buffer, o: number, n: number): string return table.concat(out) end -local NAME_IDS = { +local NAME_IDS: { [number]: string } = { [0] = "copyright", [1] = "family", [2] = "style", @@ -486,7 +486,7 @@ function Tables.names(b: buffer, o: number, n: number): { [string]: string } local len, off = u16(b, r + 8), u16(b, r + 10) local key = NAME_IDS[nid] if key and strings + off + len <= o + n then - local rk, s = 0, nil + local rk: number, s: string? = 0, nil if pid == 3 and (eid == 1 or eid == 10 or eid == 0) then rk = if lang == 0x409 then 4 else 2 s = utf16be(b, strings + off, len) diff --git a/tests/ops/imageops.luau b/tests/ops/imageops.luau index 2662d0d..c09dec7 100644 --- a/tests/ops/imageops.luau +++ b/tests/ops/imageops.luau @@ -43,7 +43,7 @@ do local ga = Ops.convert(rgba, "gray8") :: any t:check(buffer.tostring(ga.pixels) == Fx.graya, "rgba8 -> gray8 matches Pillow (alpha ignored)") local gray = Ops.convert(rgb, "gray8") :: any - local worst = { nearest = 0, bilinear = 0, lanczos = 0 } + local worst: { [string]: number } = { nearest = 0, bilinear = 0, lanczos = 0 } for _, c in Fx.resize do local src = if c.mode == "RGB" then rgb else gray local r = Ops.resize(src, c.w, c.h, c.filter) :: any