mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 00:47:28 +01:00
Implement the gzip checksum
Also fix a bug in ast.Raw.SetPackage, discovered because type checking failed to show that "[] u8" and "[] u8" are equivalent types.
This commit is contained in:
1 parent
153d1276a1
commit
a8e40fedc9
7 files changed
+184
-28
No files matched your search
@@ -324,8 +324,12 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare
|
||||
return nil
|
||||
}
|
||||
if isThatMethod(g.tm, n, g.tm.ByName("update").Key(), 1) {
|
||||
// TODO: don't hard-code this.checksum.
|
||||
b.printf("%sadler32__update(&self->private_impl.f_checksum, ", g.pkgPrefix)
|
||||
// TODO: don't hard-code the class name or this.checksum.
|
||||
class := "wuffs_crc32__ieee"
|
||||
if g.pkgName == "zlib" {
|
||||
class = "wuffs_zlib__adler32"
|
||||
}
|
||||
b.printf("%s__update(&self->private_impl.f_checksum, ", class)
|
||||
a := n.Args()[0].Arg().Value()
|
||||
if err := g.writeExpr(b, a, rp, parenthesesMandatory, depth); err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user