mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 16:47:28 +01:00
Change iterate variable types from ptr to slice
This commit is contained in:
1 parent
d85a94360e
commit
96a549814d
8 files changed
+54
-52
No files matched your search
@@ -34,7 +34,7 @@ pub func hasher.update(x slice base.u8)(checksum base.u32) {
|
||||
in.x = in.x[:5552]
|
||||
}
|
||||
|
||||
iterate (step:1, unroll:8)(p ptr base.u8:in.x) {
|
||||
iterate (step:1, unroll:8)(p slice base.u8:in.x) {
|
||||
s1 ~mod+= p[0] as base.u32
|
||||
s2 ~mod+= s1
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ pub struct ieee_hasher?(
|
||||
pub func ieee_hasher.update(x slice base.u8)(checksum base.u32) {
|
||||
var s base.u32 = 0xFFFFFFFF ^ this.state
|
||||
|
||||
iterate (step:8, unroll:1)(p ptr base.u8:in.x) {
|
||||
iterate (step:8, unroll:1)(p slice base.u8:in.x) {
|
||||
// TODO: explain the slicing-by-8 algorithm.
|
||||
//
|
||||
// TODO: bounds checking for the index expressions "p[7]" etc.
|
||||
|
||||
Reference in new issue
Block a user