Rename "!=" to "<>"; "!" now only shows impurity

This commit is contained in:
Nigel Tao committed 2019-03-02 14:51:32 +11:00
1 parent f8d02cfb16
commit ef7aa0d980
11 files changed
+82 -83

No files matched your search

+22 -22
View File
@@ -146,7 +146,7 @@ pub func decoder.decode_image_config?(dst nptr base.image_config, src base.io_re
(this.frame_rect_x1 == this.width) and
(this.frame_rect_y1 == this.height)
if args.dst != nullptr {
if args.dst <> nullptr {
// TODO: a Wuffs (not just C) name for the
// WUFFS_BASE__PIXEL_FORMAT__INDEXED__BGRA_BINARY magic pixfmt constant.
args.dst.set!(
@@ -217,7 +217,7 @@ pub func decoder.decode_frame_config?(dst nptr base.frame_config, src base.io_re
if not this.end_of_data {
if this.call_sequence == 0 {
this.decode_image_config?(dst:nullptr, src:args.src)
} else if this.call_sequence != 1 {
} else if this.call_sequence <> 1 {
if this.call_sequence == 2 {
this.skip_frame?(src:args.src)
}
@@ -236,7 +236,7 @@ pub func decoder.decode_frame_config?(dst nptr base.frame_config, src base.io_re
blend = 2 // 2 is WUFFS_BASE__ANIMATION_BLEND__OPAQUE.
}
if args.dst != nullptr {
if args.dst <> nullptr {
args.dst.update!(bounds:this.util.make_rect_ie_u32(
min_incl_x:this.frame_rect_x0.min(x:this.width),
min_incl_y:this.frame_rect_y0.min(x:this.height),
@@ -258,7 +258,7 @@ pri func decoder.skip_frame?(src base.io_reader) {
// Skip the optional Local Color Table, 3 bytes (RGB) per entry.
flags = args.src.read_u8?()
if (flags & 0x80) != 0 {
if (flags & 0x80) <> 0 {
args.src.skip?(n:(3 as base.u32) << (1 + (flags & 0x07)))
}
// Skip the literal width.
@@ -272,7 +272,7 @@ pri func decoder.skip_frame?(src base.io_reader) {
// TODO: honor args.opts.
pub func decoder.decode_frame?(dst ptr base.pixel_buffer, src base.io_reader, workbuf slice base.u8, opts nptr base.decode_frame_options) {
if this.call_sequence != 2 {
if this.call_sequence <> 2 {
this.decode_frame_config?(dst:nullptr, src:args.src)
}
this.decode_id_part1?(dst:args.dst, src:args.src)
@@ -298,7 +298,7 @@ pri func decoder.decode_up_to_id_part1?(src base.io_reader) {
if not this.restarted {
this.frame_config_io_position = args.src.position()
} else if this.frame_config_io_position != args.src.position() {
} else if this.frame_config_io_position <> args.src.position() {
return base."#bad restart"
} else {
this.restarted = false
@@ -331,8 +331,8 @@ pri func decoder.decode_header?(src base.io_reader) {
c[i] = args.src.read_u8?()
i += 1
}
if (c[0] != 0x47) or (c[1] != 0x49) or (c[2] != 0x46) or (c[3] != 0x38) or
((c[4] != 0x37) and (c[4] != 0x39)) or (c[5] != 0x61) {
if (c[0] <> 0x47) or (c[1] <> 0x49) or (c[2] <> 0x46) or (c[3] <> 0x38) or
((c[4] <> 0x37) and (c[4] <> 0x39)) or (c[5] <> 0x61) {
return "#bad header"
}
}
@@ -353,7 +353,7 @@ pri func decoder.decode_lsd?(src base.io_reader) {
args.src.skip?(n:2)
// Read the optional Global Color Table.
if (flags & 0x80) != 0 {
if (flags & 0x80) <> 0 {
num_palette_entries = (1 as base.u32) << (1 + (flags & 0x07))
i = 0
while i < num_palette_entries {
@@ -444,7 +444,7 @@ pri func decoder.decode_ae?(src base.io_reader) {
// as per:
// - http://www.vurdalakov.net/misc/gif/animexts-looping-application-extension
// - http://www.vurdalakov.net/misc/gif/netscape-looping-application-extension
if block_size != 11 {
if block_size <> 11 {
args.src.skip?(n:block_size as base.u32)
break
}
@@ -453,8 +453,8 @@ pri func decoder.decode_ae?(src base.io_reader) {
block_size = 0 // Re-purpose the block_size variable as a counter.
while block_size < 11 {
c = args.src.read_u8?()
not_animexts = not_animexts or (c != animexts1dot0[block_size])
not_netscape = not_netscape or (c != netscape2dot0[block_size])
not_animexts = not_animexts or (c <> animexts1dot0[block_size])
not_netscape = not_netscape or (c <> netscape2dot0[block_size])
block_size += 1
}
if not_animexts and not_netscape {
@@ -464,12 +464,12 @@ pri func decoder.decode_ae?(src base.io_reader) {
// Those 11 bytes should be followed by 0x03, 0x01 and then the loop
// count.
block_size = args.src.read_u8?()
if block_size != 3 {
if block_size <> 3 {
args.src.skip?(n:block_size as base.u32)
break
}
c = args.src.read_u8?()
if c != 0x01 {
if c <> 0x01 {
args.src.skip?(n:2)
break
}
@@ -505,12 +505,12 @@ pri func decoder.decode_gc?(src base.io_reader) {
return "#bad graphic control"
}
c = args.src.read_u8?()
if c != 4 {
if c <> 4 {
return "#bad graphic control"
}
flags = args.src.read_u8?()
this.gc_has_transparent_index = (flags & 0x01) != 0
this.gc_has_transparent_index = (flags & 0x01) <> 0
// Convert the disposal method from GIF's wire format to Wuffs constants.
//
@@ -536,7 +536,7 @@ pri func decoder.decode_gc?(src base.io_reader) {
this.gc_transparent_index = args.src.read_u8?()
c = args.src.read_u8?()
if c != 0 {
if c <> 0 {
return "#bad graphic control"
}
this.seen_graphic_control = true
@@ -584,7 +584,7 @@ pri func decoder.decode_id_part1?(dst ptr base.pixel_buffer, src base.io_reader)
var lw base.u8
flags = args.src.read_u8?()
if (flags & 0x40) != 0 {
if (flags & 0x40) <> 0 {
this.interlace = 4
} else {
this.interlace = 0
@@ -592,7 +592,7 @@ pri func decoder.decode_id_part1?(dst ptr base.pixel_buffer, src base.io_reader)
// Read the optional Local Color Table.
this.which_palette = 1
if (flags & 0x80) != 0 {
if (flags & 0x80) <> 0 {
num_palette_entries = (1 as base.u32) << (1 + (flags & 0x07))
i = 0
while i < num_palette_entries {
@@ -762,8 +762,8 @@ pri func decoder.decode_id_part2?(dst ptr base.pixel_buffer, src base.io_reader,
this.compressed_wi = 0
if (this.dst_y < this.frame_rect_y1) and
(this.frame_rect_x0 != this.frame_rect_x1) and
(this.frame_rect_y0 != this.frame_rect_y1) {
(this.frame_rect_x0 <> this.frame_rect_x1) and
(this.frame_rect_y0 <> this.frame_rect_y1) {
return base."#not enough data"
}
}
@@ -856,7 +856,7 @@ pri func decoder.copy_to_image_buffer!(pb ptr base.pixel_buffer, src slice base.
continue
}
if src_ri != args.src.length() {
if src_ri <> args.src.length() {
return "#internal error: inconsistent ri/wi"
}
break