2
0
Эх сурвалжийг харах

Convert booleans to integers when asked

Boolean isn't a real AML type, so should definitely convert to an integer
seamlessly when required.
Isaac Woods 3 жил өмнө
parent
commit
b303da95f9
1 өөрчлөгдсөн 1 нэмэгдсэн , 0 устгасан
  1. 1 0
      aml/src/value.rs

+ 1 - 0
aml/src/value.rs

@@ -260,6 +260,7 @@ impl AmlValue {
     pub fn as_integer(&self, context: &AmlContext) -> Result<u64, AmlError> {
         match self {
             AmlValue::Integer(value) => Ok(*value),
+            AmlValue::Boolean(value) => Ok(if *value { u64::max_value() } else { 0 }),
 
             AmlValue::Buffer(ref bytes) => {
                 /*