diff --git a/internal/cgen/builtin.go b/internal/cgen/builtin.go index fa6638ca..c68bae89 100644 --- a/internal/cgen/builtin.go +++ b/internal/cgen/builtin.go @@ -1026,7 +1026,7 @@ func (g *gen) writeBuiltinTable(b *buffer, recv *a.Expr, method t.ID, args []*a. case t.IDWidth: field = "width" - case t.IDRow: + case t.IDRowU32: // TODO: don't assume that the table is a table of base.u8. b.writes("wuffs_base__table_u8__row(") if err := g.writeExpr(b, recv, false, depth); err != nil { diff --git a/lang/builtin/builtin.go b/lang/builtin/builtin.go index 91d0c9c8..23839adc 100644 --- a/lang/builtin/builtin.go +++ b/lang/builtin/builtin.go @@ -963,7 +963,7 @@ var TableFuncs = []string{ "GENERIC T2.stride() u64", "GENERIC T2.width() u64", - "GENERIC T2.row(y: u32) T1", + "GENERIC T2.row_u32(y: u32) T1", "GENERIC T2.subtable(" + "min_incl_x: u64, min_incl_y: u64, max_incl_x: u64, max_incl_y: u64) T2", } diff --git a/lang/token/list.go b/lang/token/list.go index 313446e4..acd6e50b 100644 --- a/lang/token/list.go +++ b/lang/token/list.go @@ -668,7 +668,7 @@ const ( IDIO = ID(0x242) IDLimit = ID(0x243) IDPrefix = ID(0x244) - IDRow = ID(0x245) + IDRowU32 = ID(0x245) IDStride = ID(0x246) IDSubslice = ID(0x247) IDSubtable = ID(0x248) @@ -1094,7 +1094,7 @@ var builtInsByID = [nBuiltInIDs]string{ IDIO: "io", IDLimit: "limit", IDPrefix: "prefix", - IDRow: "row", + IDRowU32: "row_u32", IDStride: "stride", IDSubslice: "subslice", IDSubtable: "subtable", diff --git a/std/bmp/decode_bmp.wuffs b/std/bmp/decode_bmp.wuffs index 2763a137..bae1eed1 100644 --- a/std/bmp/decode_bmp.wuffs +++ b/std/bmp/decode_bmp.wuffs @@ -530,7 +530,7 @@ pri func decoder.swizzle_none!(dst: ptr base.pixel_buffer, src: base.io_reader) } } - dst = tab.row(y: this.dst_y) + dst = tab.row_u32(y: this.dst_y) if dst_bytes_per_row < dst.length() { dst = dst[.. dst_bytes_per_row] } @@ -597,7 +597,7 @@ pri func decoder.swizzle_rle!(dst: ptr base.pixel_buffer, src: base.io_reader) b rle_state = this.rle_state while.outer true { - row = tab.row(y: this.dst_y) + row = tab.row_u32(y: this.dst_y) if dst_bytes_per_row < row.length() { row = row[.. dst_bytes_per_row] } @@ -771,7 +771,7 @@ pri func decoder.swizzle_rle!(dst: ptr base.pixel_buffer, src: base.io_reader) b if this.dst_y >= this.height { return "#bad RLE compression" } - row = tab.row(y: this.dst_y) + row = tab.row_u32(y: this.dst_y) if dst_bytes_per_row < row.length() { row = row[.. dst_bytes_per_row] } @@ -801,7 +801,7 @@ pri func decoder.swizzle_rle!(dst: ptr base.pixel_buffer, src: base.io_reader) b } endwhile.outer while this.dst_y < this.height { - row = tab.row(y: this.dst_y) + row = tab.row_u32(y: this.dst_y) if dst_bytes_per_row < row.length() { row = row[.. dst_bytes_per_row] } @@ -921,7 +921,7 @@ pri func decoder.swizzle_bitfields!(dst: ptr base.pixel_buffer, src: base.io_rea } endwhile // -------- END convert to PIXEL_FORMAT__BGRA_NONPREMUL_4X16LE. - dst = tab.row(y: this.dst_y) + dst = tab.row_u32(y: this.dst_y) if dst_bytes_per_row < dst.length() { dst = dst[.. dst_bytes_per_row] } @@ -983,7 +983,7 @@ pri func decoder.swizzle_low_bit_depth!(dst: ptr base.pixel_buffer, src: base.io } } - dst = tab.row(y: this.dst_y) + dst = tab.row_u32(y: this.dst_y) if dst_bytes_per_row < dst.length() { dst = dst[.. dst_bytes_per_row] } diff --git a/std/gif/decode_gif.wuffs b/std/gif/decode_gif.wuffs index 556d7b99..29798f41 100644 --- a/std/gif/decode_gif.wuffs +++ b/std/gif/decode_gif.wuffs @@ -1013,7 +1013,7 @@ pri func decoder.copy_to_image_buffer!(pb: ptr base.pixel_buffer, src: slice bas // First, copy from src to that part of the frame rect that is inside // args.pb's bounds (clipped to the image bounds). - dst = tab.row(y: this.dst_y) + dst = tab.row_u32(y: this.dst_y) if this.dst_y >= this.height { dst = dst[.. 0] } else if width_in_bytes < dst.length() { @@ -1055,13 +1055,13 @@ pri func decoder.copy_to_image_buffer!(pb: ptr base.pixel_buffer, src: slice bas (not this.gc_has_transparent_index) and (this.interlace > 1) { - replicate_src = tab.row(y: this.dst_y) + replicate_src = tab.row_u32(y: this.dst_y) replicate_y0 = this.dst_y ~sat+ 1 replicate_y1 = this.dst_y ~sat+ (INTERLACE_COUNT[this.interlace] as base.u32) replicate_y1 = replicate_y1.min(a: this.frame_rect_y1) while replicate_y0 < replicate_y1 { assert replicate_y0 < 0xFFFF_FFFF via "a < b: a < c; c <= b"(c: replicate_y1) - replicate_dst = tab.row(y: replicate_y0) + replicate_dst = tab.row_u32(y: replicate_y0) replicate_dst.copy_from_slice!(s: replicate_src) replicate_y0 += 1 } endwhile diff --git a/std/nie/decode_nie.wuffs b/std/nie/decode_nie.wuffs index 2172ff0f..e5df325a 100644 --- a/std/nie/decode_nie.wuffs +++ b/std/nie/decode_nie.wuffs @@ -211,7 +211,7 @@ pri func decoder.swizzle!(dst: ptr base.pixel_buffer, src: base.io_reader) base. } } - dst = tab.row(y: this.dst_y) + dst = tab.row_u32(y: this.dst_y) if dst_bytes_per_row < dst.length() { dst = dst[.. dst_bytes_per_row] } diff --git a/std/png/decode_swizzle_default.wuffs b/std/png/decode_swizzle_default.wuffs index 42db1914..9397ad93 100644 --- a/std/png/decode_swizzle_default.wuffs +++ b/std/png/decode_swizzle_default.wuffs @@ -67,7 +67,7 @@ pri func decoder.filter_and_swizzle!(dst: ptr base.pixel_buffer, workbuf: slice y = this.frame_rect_y0 while y < this.frame_rect_y1 { assert y < 0x00FF_FFFF via "a < b: a < c; c <= b"(c: this.frame_rect_y1) - dst = tab.row(y: y) + dst = tab.row_u32(y: y) if 1 > args.workbuf.length() { return "#internal error: inconsistent workbuf length" diff --git a/std/png/decode_swizzle_tricky.wuffs b/std/png/decode_swizzle_tricky.wuffs index 7f3af18a..7ca993bf 100644 --- a/std/png/decode_swizzle_tricky.wuffs +++ b/std/png/decode_swizzle_tricky.wuffs @@ -62,7 +62,7 @@ pri func decoder.filter_and_swizzle_tricky!(dst: ptr base.pixel_buffer, workbuf: } while y < this.frame_rect_y1 { assert y < 0x00FF_FFFF via "a < b: a < c; c <= b"(c: this.frame_rect_y1) - dst = tab.row(y: y) + dst = tab.row_u32(y: y) if dst_bytes_per_row1 < dst.length() { dst = dst[.. dst_bytes_per_row1] } diff --git a/std/wbmp/decode_wbmp.wuffs b/std/wbmp/decode_wbmp.wuffs index de97c130..5d664532 100644 --- a/std/wbmp/decode_wbmp.wuffs +++ b/std/wbmp/decode_wbmp.wuffs @@ -196,7 +196,7 @@ pub func decoder.decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reader, tab = args.dst.plane(p: 0) while dst_y < this.height { assert dst_y < 0xFFFF_FFFF via "a < b: a < c; c <= b"(c: this.height) - dst = tab.row(y: dst_y) + dst = tab.row_u32(y: dst_y) dst_x = 0 while dst_x < this.width, @@ -212,7 +212,7 @@ pub func decoder.decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reader, { yield? base."$short read" tab = args.dst.plane(p: 0) - dst = tab.row(y: dst_y) + dst = tab.row_u32(y: dst_y) dst_x_in_bytes = (dst_x as base.u64) * dst_bytes_per_pixel if dst_x_in_bytes <= dst.length() { dst = dst[dst_x_in_bytes ..]