mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 08:47:28 +01:00
Rename errors from "?msg" to "#msg"
This commit is contained in:
1 parent
c341ac5078
commit
045f180a6c
16 files changed
+203
-203
No files matched your search
@@ -15,10 +15,10 @@
|
||||
use "std/crc32"
|
||||
use "std/deflate"
|
||||
|
||||
pub status "?bad checksum"
|
||||
pub status "?bad compression method"
|
||||
pub status "?bad encoding flags"
|
||||
pub status "?bad header"
|
||||
pub status "#bad checksum"
|
||||
pub status "#bad compression method"
|
||||
pub status "#bad encoding flags"
|
||||
pub status "#bad header"
|
||||
|
||||
// TODO: reference deflate.decoder_workbuf_len_max_incl_worst_case.
|
||||
pub const decoder_workbuf_len_max_incl_worst_case base.u64 = 1
|
||||
@@ -55,15 +55,15 @@ pub func decoder.decode_io_writer?(dst base.io_writer, src base.io_reader, workb
|
||||
// Read the header.
|
||||
c = args.src.read_u8?()
|
||||
if c != 0x1F {
|
||||
return "?bad header"
|
||||
return "#bad header"
|
||||
}
|
||||
c = args.src.read_u8?()
|
||||
if c != 0x8B {
|
||||
return "?bad header"
|
||||
return "#bad header"
|
||||
}
|
||||
c = args.src.read_u8?()
|
||||
if c != 0x08 {
|
||||
return "?bad compression method"
|
||||
return "#bad compression method"
|
||||
}
|
||||
flags = args.src.read_u8?()
|
||||
// TODO: API for returning the header's MTIME field.
|
||||
@@ -106,7 +106,7 @@ pub func decoder.decode_io_writer?(dst base.io_writer, src base.io_reader, workb
|
||||
|
||||
// Reserved flags bits must be zero.
|
||||
if (flags & 0xE0) != 0 {
|
||||
return "?bad encoding flags"
|
||||
return "#bad encoding flags"
|
||||
}
|
||||
|
||||
// Decode and checksum the DEFLATE-encoded payload.
|
||||
@@ -126,6 +126,6 @@ pub func decoder.decode_io_writer?(dst base.io_writer, src base.io_reader, workb
|
||||
decoded_length_want = args.src.read_u32le?()
|
||||
if (not this.ignore_checksum) and
|
||||
((checksum_got != checksum_want) or (decoded_length_got != decoded_length_want)) {
|
||||
return "?bad checksum"
|
||||
return "#bad checksum"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user