Fix some hasher methods' effects

This commit is contained in:
Nigel Tao committed 2018-05-12 18:01:24 +10:00
1 parent 131732e7eb
commit dfc8e14f4f
4 files changed
+6 -7

No files matched your search

+1 -3
View File
@@ -19,12 +19,10 @@ pub struct ieee_hasher?(
state base.u32,
)
// TODO: add a ! as this function is impure.
//
// 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)(checksum base.u32) {
pub func ieee_hasher.update!(x slice base.u8)(checksum base.u32) {
var s base.u32 = 0xFFFFFFFF ^ this.state
iterate (p slice base.u8 =: in.x)(length:8, unroll:8) {