Closed rw-vanc closed 8 months ago
Fixed, ignore this issue.
As an aside, I've been questioning whether we should have a separate boolean type - afaik it's never existed in the actual spec and we just treat it as a special-cased integer type and conversions back and forth make it seamless. Lmk if you have thoughts either way, and if no objections I'll explore getting rid of it
I don't think AmlValue::Boolean
is necessary. as_bool
is a useful thing, but it can probably just delegate to as_integer
and do self.as_integer(context)? != 0
.
In real-world AML, I have encountered
if (field)
. This requires evaluating the field as boolean. I would like to fix this by usingas_integer
to evaluate the field, butas_integer
takes context as an argument, andas_bool
does not. Most of the occurrences ofas_bool
have context readily available, but there is one case where it is not (the place where I actually need it).https://github.com/rust-osdev/acpi/blob/main/aml/src/statement.rs#L145
Can you recommend the change to this line so I can call
as_bool(context)
?