mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 08:47:28 +01:00
Move the "mark in.dst" into the flate decode loop.
This commit is contained in:
1 parent
c70fc8fcc6
commit
36f5ae9bf4
4 files changed
+9
-20
No files matched your search
@@ -69,8 +69,12 @@ func (g *gen) writeStatement(b *buffer, n *a.Node, depth uint32) error {
|
||||
return nil
|
||||
|
||||
case a.KIO:
|
||||
// TODO: the mark needs to apply on every (coroutine) call to the
|
||||
// function, not just when we execute this particular statement.
|
||||
// TODO: is a private_impl.mark the right representation? What if the
|
||||
// function is passed a (ptr writer1) instead of a (writer1)? Do we
|
||||
// still want to have that mark live outside of the function scope?
|
||||
//
|
||||
// TODO: remove this hard-coded hack for "mark in.dst".
|
||||
b.printf("%sdst.private_impl.mark = %swptr_dst;", aPrefix, bPrefix)
|
||||
return nil
|
||||
|
||||
case a.KIf:
|
||||
|
||||
@@ -117,18 +117,6 @@ func (g *gen) writeLoadDerivedVar(b *buffer, name t.ID, typ *a.TypeExpr, header
|
||||
|
||||
b.printf("%swptr_%s = %s%s.buf->ptr + %s%s.buf->wi;",
|
||||
bPrefix, nameStr, aPrefix, nameStr, aPrefix, nameStr)
|
||||
|
||||
// TODO: remove this hard-coded hack for "mark in.dst".
|
||||
//
|
||||
// TODO: is a private_impl.mark the right representation? What if the
|
||||
// function is passed a (ptr writer1) instead of a (writer1)? Do we
|
||||
// still want to have that mark live outside of the function scope?
|
||||
if header &&
|
||||
g.currFunk.astFunc.Receiver().String(g.tm) == "flate_decoder" &&
|
||||
g.currFunk.astFunc.Name().String(g.tm) == "decode" {
|
||||
b.printf("%s%s.private_impl.mark = %swptr_%s;", aPrefix, nameStr, bPrefix, nameStr)
|
||||
}
|
||||
|
||||
if header {
|
||||
b.printf("%swstart_%s = %swptr_%s;", bPrefix, nameStr, bPrefix, nameStr)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user