mirror of
https://github.com/rust-osdev/uefi-rs
synced 2026-06-08 17:17:36 +00:00
Merge pull request #1801 from rust-osdev/bishop-use-bool
uefi-raw: Replace remaining uses of bool with Boolean
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
## Added
|
||||
|
||||
## Changed
|
||||
- **Breaking:** Various uses of `bool` have been replaced with `Boolean`.
|
||||
|
||||
|
||||
# uefi-raw - v0.12 (2025-10-21)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user