mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 00:38:14 +01:00
Remove some duplicated short_read_src code.
This commit is contained in:
1 parent
d275b379a3
commit
5a7f9e6cde
2 files changed
+3
-12
No files matched your search
@@ -353,12 +353,8 @@ func (g *gen) writeCallSuspendibles(b *buffer, n *a.Expr, depth uint32) error {
|
||||
b.printf("%s -= %srend_src - %srptr_src;\n", scratchName, bPrefix, bPrefix)
|
||||
b.printf("%srptr_src = %srend_src;\n", bPrefix, bPrefix)
|
||||
|
||||
// TODO: goto short_read_src;
|
||||
b.printf("if (%ssrc.buf && %ssrc.buf->closed && !%ssrc.limit.ptr_to_len) {", aPrefix, aPrefix, aPrefix)
|
||||
b.printf("status = %sERROR_UNEXPECTED_EOF; goto exit;", g.PKGPREFIX)
|
||||
b.printf("} status = %sSUSPENSION_SHORT_READ; goto suspend;\n", g.PKGPREFIX)
|
||||
|
||||
b.writes("}\n")
|
||||
b.writes("goto short_read_src; }\n")
|
||||
g.currFunk.shortReads = append(g.currFunk.shortReads, "src")
|
||||
b.printf("%srptr_src += %s;\n", bPrefix, scratchName)
|
||||
|
||||
} else if isInDst(g.tm, n, t.KeyWrite, 1) {
|
||||
|
||||
+1
-6
@@ -1030,12 +1030,7 @@ puffs_gif_status puffs_gif_decoder_decode_extension(puffs_gif_decoder* self,
|
||||
self->private_impl.c_decode_extension[0].scratch -=
|
||||
b_rend_src - b_rptr_src;
|
||||
b_rptr_src = b_rend_src;
|
||||
if (a_src.buf && a_src.buf->closed && !a_src.limit.ptr_to_len) {
|
||||
status = PUFFS_GIF_ERROR_UNEXPECTED_EOF;
|
||||
goto exit;
|
||||
}
|
||||
status = PUFFS_GIF_SUSPENSION_SHORT_READ;
|
||||
goto suspend;
|
||||
goto short_read_src;
|
||||
}
|
||||
b_rptr_src += self->private_impl.c_decode_extension[0].scratch;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user