Просмотр исходного кода

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 лет назад
Родитель
Сommit
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) => {
                 /*