diff --git a/uefi-raw/CHANGELOG.md b/uefi-raw/CHANGELOG.md index 1ff1e6625..3ef2e23ae 100644 --- a/uefi-raw/CHANGELOG.md +++ b/uefi-raw/CHANGELOG.md @@ -3,6 +3,7 @@ ## Added ## Changed +- **Breaking:** Various uses of `bool` have been replaced with `Boolean`. # uefi-raw - v0.12 (2025-10-21) diff --git a/uefi-raw/src/protocol/device_path.rs b/uefi-raw/src/protocol/device_path.rs index 95c5fdbce..fa05b616b 100644 --- a/uefi-raw/src/protocol/device_path.rs +++ b/uefi-raw/src/protocol/device_path.rs @@ -289,7 +289,7 @@ pub struct DevicePathUtilitiesProtocol { device_path_instance_size: *mut usize, ) -> *const DevicePathProtocol, pub is_device_path_multi_instance: - unsafe extern "efiapi" fn(device_path: *const DevicePathProtocol) -> bool, + unsafe extern "efiapi" fn(device_path: *const DevicePathProtocol) -> Boolean, pub create_device_node: unsafe extern "efiapi" fn( node_type: DeviceType, node_sub_type: DeviceSubType, diff --git a/uefi-raw/src/protocol/hii/config.rs b/uefi-raw/src/protocol/hii/config.rs index 740de6499..1982524c3 100644 --- a/uefi-raw/src/protocol/hii/config.rs +++ b/uefi-raw/src/protocol/hii/config.rs @@ -5,7 +5,7 @@ use core::fmt::Debug; use crate::protocol::device_path::DevicePathProtocol; -use crate::{Char16, Guid, Status, guid, newtype_enum}; +use crate::{Boolean, Char16, Guid, Status, guid, newtype_enum}; /// EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL #[derive(Debug)] @@ -129,7 +129,7 @@ pub union IfrTypeValue { pub u16: u16, // EFI_IFR_TYPE_NUM_SIZE_16 pub u32: u32, // EFI_IFR_TYPE_NUM_SIZE_32 pub u64: u64, // EFI_IFR_TYPE_NUM_SIZE_64 - pub b: bool, // EFI_IFR_TYPE_BOOLEAN + pub b: Boolean, // EFI_IFR_TYPE_BOOLEAN pub time: HiiTime, // EFI_IFR_TYPE_TIME pub date: HiiDate, // EFI_IFR_TYPE_DATE pub string: StringId, // EFI_IFR_TYPE_STRING, EFI_IFR_TYPE_ACTION diff --git a/uefi-raw/src/protocol/shell.rs b/uefi-raw/src/protocol/shell.rs index 8e9500221..621e9dd6f 100644 --- a/uefi-raw/src/protocol/shell.rs +++ b/uefi-raw/src/protocol/shell.rs @@ -4,7 +4,7 @@ use core::ffi::c_void; -use crate::{Char8, Char16, Event, Guid, Handle, Status, guid}; +use crate::{Boolean, Char8, Char16, Event, Guid, Handle, Status, guid}; use super::device_path::DevicePathProtocol; use super::file_system::FileInfo; @@ -58,14 +58,15 @@ pub struct ShellProtocol { pub set_env: unsafe extern "efiapi" fn( name: *const Char16, value: *const Char16, - volatile: bool, + volatile: Boolean, ) -> Status, - pub get_alias: unsafe extern "efiapi" fn(alias: *const Char16, volatile: bool) -> *const Char16, + pub get_alias: + unsafe extern "efiapi" fn(alias: *const Char16, volatile: Boolean) -> *const Char16, pub set_alias: unsafe extern "efiapi" fn( command: *const Char16, alias: *const Char16, - replace: bool, - volatile: bool, + replace: Boolean, + volatile: Boolean, ) -> Status, pub get_help_text: unsafe extern "efiapi" fn( command: *const Char16, @@ -97,11 +98,11 @@ pub struct ShellProtocol { pub remove_dup_in_file_list: unsafe extern "efiapi" fn(file_list: *const *const ShellFileInfo) -> Status, - pub batch_is_active: unsafe extern "efiapi" fn() -> bool, - pub is_root_shell: unsafe extern "efiapi" fn() -> bool, + pub batch_is_active: unsafe extern "efiapi" fn() -> Boolean, + pub is_root_shell: unsafe extern "efiapi" fn() -> Boolean, pub enable_page_break: unsafe extern "efiapi" fn(), pub disable_page_break: unsafe extern "efiapi" fn(), - pub get_page_break: unsafe extern "efiapi" fn() -> bool, + pub get_page_break: unsafe extern "efiapi" fn() -> Boolean, pub get_device_name: unsafe extern "efiapi" fn( device_handle: Handle, flags: ShellDeviceNameFlags, diff --git a/uefi-raw/src/protocol/string.rs b/uefi-raw/src/protocol/string.rs index 37b9695ca..4f2ed5bab 100644 --- a/uefi-raw/src/protocol/string.rs +++ b/uefi-raw/src/protocol/string.rs @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 -use crate::{Char8, Char16, Guid, guid}; +use crate::{Boolean, Char8, Char16, Guid, guid}; #[derive(Debug)] #[repr(C)] @@ -11,7 +11,7 @@ pub struct UnicodeCollationProtocol { this: *const Self, string: *const Char16, pattern: *const Char16, - ) -> bool, + ) -> Boolean, pub str_lwr: unsafe extern "efiapi" fn(this: *const Self, s: *mut Char16), pub str_upr: unsafe extern "efiapi" fn(this: *const Self, s: *mut Char16), pub fat_to_str: unsafe extern "efiapi" fn( @@ -25,7 +25,7 @@ pub struct UnicodeCollationProtocol { s: *const Char16, fat_size: usize, fat: *mut Char8, - ) -> bool, + ) -> Boolean, pub supported_languages: *const Char8, } diff --git a/uefi/src/proto/string/unicode_collation.rs b/uefi/src/proto/string/unicode_collation.rs index eb9f1f12a..5adcdad7e 100644 --- a/uefi/src/proto/string/unicode_collation.rs +++ b/uefi/src/proto/string/unicode_collation.rs @@ -54,7 +54,7 @@ impl UnicodeCollation { /// any single character followed by a "." followed by any string. #[must_use] pub fn metai_match(&self, s: &CStr16, pattern: &CStr16) -> bool { - unsafe { (self.0.metai_match)(&self.0, s.as_ptr().cast(), pattern.as_ptr().cast()) } + unsafe { (self.0.metai_match)(&self.0, s.as_ptr().cast(), pattern.as_ptr().cast()) }.into() } /// Converts the characters in `s` to lower case characters. @@ -132,7 +132,7 @@ impl UnicodeCollation { buf.as_mut_ptr(), ) }; - if failed { + if bool::from(failed) { Err(StrConversionError::ConversionFailed) } else { // After the conversion, there is a possibility that the converted string