mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
std: add "get_quirk(key: u32) u64"
This commit is contained in:
1 parent
84d1aa0d79
commit
4dfd70928b
20 files changed
+879
No files matched your search
@@ -61,6 +61,20 @@ pub struct decoder? implements base.token_decoder(
|
||||
stack : array[1024 / 32] base.u32,
|
||||
)
|
||||
|
||||
pub func decoder.get_quirk(key: base.u32) base.u64 {
|
||||
var key : base.u32
|
||||
|
||||
if args.key >= QUIRKS_BASE {
|
||||
key = args.key - QUIRKS_BASE
|
||||
if key < QUIRKS_COUNT {
|
||||
if this.quirks[key] {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
pub func decoder.set_quirk!(key: base.u32, value: base.u64) base.status {
|
||||
if args.key >= QUIRKS_BASE {
|
||||
args.key -= QUIRKS_BASE
|
||||
|
||||
Reference in new issue
Block a user