mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
Drop the "?" from "writer1.copy_from_slice?".
This commit is contained in:
1 parent
587be36759
commit
a33f744da5
10 files changed
+142
-97
No files matched your search
@@ -159,6 +159,11 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare
|
||||
b.writes(")")
|
||||
return nil
|
||||
}
|
||||
if isInDst(g.tm, n, t.KeySlice, 0) {
|
||||
b.printf("((puffs_base_slice_u8){ .ptr = %swstart_dst, .len = %swptr_dst - %swstart_dst, })",
|
||||
bPrefix, bPrefix, bPrefix)
|
||||
return nil
|
||||
}
|
||||
if isInDst(g.tm, n, t.KeyCopyFromReader32, 2) {
|
||||
b.printf("puffs_base_writer1_copy_from_reader32(&%swptr_dst, %swend_dst", bPrefix, bPrefix)
|
||||
// TODO: don't assume that the first argument is "in.src".
|
||||
@@ -182,20 +187,24 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare
|
||||
b.writeb(')')
|
||||
return nil
|
||||
}
|
||||
if isInDst(g.tm, n, t.KeySlice, 0) {
|
||||
b.printf("((puffs_base_slice_u8){ .ptr = %swstart_dst, .len = %swptr_dst - %swstart_dst, })",
|
||||
bPrefix, bPrefix, bPrefix)
|
||||
if isInDst(g.tm, n, t.KeyCopyFromSlice, 1) {
|
||||
b.printf("puffs_base_writer1_copy_from_slice(&%swptr_dst, %swend_dst,", bPrefix, bPrefix)
|
||||
a := n.Args()[0].Arg().Value()
|
||||
if err := g.writeExpr(b, a, rp, parenthesesOptional, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
b.writeb(')')
|
||||
return nil
|
||||
}
|
||||
if isThatMethod(g.tm, n, t.KeyCopyFromSlice, 1) {
|
||||
b.writes("puffs_base_slice_u8_copy_from_slice(")
|
||||
receiver := n.LHS().Expr().LHS().Expr()
|
||||
if err := g.writeExpr(b, receiver, rp, parenthesesMandatory, depth); err != nil {
|
||||
if err := g.writeExpr(b, receiver, rp, parenthesesOptional, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
b.writeb(',')
|
||||
a := n.Args()[0].Arg().Value()
|
||||
if err := g.writeExpr(b, a, rp, parenthesesMandatory, depth); err != nil {
|
||||
if err := g.writeExpr(b, a, rp, parenthesesOptional, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
b.writes(")\n")
|
||||
|
||||
Reference in new issue
Block a user