mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 00:47:56 +01:00
Rename skip / copy_n_etc to skip32 / copy_n32_etc
This commit is contained in:
1 parent
1dcb5a9283
commit
09ed091fe3
14 files changed
+138
-136
No files matched your search
@@ -235,13 +235,13 @@ var Funcs = []string{
|
||||
"io_reader.since(mark: u64) slice u8",
|
||||
"io_reader.take!(n: u64) slice u8",
|
||||
|
||||
"io_reader.skip?(n: u32)",
|
||||
"io_reader.skip32?(n: u32)",
|
||||
|
||||
// TODO: this should have explicit pre-conditions "actual <= worst_case"
|
||||
// and "worst_case <= available()". As an implementation restriction, we
|
||||
// also require that worst_case has a constant value. For now, that's all
|
||||
// implicitly checked (i.e. hard coded).
|
||||
"io_reader.skip_fast!(actual: u32, worst_case: u32)",
|
||||
"io_reader.skip32_fast!(actual: u32, worst_case: u32)",
|
||||
|
||||
// ---- io_writer
|
||||
|
||||
@@ -290,16 +290,16 @@ var Funcs = []string{
|
||||
"io_writer.since(mark: u64) slice u8",
|
||||
|
||||
"io_writer.copy_from_slice!(s: slice u8) u64",
|
||||
"io_writer.copy_n_from_history!(n: u32, distance: u32) u32",
|
||||
"io_writer.copy_n_from_reader!(n: u32, r: io_reader) u32",
|
||||
"io_writer.copy_n_from_slice!(n: u32, s: slice u8) u32",
|
||||
"io_writer.copy_n32_from_history!(n: u32, distance: u32) u32",
|
||||
"io_writer.copy_n32_from_reader!(n: u32, r: io_reader) u32",
|
||||
"io_writer.copy_n32_from_slice!(n: u32, s: slice u8) u32",
|
||||
|
||||
// TODO: this should have explicit pre-conditions:
|
||||
// - n <= this.available()
|
||||
// - distance > 0
|
||||
// - distance <= this.since_mark().length()
|
||||
// For now, that's all implicitly checked (i.e. hard coded).
|
||||
"io_writer.copy_n_from_history_fast!(n: u32, distance: u32) u32",
|
||||
"io_writer.copy_n32_from_history_fast!(n: u32, distance: u32) u32",
|
||||
|
||||
// ---- status
|
||||
|
||||
|
||||
@@ -1045,12 +1045,12 @@ func (q *checker) bcheckExprCallSpecialCases(n *a.Expr, depth uint32) (bounds, e
|
||||
return bounds{}, err
|
||||
}
|
||||
|
||||
} else if method == t.IDCopyNFromHistoryFast {
|
||||
if err := q.canCopyNFromHistoryFast(recv, n.Args()); err != nil {
|
||||
} else if method == t.IDCopyN32FromHistoryFast {
|
||||
if err := q.canCopyN32FromHistoryFast(recv, n.Args()); err != nil {
|
||||
return bounds{}, err
|
||||
}
|
||||
|
||||
} else if method == t.IDSkipFast {
|
||||
} else if method == t.IDSkip32Fast {
|
||||
args := n.Args()
|
||||
if len(args) != 2 {
|
||||
return bounds{}, fmt.Errorf("check: internal error: bad skip_fast arguments")
|
||||
@@ -1112,7 +1112,7 @@ func (q *checker) canUndoByte(recv *a.Expr) error {
|
||||
return fmt.Errorf("check: could not prove %s.can_undo_byte()", recv.Str(q.tm))
|
||||
}
|
||||
|
||||
func (q *checker) canCopyNFromHistoryFast(recv *a.Expr, args []*a.Node) error {
|
||||
func (q *checker) canCopyN32FromHistoryFast(recv *a.Expr, args []*a.Node) error {
|
||||
// As per cgen's io-private.h, there are three pre-conditions:
|
||||
// - n <= this.available()
|
||||
// - distance > 0
|
||||
|
||||
+14
-14
@@ -492,15 +492,15 @@ const (
|
||||
IDMark = ID(0x163)
|
||||
IDPosition = ID(0x164)
|
||||
IDSince = ID(0x165)
|
||||
IDSkip = ID(0x166)
|
||||
IDSkipFast = ID(0x167)
|
||||
IDSkip32 = ID(0x166)
|
||||
IDSkip32Fast = ID(0x167)
|
||||
IDTake = ID(0x168)
|
||||
|
||||
IDCopyFromSlice = ID(0x170)
|
||||
IDCopyNFromHistory = ID(0x171)
|
||||
IDCopyNFromHistoryFast = ID(0x172)
|
||||
IDCopyNFromReader = ID(0x173)
|
||||
IDCopyNFromSlice = ID(0x174)
|
||||
IDCopyFromSlice = ID(0x170)
|
||||
IDCopyN32FromHistory = ID(0x171)
|
||||
IDCopyN32FromHistoryFast = ID(0x172)
|
||||
IDCopyN32FromReader = ID(0x173)
|
||||
IDCopyN32FromSlice = ID(0x174)
|
||||
|
||||
// -------- 0x180 block.
|
||||
|
||||
@@ -834,15 +834,15 @@ var builtInsByID = [nBuiltInIDs]string{
|
||||
IDMark: "mark",
|
||||
IDPosition: "position",
|
||||
IDSince: "since",
|
||||
IDSkip: "skip",
|
||||
IDSkipFast: "skip_fast",
|
||||
IDSkip32: "skip32",
|
||||
IDSkip32Fast: "skip32_fast",
|
||||
IDTake: "take",
|
||||
|
||||
IDCopyFromSlice: "copy_from_slice",
|
||||
IDCopyNFromHistory: "copy_n_from_history",
|
||||
IDCopyNFromHistoryFast: "copy_n_from_history_fast",
|
||||
IDCopyNFromReader: "copy_n_from_reader",
|
||||
IDCopyNFromSlice: "copy_n_from_slice",
|
||||
IDCopyFromSlice: "copy_from_slice",
|
||||
IDCopyN32FromHistory: "copy_n32_from_history",
|
||||
IDCopyN32FromHistoryFast: "copy_n32_from_history_fast",
|
||||
IDCopyN32FromReader: "copy_n32_from_reader",
|
||||
IDCopyN32FromSlice: "copy_n32_from_slice",
|
||||
|
||||
// -------- 0x180 block.
|
||||
|
||||
|
||||
Reference in new issue
Block a user