mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 08:55:11 +01:00
Add a high_bits method.
This commit is contained in:
1 parent
73a4f2b263
commit
7e9b3aab67
5 files changed
+55
-15
No files matched your search
@@ -402,6 +402,22 @@ func (g *gen) cName(name string) string {
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func (g *gen) sizeof(typ *a.TypeExpr) (uint32, error) {
|
||||
if typ.Decorator() == 0 {
|
||||
switch typ.Name().Key() {
|
||||
case t.KeyU8:
|
||||
return 1, nil
|
||||
case t.KeyU16:
|
||||
return 2, nil
|
||||
case t.KeyU32:
|
||||
return 4, nil
|
||||
case t.KeyU64:
|
||||
return 8, nil
|
||||
}
|
||||
}
|
||||
return 0, fmt.Errorf("unknown sizeof for %q", typ.String(g.tm))
|
||||
}
|
||||
|
||||
func (g *gen) gatherStatuses(n *a.Status) error {
|
||||
raw := n.Message().String(g.tm)
|
||||
msg, ok := t.Unescape(raw)
|
||||
|
||||
Reference in new issue
Block a user