Fix some C++ (not C) compile errors

This commit is contained in:
Nigel Tao committed 2018-06-30 13:31:52 +10:00
1 parent 52e7fe0709
commit e43aa62d1c
7 files changed
+70 -37

No files matched your search

+20 -10
View File
@@ -1568,6 +1568,7 @@ typedef struct {
} c_decode_ae[1];
struct {
uint32_t coro_susp_point;
uint8_t v_c;
uint8_t v_flags;
uint64_t scratch;
} c_decode_gc[1];
@@ -3414,6 +3415,7 @@ static wuffs_base__status wuffs_gif__decoder__decode_gc(
wuffs_base__io_reader a_src) {
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
uint8_t v_c;
uint8_t v_flags;
uint8_t* ioptr_src = NULL;
@@ -3434,6 +3436,7 @@ static wuffs_base__status wuffs_gif__decoder__decode_gc(
uint32_t coro_susp_point = self->private_impl.c_decode_gc[0].coro_susp_point;
if (coro_susp_point) {
v_c = self->private_impl.c_decode_gc[0].v_c;
v_flags = self->private_impl.c_decode_gc[0].v_flags;
} else {
}
@@ -3444,12 +3447,15 @@ static wuffs_base__status wuffs_gif__decoder__decode_gc(
status = WUFFS_GIF__ERROR_BAD_GRAPHIC_CONTROL;
goto exit;
}
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
}
uint8_t t_0 = *ioptr_src++;
v_c = t_0;
}
uint8_t t_0 = *ioptr_src++;
if (t_0 != 4) {
if (v_c != 4) {
status = WUFFS_GIF__ERROR_BAD_GRAPHIC_CONTROL;
goto exit;
}
@@ -3506,12 +3512,15 @@ static wuffs_base__status wuffs_gif__decoder__decode_gc(
uint8_t t_4 = *ioptr_src++;
self->private_impl.f_gc_transparent_index = t_4;
}
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(6);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(6);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
}
uint8_t t_5 = *ioptr_src++;
v_c = t_5;
}
uint8_t t_5 = *ioptr_src++;
if (t_5 != 0) {
if (v_c != 0) {
status = WUFFS_GIF__ERROR_BAD_GRAPHIC_CONTROL;
goto exit;
}
@@ -3526,6 +3535,7 @@ static wuffs_base__status wuffs_gif__decoder__decode_gc(
goto suspend;
suspend:
self->private_impl.c_decode_gc[0].coro_susp_point = coro_susp_point;
self->private_impl.c_decode_gc[0].v_c = v_c;
self->private_impl.c_decode_gc[0].v_flags = v_flags;
goto exit;
+28 -20
View File
@@ -1643,8 +1643,8 @@ typedef struct {
struct {
uint32_t coro_susp_point;
uint8_t v_flags;
uint8_t v_c;
uint8_t v_flags;
uint16_t v_xlen;
uint32_t v_checksum_got;
uint32_t v_decoded_length_got;
@@ -2423,8 +2423,8 @@ wuffs_base__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
}
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
uint8_t v_flags;
uint8_t v_c;
uint8_t v_flags;
uint16_t v_xlen;
uint32_t v_checksum_got;
uint32_t v_decoded_length_got;
@@ -2468,8 +2468,8 @@ wuffs_base__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
uint32_t coro_susp_point = self->private_impl.c_decode[0].coro_susp_point;
if (coro_susp_point) {
v_flags = self->private_impl.c_decode[0].v_flags;
v_c = self->private_impl.c_decode[0].v_c;
v_flags = self->private_impl.c_decode[0].v_flags;
v_xlen = self->private_impl.c_decode[0].v_xlen;
v_checksum_got = self->private_impl.c_decode[0].v_checksum_got;
v_decoded_length_got = self->private_impl.c_decode[0].v_decoded_length_got;
@@ -2482,30 +2482,39 @@ wuffs_base__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
switch (coro_susp_point) {
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_0;
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
}
uint8_t t_0 = *ioptr_src++;
v_c = t_0;
}
uint8_t t_0 = *ioptr_src++;
if (t_0 != 31) {
if (v_c != 31) {
status = WUFFS_GZIP__ERROR_BAD_HEADER;
goto exit;
}
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(2);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(2);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
}
uint8_t t_1 = *ioptr_src++;
v_c = t_1;
}
uint8_t t_1 = *ioptr_src++;
if (t_1 != 139) {
if (v_c != 139) {
status = WUFFS_GZIP__ERROR_BAD_HEADER;
goto exit;
}
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(3);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(3);
if (WUFFS_BASE__UNLIKELY(ioptr_src == iobounds1_src)) {
goto short_read_src;
}
uint8_t t_2 = *ioptr_src++;
v_c = t_2;
}
uint8_t t_2 = *ioptr_src++;
if (t_2 != 8) {
if (v_c != 8) {
status = WUFFS_GZIP__ERROR_BAD_COMPRESSION_METHOD;
goto exit;
}
@@ -2526,7 +2535,6 @@ wuffs_base__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
goto short_read_src;
}
ioptr_src += self->private_impl.c_decode[0].scratch;
v_c = 0;
if ((v_flags & 4) != 0) {
{
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(7);
@@ -2729,8 +2737,8 @@ wuffs_base__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
goto suspend;
suspend:
self->private_impl.c_decode[0].coro_susp_point = coro_susp_point;
self->private_impl.c_decode[0].v_flags = v_flags;
self->private_impl.c_decode[0].v_c = v_c;
self->private_impl.c_decode[0].v_flags = v_flags;
self->private_impl.c_decode[0].v_xlen = v_xlen;
self->private_impl.c_decode[0].v_checksum_got = v_checksum_got;
self->private_impl.c_decode[0].v_decoded_length_got = v_decoded_length_got;