Generate C code for "a or b or c".

This commit is contained in:
Nigel Tao committed 2017-06-16 14:35:43 +10:00
1 parent 540274b57d
commit ce2720fca1
5 files changed
+65 -3

No files matched your search

+3 -1
View File
@@ -8,7 +8,9 @@ pub struct decoder?(
)
pub func decoder.decode?(dst ptr buf1, src ptr buf1)() {
if (in.src.read_u8?() != 0x47) or (in.src.read_u8?() != 0x49) {
// Read either "GIF87a" or "GIF89a".
if (in.src.read_u8?() != 0x47) or (in.src.read_u8?() != 0x49) or
(in.src.read_u8?() != 0x46) or (in.src.read_u8?() != 0x38) {
return error "bad GIF header"
}
}