Make the return value mandatory; add ok

This commit is contained in:
Nigel Tao committed 2018-11-24 15:09:28 +11:00
1 parent 24ace1c144
commit 762b320b5e
11 files changed
+45 -50

No files matched your search

+1 -1
View File
@@ -231,7 +231,7 @@ pri func decoder.decode_uncompressed!??(dst base.io_writer, src base.io_reader)
while true {
var n_copied base.u32 = args.dst.copy_n_from_reader!(n:length, r:args.src)
if length <= n_copied {
return
return ok
}
length -= n_copied
if args.dst.available() == 0 {
+4 -4
View File
@@ -366,10 +366,10 @@ pri func decoder.decode_extension!??(src base.io_reader) {
var label base.u8 = args.src.read_u8!??()
if label == 0xF9 { // The spec calls 0xF9 the "Graphic Control Label".
this.decode_gc!??(src:args.src)
return
return ok
} else if label == 0xFF { // The spec calls 0xFF the "Application Extension Label".
this.decode_ae!??(src:args.src)
return
return ok
}
// We skip over all other extensions, including 0x01 "Plain Text Label" and
// 0xFE "Comment Label".
@@ -380,7 +380,7 @@ pri func decoder.skip_blocks!??(src base.io_reader) {
while true {
var block_size base.u8 = args.src.read_u8!??()
if block_size == 0 {
return
return ok
}
args.src.skip!??(n:block_size as base.u32)
}
@@ -404,7 +404,7 @@ pri func decoder.decode_ae!??(src base.io_reader) {
var c base.u8
var block_size base.u8 = args.src.read_u8!??()
if block_size == 0 {
return
return ok
}
// Look only for an 11 byte "ANIMEXTS1.0" or "NETSCAPE2.0" extension,
+1 -1
View File
@@ -256,7 +256,7 @@ pri func decoder.flush!??(dst base.io_writer) {
var s slice base.u8 = this.output[i:j]
var n base.u64 = args.dst.copy_from_slice!(s:s)
if n == s.length() {
return
return ok
}
i = (i + ((n & 8191) as base.u32)) & 8191
yield base."$short write"