mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-22 00:47:28 +01:00
Remove use of struct field initial values
This commit is contained in:
1 parent
7a4f6e9e1f
commit
0e498cb86d
10 files changed
+53
-26
No files matched your search
@@ -16,13 +16,19 @@ packageid "adl3"
|
||||
|
||||
// TODO: drop the '?' but still generate wuffs_adler32__hasher__initialize?
|
||||
pub struct hasher?(
|
||||
state base.u32 = 1,
|
||||
state base.u32,
|
||||
started base.bool,
|
||||
)
|
||||
|
||||
pub func hasher.update!(x slice base.u8)(checksum base.u32) {
|
||||
// The Adler-32 checksum's magic 65521 and 5552 numbers are discussed in
|
||||
// RFC 1950.
|
||||
|
||||
if not this.started {
|
||||
this.started = true
|
||||
this.state = 1
|
||||
}
|
||||
|
||||
var s1 base.u32 = this.state.low_bits(n:16)
|
||||
var s2 base.u32 = this.state.high_bits(n:16)
|
||||
|
||||
|
||||
Reference in new issue
Block a user