Roll back the two previous "@I/O redirect" commits

See the previous commit for the rationale.
This commit is contained in:
Nigel Tao committed 2020-05-29 11:27:51 +10:00
1 parent 49023afd48
commit 6537a817b7
4 files changed
+11 -8

No files matched your search

+1
View File
@@ -34,6 +34,7 @@ var FourCCs = [...][2]string{
var Statuses = [...]string{ var Statuses = [...]string{
// Notes. // Notes.
`"@I/O redirect"`,
`"@end of data"`, `"@end of data"`,
`"@metadata reported"`, `"@metadata reported"`,
+5 -3
View File
@@ -189,6 +189,7 @@ typedef struct {
} wuffs_base__status; } wuffs_base__status;
extern const char* wuffs_base__note__i_o_redirect;
extern const char* wuffs_base__note__end_of_data; extern const char* wuffs_base__note__end_of_data;
extern const char* wuffs_base__note__metadata_reported; extern const char* wuffs_base__note__metadata_reported;
extern const char* wuffs_base__suspension__even_more_information; extern const char* wuffs_base__suspension__even_more_information;
@@ -7966,6 +7967,7 @@ const uint32_t wuffs_base__pixel_format__bits_per_channel[16] = {
0x08, 0x0A, 0x0C, 0x10, 0x18, 0x20, 0x30, 0x40, 0x08, 0x0A, 0x0C, 0x10, 0x18, 0x20, 0x30, 0x40,
}; };
const char* wuffs_base__note__i_o_redirect = "@base: I/O redirect";
const char* wuffs_base__note__end_of_data = "@base: end of data"; const char* wuffs_base__note__end_of_data = "@base: end of data";
const char* wuffs_base__note__metadata_reported = "@base: metadata reported"; const char* wuffs_base__note__metadata_reported = "@base: metadata reported";
const char* wuffs_base__suspension__even_more_information = const char* wuffs_base__suspension__even_more_information =
@@ -12249,7 +12251,7 @@ wuffs_bmp__decoder__decode_image_config(wuffs_bmp__decoder* self,
status = wuffs_base__make_status(wuffs_base__error__bad_call_sequence); status = wuffs_base__make_status(wuffs_base__error__bad_call_sequence);
goto exit; goto exit;
} else if (self->private_impl.f_io_redirect_fourcc != 0) { } else if (self->private_impl.f_io_redirect_fourcc != 0) {
status = wuffs_base__make_status(wuffs_base__note__metadata_reported); status = wuffs_base__make_status(wuffs_base__note__i_o_redirect);
goto ok; goto ok;
} }
{ {
@@ -12555,11 +12557,11 @@ wuffs_bmp__decoder__decode_image_config(wuffs_bmp__decoder* self,
if (v_bits_per_pixel == 0) { if (v_bits_per_pixel == 0) {
if (v_compression == 4) { if (v_compression == 4) {
self->private_impl.f_io_redirect_fourcc = 1246774599; self->private_impl.f_io_redirect_fourcc = 1246774599;
status = wuffs_base__make_status(wuffs_base__note__metadata_reported); status = wuffs_base__make_status(wuffs_base__note__i_o_redirect);
goto ok; goto ok;
} else if (v_compression == 5) { } else if (v_compression == 5) {
self->private_impl.f_io_redirect_fourcc = 1347307296; self->private_impl.f_io_redirect_fourcc = 1347307296;
status = wuffs_base__make_status(wuffs_base__note__metadata_reported); status = wuffs_base__make_status(wuffs_base__note__i_o_redirect);
goto ok; goto ok;
} }
status = wuffs_base__make_status(wuffs_bmp__error__unsupported_bmp_file); status = wuffs_base__make_status(wuffs_bmp__error__unsupported_bmp_file);
+3 -3
View File
@@ -72,7 +72,7 @@ pub func decoder.decode_image_config?(dst: nptr base.image_config, src: base.io_
if (this.call_sequence <> 0) or (this.io_redirect_fourcc == 1) { if (this.call_sequence <> 0) or (this.io_redirect_fourcc == 1) {
return base."#bad call sequence" return base."#bad call sequence"
} else if this.io_redirect_fourcc <> 0 { } else if this.io_redirect_fourcc <> 0 {
return base."@metadata reported" // XXX return base."@I/O redirect"
} }
// Read the BITMAPFILEHEADER (14 bytes). // Read the BITMAPFILEHEADER (14 bytes).
@@ -130,10 +130,10 @@ pub func decoder.decode_image_config?(dst: nptr base.image_config, src: base.io_
if bits_per_pixel == 0 { if bits_per_pixel == 0 {
if compression == 4 { if compression == 4 {
this.io_redirect_fourcc = 'JPEG'be this.io_redirect_fourcc = 'JPEG'be
return base."@metadata reported" // XXX return base."@I/O redirect"
} else if compression == 5 { } else if compression == 5 {
this.io_redirect_fourcc = 'PNG 'be this.io_redirect_fourcc = 'PNG 'be
return base."@metadata reported" // XXX return base."@I/O redirect"
} }
return "#unsupported BMP file" return "#unsupported BMP file"
} else if bits_per_pixel == 24 { } else if bits_per_pixel == 24 {
+2 -2
View File
@@ -131,9 +131,9 @@ test_wuffs_bmp_decode_io_redirect() {
wuffs_base__status status = wuffs_base__status status =
wuffs_bmp__decoder__decode_image_config(&dec, NULL, &src); wuffs_bmp__decoder__decode_image_config(&dec, NULL, &src);
if (status.repr != wuffs_base__note__metadata_reported) { // XXX if (status.repr != wuffs_base__note__i_o_redirect) {
RETURN_FAIL("decode_image_config: have \"%s\", want \"%s\"", status.repr, RETURN_FAIL("decode_image_config: have \"%s\", want \"%s\"", status.repr,
wuffs_base__note__metadata_reported); // XXX wuffs_base__note__i_o_redirect);
} }
wuffs_base__io_buffer empty = wuffs_base__empty_io_buffer(); wuffs_base__io_buffer empty = wuffs_base__empty_io_buffer();