Remove unused gif.decoder.skip_frame variable

This commit is contained in:
Nigel Tao committed 2018-11-17 10:58:39 +11:00
1 parent c7bb8c3e09
commit e3486eec17
3 files changed
+16 -16

No files matched your search

+8 -1
View File
@@ -549,13 +549,20 @@ func (g *gen) writeBuiltinCallSuspendibles(b *buffer, n *a.Expr, depth uint32) e
return g.writeReadUXX(b, n, "a_src", 64, "le")
case t.IDSkip:
x := n.Args()[0].AsArg().Value()
if cv := x.ConstValue(); cv != nil && cv.Cmp(one) == 0 {
b.printf("if (WUFFS_BASE__UNLIKELY(iop_a_src == io1_a_src)) {" +
"status = wuffs_base__suspension__short_read; goto suspend; }")
b.printf("iop_a_src++;\n")
return nil
}
g.currFunk.usesScratch = true
// TODO: don't hard-code [0], and allow recursive coroutines.
scratchName := fmt.Sprintf("self->private_impl.%s%s[0].scratch",
cPrefix, g.currFunk.astFunc.FuncName().Str(g.tm))
b.printf("%s = ", scratchName)
x := n.Args()[0].AsArg().Value()
if err := g.writeExpr(b, x, replaceCallSuspendibles, depth); err != nil {
return err
}
+5 -12
View File
@@ -7576,7 +7576,6 @@ wuffs_gif__decoder__skip_frame(wuffs_gif__decoder* self,
wuffs_base__status status = NULL;
uint8_t v_flags;
uint8_t v_lw;
uint8_t* iop_a_src = NULL;
uint8_t* io0_a_src = NULL;
@@ -7598,7 +7597,6 @@ wuffs_gif__decoder__skip_frame(wuffs_gif__decoder* self,
uint32_t coro_susp_point = self->private_impl.c_skip_frame[0].coro_susp_point;
if (coro_susp_point) {
v_flags = 0;
v_lw = 0;
} else {
}
switch (coro_susp_point) {
@@ -7627,17 +7625,12 @@ wuffs_gif__decoder__skip_frame(wuffs_gif__decoder* self,
}
iop_a_src += self->private_impl.c_skip_frame[0].scratch;
}
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(4);
if (WUFFS_BASE__UNLIKELY(iop_a_src == io1_a_src)) {
status = wuffs_base__suspension__short_read;
goto suspend;
}
uint8_t t_1 = *iop_a_src++;
v_lw = t_1;
}
if (v_lw != 0) {
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(4);
if (WUFFS_BASE__UNLIKELY(iop_a_src == io1_a_src)) {
status = wuffs_base__suspension__short_read;
goto suspend;
}
iop_a_src++;
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(5);
if (a_src.private_impl.buf) {
a_src.private_impl.buf->meta.ri =
+3 -3
View File
@@ -229,9 +229,9 @@ pri func decoder.skip_frame!??(src base.io_reader) {
if (flags & 0x80) != 0 {
args.src.skip!??(n:(3 as base.u32) << (1 + (flags & 0x07)))
}
var lw base.u8 = args.src.read_u8!??()
if lw != 0 { // TODO: delete the lw variable.
}
// Skip the literal width.
args.src.skip!??(n:1)
// Skip the blocks of LZW-compressed data.
this.skip_blocks!??(src:args.src)
this.num_decoded_frames_value ~sat+= 1