mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-26 01:01:35 +01:00
Rename ~+ to ~mod+; add ~mod-.
This commit is contained in:
1 parent
de5bded395
commit
a698b47cb6
11 files changed
+52
-40
No files matched your search
@@ -640,7 +640,8 @@ var cOpNames = [256]string{
|
|||||||
t.IDPipeEq: " |= ",
|
t.IDPipeEq: " |= ",
|
||||||
t.IDHatEq: " ^= ",
|
t.IDHatEq: " ^= ",
|
||||||
t.IDPercentEq: " %= ",
|
t.IDPercentEq: " %= ",
|
||||||
t.IDTildePlusEq: " += ",
|
t.IDTildeModPlusEq: " += ",
|
||||||
|
t.IDTildeModMinusEq: " -= ",
|
||||||
|
|
||||||
t.IDXUnaryPlus: " + ",
|
t.IDXUnaryPlus: " + ",
|
||||||
t.IDXUnaryMinus: " - ",
|
t.IDXUnaryMinus: " - ",
|
||||||
@@ -659,6 +660,8 @@ var cOpNames = [256]string{
|
|||||||
t.IDXBinaryPipe: " | ",
|
t.IDXBinaryPipe: " | ",
|
||||||
t.IDXBinaryHat: " ^ ",
|
t.IDXBinaryHat: " ^ ",
|
||||||
t.IDXBinaryPercent: " % ",
|
t.IDXBinaryPercent: " % ",
|
||||||
|
t.IDXBinaryTildeModPlus: " + ",
|
||||||
|
t.IDXBinaryTildeModMinus: " - ",
|
||||||
t.IDXBinaryNotEq: " != ",
|
t.IDXBinaryNotEq: " != ",
|
||||||
t.IDXBinaryLessThan: " < ",
|
t.IDXBinaryLessThan: " < ",
|
||||||
t.IDXBinaryLessEq: " <= ",
|
t.IDXBinaryLessEq: " <= ",
|
||||||
@@ -668,7 +671,6 @@ var cOpNames = [256]string{
|
|||||||
t.IDXBinaryAnd: " && ",
|
t.IDXBinaryAnd: " && ",
|
||||||
t.IDXBinaryOr: " || ",
|
t.IDXBinaryOr: " || ",
|
||||||
t.IDXBinaryAs: " no_such_as_C_operator ",
|
t.IDXBinaryAs: " no_such_as_C_operator ",
|
||||||
t.IDXBinaryTildePlus: " + ",
|
|
||||||
|
|
||||||
t.IDXAssociativePlus: " + ",
|
t.IDXAssociativePlus: " + ",
|
||||||
t.IDXAssociativeStar: " * ",
|
t.IDXAssociativeStar: " * ",
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
- Spun `std/zlib` out of `std/flate`.
|
- Spun `std/zlib` out of `std/flate`.
|
||||||
- Let the `std/zlib` decoder ignore checksums.
|
- Let the `std/zlib` decoder ignore checksums.
|
||||||
- Renamed `std/flate` to `std/deflate`.
|
- Renamed `std/flate` to `std/deflate`.
|
||||||
|
- Renamed `~+` to `~mod+`; add `~mod-`.
|
||||||
- Renamed `[N] T` and `[] T` types to `array[N] T` and `slice T`.
|
- Renamed `[N] T` and `[] T` types to `array[N] T` and `slice T`.
|
||||||
- Renamed `iterate.N` to `iterate[N]`.
|
- Renamed `iterate.N` to `iterate[N]`.
|
||||||
- Renamed `buf1`, `reader1`, etc to `io_buffer`, `io_reader`, etc.
|
- Renamed `buf1`, `reader1`, etc to `io_buffer`, `io_reader`, etc.
|
||||||
|
|||||||
+1
-1
@@ -3540,7 +3540,7 @@ static wuffs_deflate__status wuffs_deflate__decoder__decode_huffman_slow(
|
|||||||
goto label_6_break;
|
goto label_6_break;
|
||||||
}
|
}
|
||||||
v_hlen -= v_n_copied;
|
v_hlen -= v_n_copied;
|
||||||
v_hdist = (v_hdist + v_n_copied);
|
v_hdist += v_n_copied;
|
||||||
status = WUFFS_DEFLATE__SUSPENSION_SHORT_WRITE;
|
status = WUFFS_DEFLATE__SUSPENSION_SHORT_WRITE;
|
||||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(10);
|
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(10);
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-7
@@ -2079,18 +2079,16 @@ wuffs_gzip__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
|
|||||||
? (size_t)(b_wptr_dst - a_dst.private_impl.mark)
|
? (size_t)(b_wptr_dst - a_dst.private_impl.mark)
|
||||||
: 0,
|
: 0,
|
||||||
}));
|
}));
|
||||||
v_decoded_length_got =
|
v_decoded_length_got += ((uint32_t)((
|
||||||
(v_decoded_length_got +
|
((uint64_t)(
|
||||||
((uint32_t)((
|
((wuffs_base__slice_u8){
|
||||||
((uint64_t)(((wuffs_base__slice_u8){
|
|
||||||
.ptr = a_dst.private_impl.mark,
|
.ptr = a_dst.private_impl.mark,
|
||||||
.len = a_dst.private_impl.mark
|
.len = a_dst.private_impl.mark
|
||||||
? (size_t)(b_wptr_dst -
|
? (size_t)(b_wptr_dst - a_dst.private_impl.mark)
|
||||||
a_dst.private_impl.mark)
|
|
||||||
: 0,
|
: 0,
|
||||||
})
|
})
|
||||||
.len)) &
|
.len)) &
|
||||||
4294967295))));
|
4294967295)));
|
||||||
}
|
}
|
||||||
if (v_z == 0) {
|
if (v_z == 0) {
|
||||||
goto label_2_break;
|
goto label_2_break;
|
||||||
|
|||||||
+2
-1
@@ -169,6 +169,8 @@ var opStrings = [256]string{
|
|||||||
t.IDXBinaryAmpHat: " &^ ",
|
t.IDXBinaryAmpHat: " &^ ",
|
||||||
t.IDXBinaryPipe: " | ",
|
t.IDXBinaryPipe: " | ",
|
||||||
t.IDXBinaryHat: " ^ ",
|
t.IDXBinaryHat: " ^ ",
|
||||||
|
t.IDXBinaryTildeModPlus: " ~mod+ ",
|
||||||
|
t.IDXBinaryTildeModMinus: " ~mod- ",
|
||||||
t.IDXBinaryNotEq: " != ",
|
t.IDXBinaryNotEq: " != ",
|
||||||
t.IDXBinaryLessThan: " < ",
|
t.IDXBinaryLessThan: " < ",
|
||||||
t.IDXBinaryLessEq: " <= ",
|
t.IDXBinaryLessEq: " <= ",
|
||||||
@@ -178,7 +180,6 @@ var opStrings = [256]string{
|
|||||||
t.IDXBinaryAnd: " and ",
|
t.IDXBinaryAnd: " and ",
|
||||||
t.IDXBinaryOr: " or ",
|
t.IDXBinaryOr: " or ",
|
||||||
t.IDXBinaryAs: " as ",
|
t.IDXBinaryAs: " as ",
|
||||||
t.IDXBinaryTildePlus: " ~+ ",
|
|
||||||
|
|
||||||
t.IDXAssociativePlus: " + ",
|
t.IDXAssociativePlus: " + ",
|
||||||
t.IDXAssociativeStar: " * ",
|
t.IDXAssociativeStar: " * ",
|
||||||
|
|||||||
@@ -1122,14 +1122,7 @@ func (q *checker) bcheckExprBinaryOp1(op t.ID, lhs *a.Expr, lMin *big.Int, lMax
|
|||||||
}
|
}
|
||||||
return zero, big.NewInt(0).Sub(rMax, one), nil
|
return zero, big.NewInt(0).Sub(rMax, one), nil
|
||||||
|
|
||||||
case t.IDXBinaryNotEq, t.IDXBinaryLessThan, t.IDXBinaryLessEq, t.IDXBinaryEqEq,
|
case t.IDXBinaryTildeModPlus, t.IDXBinaryTildeModMinus:
|
||||||
t.IDXBinaryGreaterEq, t.IDXBinaryGreaterThan, t.IDXBinaryAnd, t.IDXBinaryOr:
|
|
||||||
return zero, one, nil
|
|
||||||
|
|
||||||
case t.IDXBinaryAs:
|
|
||||||
// Unreachable, as this is checked by the caller.
|
|
||||||
|
|
||||||
case t.IDXBinaryTildePlus:
|
|
||||||
typ := lhs.MType()
|
typ := lhs.MType()
|
||||||
if typ.IsIdeal() {
|
if typ.IsIdeal() {
|
||||||
typ = rhs.MType()
|
typ = rhs.MType()
|
||||||
@@ -1138,6 +1131,13 @@ func (q *checker) bcheckExprBinaryOp1(op t.ID, lhs *a.Expr, lMin *big.Int, lMax
|
|||||||
b := numTypeBounds[qid[1]]
|
b := numTypeBounds[qid[1]]
|
||||||
return b[0], b[1], nil
|
return b[0], b[1], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case t.IDXBinaryNotEq, t.IDXBinaryLessThan, t.IDXBinaryLessEq, t.IDXBinaryEqEq,
|
||||||
|
t.IDXBinaryGreaterEq, t.IDXBinaryGreaterThan, t.IDXBinaryAnd, t.IDXBinaryOr:
|
||||||
|
return zero, one, nil
|
||||||
|
|
||||||
|
case t.IDXBinaryAs:
|
||||||
|
// Unreachable, as this is checked by the caller.
|
||||||
}
|
}
|
||||||
return nil, nil, fmt.Errorf("check: unrecognized token (0x%X) for bcheckExprBinaryOp", op)
|
return nil, nil, fmt.Errorf("check: unrecognized token (0x%X) for bcheckExprBinaryOp", op)
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -282,7 +282,7 @@ func (q *checker) tcheckAssign(n *a.Assign) error {
|
|||||||
n.Operator().Str(q.tm), rhs.Str(q.tm), rTyp.Str(q.tm))
|
n.Operator().Str(q.tm), rhs.Str(q.tm), rTyp.Str(q.tm))
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
case t.IDTildePlusEq:
|
case t.IDTildeModPlusEq, t.IDTildeModMinusEq:
|
||||||
if !lTyp.IsUnsignedInteger() {
|
if !lTyp.IsUnsignedInteger() {
|
||||||
return fmt.Errorf("check: assignment %q: %q, of type %q, does not have unsigned integer type",
|
return fmt.Errorf("check: assignment %q: %q, of type %q, does not have unsigned integer type",
|
||||||
n.Operator().Str(q.tm), lhs.Str(q.tm), lTyp.Str(q.tm))
|
n.Operator().Str(q.tm), lhs.Str(q.tm), lTyp.Str(q.tm))
|
||||||
@@ -810,7 +810,7 @@ func (q *checker) tcheckExprBinaryOp(n *a.Expr, depth uint32) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch op {
|
switch op {
|
||||||
case t.IDXBinaryTildePlus:
|
case t.IDXBinaryTildeModPlus, t.IDXBinaryTildeModMinus:
|
||||||
typ := lTyp
|
typ := lTyp
|
||||||
if typ.IsIdeal() {
|
if typ.IsIdeal() {
|
||||||
typ = rTyp
|
typ = rTyp
|
||||||
@@ -890,6 +890,8 @@ func evalConstValueBinaryOp(tm *t.Map, n *a.Expr, l *big.Int, r *big.Int) (*big.
|
|||||||
return nil, fmt.Errorf("check: division by zero in const expression %q", n.Str(tm))
|
return nil, fmt.Errorf("check: division by zero in const expression %q", n.Str(tm))
|
||||||
}
|
}
|
||||||
return big.NewInt(0).Mod(l, r), nil
|
return big.NewInt(0).Mod(l, r), nil
|
||||||
|
case t.IDXBinaryTildeModPlus, t.IDXBinaryTildeModMinus:
|
||||||
|
return nil, fmt.Errorf("check: cannot apply tilde-operators to ideal numbers")
|
||||||
case t.IDXBinaryNotEq:
|
case t.IDXBinaryNotEq:
|
||||||
return btoi(l.Cmp(r) != 0), nil
|
return btoi(l.Cmp(r) != 0), nil
|
||||||
case t.IDXBinaryLessThan:
|
case t.IDXBinaryLessThan:
|
||||||
@@ -906,8 +908,6 @@ func evalConstValueBinaryOp(tm *t.Map, n *a.Expr, l *big.Int, r *big.Int) (*big.
|
|||||||
return btoi((l.Sign() != 0) && (r.Sign() != 0)), nil
|
return btoi((l.Sign() != 0) && (r.Sign() != 0)), nil
|
||||||
case t.IDXBinaryOr:
|
case t.IDXBinaryOr:
|
||||||
return btoi((l.Sign() != 0) || (r.Sign() != 0)), nil
|
return btoi((l.Sign() != 0) || (r.Sign() != 0)), nil
|
||||||
case t.IDXBinaryTildePlus:
|
|
||||||
return nil, fmt.Errorf("check: cannot apply ~+ operator to ideal numbers")
|
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("check: unrecognized token (0x%02X) for evalConstValueBinaryOp", n.Operator())
|
return nil, fmt.Errorf("check: unrecognized token (0x%02X) for evalConstValueBinaryOp", n.Operator())
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-11
@@ -207,7 +207,8 @@ const (
|
|||||||
IDPipeEq = ID(0x19)
|
IDPipeEq = ID(0x19)
|
||||||
IDHatEq = ID(0x1A)
|
IDHatEq = ID(0x1A)
|
||||||
IDPercentEq = ID(0x1B)
|
IDPercentEq = ID(0x1B)
|
||||||
IDTildePlusEq = ID(0x1C)
|
IDTildeModPlusEq = ID(0x1C)
|
||||||
|
IDTildeModMinusEq = ID(0x1D)
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -229,7 +230,8 @@ const (
|
|||||||
IDPipe = ID(0x29)
|
IDPipe = ID(0x29)
|
||||||
IDHat = ID(0x2A)
|
IDHat = ID(0x2A)
|
||||||
IDPercent = ID(0x2B)
|
IDPercent = ID(0x2B)
|
||||||
IDTildePlus = ID(0x2C)
|
IDTildeModPlus = ID(0x2C)
|
||||||
|
IDTildeModMinus = ID(0x2D)
|
||||||
|
|
||||||
IDNotEq = ID(0x30)
|
IDNotEq = ID(0x30)
|
||||||
IDLessThan = ID(0x31)
|
IDLessThan = ID(0x31)
|
||||||
@@ -275,7 +277,8 @@ const (
|
|||||||
IDXBinaryAnd = ID(0x59)
|
IDXBinaryAnd = ID(0x59)
|
||||||
IDXBinaryOr = ID(0x5A)
|
IDXBinaryOr = ID(0x5A)
|
||||||
IDXBinaryAs = ID(0x5B)
|
IDXBinaryAs = ID(0x5B)
|
||||||
IDXBinaryTildePlus = ID(0x5C)
|
IDXBinaryTildeModPlus = ID(0x5C)
|
||||||
|
IDXBinaryTildeModMinus = ID(0x5D)
|
||||||
|
|
||||||
IDXAssociativePlus = ID(0x60)
|
IDXAssociativePlus = ID(0x60)
|
||||||
IDXAssociativeStar = ID(0x61)
|
IDXAssociativeStar = ID(0x61)
|
||||||
@@ -439,7 +442,8 @@ var builtInsByID = [nBuiltInIDs]string{
|
|||||||
IDPipeEq: "|=",
|
IDPipeEq: "|=",
|
||||||
IDHatEq: "^=",
|
IDHatEq: "^=",
|
||||||
IDPercentEq: "%=",
|
IDPercentEq: "%=",
|
||||||
IDTildePlusEq: "~+=",
|
IDTildeModPlusEq: "~mod+=",
|
||||||
|
IDTildeModMinusEq: "~mod-=",
|
||||||
|
|
||||||
IDPlus: "+",
|
IDPlus: "+",
|
||||||
IDMinus: "-",
|
IDMinus: "-",
|
||||||
@@ -452,7 +456,8 @@ var builtInsByID = [nBuiltInIDs]string{
|
|||||||
IDPipe: "|",
|
IDPipe: "|",
|
||||||
IDHat: "^",
|
IDHat: "^",
|
||||||
IDPercent: "%",
|
IDPercent: "%",
|
||||||
IDTildePlus: "~+",
|
IDTildeModPlus: "~mod+",
|
||||||
|
IDTildeModMinus: "~mod-",
|
||||||
|
|
||||||
IDNotEq: "!=",
|
IDNotEq: "!=",
|
||||||
IDLessThan: "<",
|
IDLessThan: "<",
|
||||||
@@ -675,8 +680,10 @@ var lexers = [nBuiltInIDs][]suffixLexer{
|
|||||||
{"", IDGreaterThan},
|
{"", IDGreaterThan},
|
||||||
},
|
},
|
||||||
'~': {
|
'~': {
|
||||||
{"+=", IDTildePlusEq},
|
{"mod+=", IDTildeModPlusEq},
|
||||||
{"+", IDTildePlus},
|
{"mod+", IDTildeModPlus},
|
||||||
|
{"mod-=", IDTildeModMinusEq},
|
||||||
|
{"mod-", IDTildeModMinus},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -707,7 +714,8 @@ var ambiguousForms = [nBuiltInIDs]ID{
|
|||||||
IDXBinaryAnd: IDAnd,
|
IDXBinaryAnd: IDAnd,
|
||||||
IDXBinaryOr: IDOr,
|
IDXBinaryOr: IDOr,
|
||||||
IDXBinaryAs: IDAs,
|
IDXBinaryAs: IDAs,
|
||||||
IDXBinaryTildePlus: IDTildePlus,
|
IDXBinaryTildeModPlus: IDTildeModPlus,
|
||||||
|
IDXBinaryTildeModMinus: IDTildeModMinus,
|
||||||
|
|
||||||
IDXAssociativePlus: IDPlus,
|
IDXAssociativePlus: IDPlus,
|
||||||
IDXAssociativeStar: IDStar,
|
IDXAssociativeStar: IDStar,
|
||||||
@@ -764,7 +772,8 @@ var binaryForms = [nBuiltInIDs]ID{
|
|||||||
IDPipeEq: IDXBinaryPipe,
|
IDPipeEq: IDXBinaryPipe,
|
||||||
IDHatEq: IDXBinaryHat,
|
IDHatEq: IDXBinaryHat,
|
||||||
IDPercentEq: IDXBinaryPercent,
|
IDPercentEq: IDXBinaryPercent,
|
||||||
IDTildePlusEq: IDXBinaryTildePlus,
|
IDTildeModPlusEq: IDXBinaryTildeModPlus,
|
||||||
|
IDTildeModMinusEq: IDXBinaryTildeModMinus,
|
||||||
|
|
||||||
IDPlus: IDXBinaryPlus,
|
IDPlus: IDXBinaryPlus,
|
||||||
IDMinus: IDXBinaryMinus,
|
IDMinus: IDXBinaryMinus,
|
||||||
@@ -777,6 +786,9 @@ var binaryForms = [nBuiltInIDs]ID{
|
|||||||
IDPipe: IDXBinaryPipe,
|
IDPipe: IDXBinaryPipe,
|
||||||
IDHat: IDXBinaryHat,
|
IDHat: IDXBinaryHat,
|
||||||
IDPercent: IDXBinaryPercent,
|
IDPercent: IDXBinaryPercent,
|
||||||
|
IDTildeModPlus: IDXBinaryTildeModPlus,
|
||||||
|
IDTildeModMinus: IDXBinaryTildeModMinus,
|
||||||
|
|
||||||
IDNotEq: IDXBinaryNotEq,
|
IDNotEq: IDXBinaryNotEq,
|
||||||
IDLessThan: IDXBinaryLessThan,
|
IDLessThan: IDXBinaryLessThan,
|
||||||
IDLessEq: IDXBinaryLessEq,
|
IDLessEq: IDXBinaryLessEq,
|
||||||
@@ -786,7 +798,6 @@ var binaryForms = [nBuiltInIDs]ID{
|
|||||||
IDAnd: IDXBinaryAnd,
|
IDAnd: IDXBinaryAnd,
|
||||||
IDOr: IDXBinaryOr,
|
IDOr: IDXBinaryOr,
|
||||||
IDAs: IDXBinaryAs,
|
IDAs: IDXBinaryAs,
|
||||||
IDTildePlus: IDXBinaryTildePlus,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var associativeForms = [nBuiltInIDs]ID{
|
var associativeForms = [nBuiltInIDs]ID{
|
||||||
@@ -795,9 +806,9 @@ var associativeForms = [nBuiltInIDs]ID{
|
|||||||
IDAmp: IDXAssociativeAmp,
|
IDAmp: IDXAssociativeAmp,
|
||||||
IDPipe: IDXAssociativePipe,
|
IDPipe: IDXAssociativePipe,
|
||||||
IDHat: IDXAssociativeHat,
|
IDHat: IDXAssociativeHat,
|
||||||
|
// TODO: IDTildeModPlus, IDTildeModMinus?
|
||||||
IDAnd: IDXAssociativeAnd,
|
IDAnd: IDXAssociativeAnd,
|
||||||
IDOr: IDXAssociativeOr,
|
IDOr: IDXAssociativeOr,
|
||||||
// TODO: IDTildePlus?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var isOpen = [...]bool{
|
var isOpen = [...]bool{
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ pri func decoder.decode_huffman_slow?(dst base.io_writer, src base.io_reader)()
|
|||||||
}
|
}
|
||||||
if n_copied > 0 {
|
if n_copied > 0 {
|
||||||
hlen -= n_copied
|
hlen -= n_copied
|
||||||
hdist = (hdist ~+ n_copied) & 0x7FFF
|
hdist = (hdist ~mod+ n_copied) & 0x7FFF
|
||||||
if hdist == 0 {
|
if hdist == 0 {
|
||||||
// Wrap around the this.history ringbuffer.
|
// Wrap around the this.history ringbuffer.
|
||||||
break
|
break
|
||||||
@@ -233,7 +233,7 @@ pri func decoder.decode_huffman_slow?(dst base.io_writer, src base.io_reader)()
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
hlen -= n_copied
|
hlen -= n_copied
|
||||||
hdist = hdist ~+ n_copied
|
hdist ~mod+= n_copied
|
||||||
// TODO: "closed for writes" instead?
|
// TODO: "closed for writes" instead?
|
||||||
yield suspension "short write"
|
yield suspension "short write"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,8 +96,7 @@ pub func decoder.decode?(dst base.io_writer, src base.io_reader)() {
|
|||||||
var z base.status = try this.flate.decode?(dst:in.dst, src:in.src)
|
var z base.status = try this.flate.decode?(dst:in.dst, src:in.src)
|
||||||
if not this.ignore_checksum {
|
if not this.ignore_checksum {
|
||||||
checksum_got = this.checksum.update(x:in.dst.since_mark())
|
checksum_got = this.checksum.update(x:in.dst.since_mark())
|
||||||
decoded_length_got = decoded_length_got ~+
|
decoded_length_got ~mod+= ((in.dst.since_mark().length() & 0xFFFFFFFF) as base.u32)
|
||||||
((in.dst.since_mark().length() & 0xFFFFFFFF) as base.u32)
|
|
||||||
}
|
}
|
||||||
if z.is_ok() {
|
if z.is_ok() {
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ pri func adler32.update(x slice base.u8)(checksum base.u32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
iterate[8](p ptr base.u8:in.x) {
|
iterate[8](p ptr base.u8:in.x) {
|
||||||
s1 ~+= deref p as base.u32
|
s1 ~mod+= deref p as base.u32
|
||||||
s2 ~+= s1
|
s2 ~mod+= s1
|
||||||
}
|
}
|
||||||
|
|
||||||
s1 %= 65521
|
s1 %= 65521
|
||||||
|
|||||||
Reference in new issue
Block a user