Rename hasher update_u32 method

This commit is contained in:
Nigel Tao committed 2019-11-20 21:07:22 +11:00
1 parent 9e375309a4
commit 8ff9cdb9a6
8 files changed
+33 -33

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ pub struct hasher?(
started : base.bool,
)
pub func hasher.update!(x: slice base.u8) base.u32 {
pub func hasher.update_u32!(x: slice base.u8) base.u32 {
// The Adler-32 checksum's magic 65521 and 5552 numbers are discussed in
// this package's README.md.
+1 -1
View File
@@ -20,7 +20,7 @@ pub struct ieee_hasher?(
// TODO: should it be ? instead of ! because it's public, and might need a way
// to signal "initializer not called"? Should the return type, in the generated
// C code, be "struct{ uint32_t checksum; wuffs_crc32__status status }"?
pub func ieee_hasher.update!(x: slice base.u8) base.u32 {
pub func ieee_hasher.update_u32!(x: slice base.u8) base.u32 {
var s : base.u32
var p : slice base.u8
+1 -1
View File
@@ -115,7 +115,7 @@ pub func decoder.decode_io_writer?(dst: base.io_writer, src: base.io_reader, wor
mark = args.dst.mark()
status =? this.flate.decode_io_writer?(dst: args.dst, src: args.src, workbuf: args.workbuf)
if not this.ignore_checksum {
checksum_got = this.checksum.update!(x: args.dst.since(mark: mark))
checksum_got = this.checksum.update_u32!(x: args.dst.since(mark: mark))
decoded_length_got ~mod+= ((args.dst.count_since(mark: mark) & 0xFFFFFFFF) as base.u32)
}
if status.is_ok() {
+2 -2
View File
@@ -53,7 +53,7 @@ pub func decoder.add_dictionary!(dict: slice base.u8) {
if this.header_complete {
this.bad_call_sequence = true
} else {
this.dict_id_got = this.dict_id_hasher.update!(x: args.dict)
this.dict_id_got = this.dict_id_hasher.update_u32!(x: args.dict)
this.flate.add_history!(hist: args.dict)
}
this.got_dictionary = true
@@ -111,7 +111,7 @@ pub func decoder.decode_io_writer?(dst: base.io_writer, src: base.io_reader, wor
mark = args.dst.mark()
status =? this.flate.decode_io_writer?(dst: args.dst, src: args.src, workbuf: args.workbuf)
if not this.ignore_checksum {
checksum_got = this.checksum.update!(x: args.dst.since(mark: mark))
checksum_got = this.checksum.update_u32!(x: args.dst.since(mark: mark))
}
if status.is_ok() {
break