Skip to content

Commit 1bceef0

Browse files
uefi-raw: Replace remaining uses of bool with Boolean
1 parent 0bef927 commit 1bceef0

File tree

6 files changed

+18
-16
lines changed

6 files changed

+18
-16
lines changed

uefi-raw/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Added
44

55
## Changed
6+
- **Breaking:** Various uses of `bool` have been replaced with `Boolean`.
67

78

89
# uefi-raw - v0.12 (2025-10-21)

uefi-raw/src/protocol/device_path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ pub struct DevicePathUtilitiesProtocol {
289289
device_path_instance_size: *mut usize,
290290
) -> *const DevicePathProtocol,
291291
pub is_device_path_multi_instance:
292-
unsafe extern "efiapi" fn(device_path: *const DevicePathProtocol) -> bool,
292+
unsafe extern "efiapi" fn(device_path: *const DevicePathProtocol) -> Boolean,
293293
pub create_device_node: unsafe extern "efiapi" fn(
294294
node_type: DeviceType,
295295
node_sub_type: DeviceSubType,

uefi-raw/src/protocol/hii/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use core::fmt::Debug;
66

77
use crate::protocol::device_path::DevicePathProtocol;
8-
use crate::{Char16, Guid, Status, guid, newtype_enum};
8+
use crate::{Boolean, Char16, Guid, Status, guid, newtype_enum};
99

1010
/// EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL
1111
#[derive(Debug)]
@@ -129,7 +129,7 @@ pub union IfrTypeValue {
129129
pub u16: u16, // EFI_IFR_TYPE_NUM_SIZE_16
130130
pub u32: u32, // EFI_IFR_TYPE_NUM_SIZE_32
131131
pub u64: u64, // EFI_IFR_TYPE_NUM_SIZE_64
132-
pub b: bool, // EFI_IFR_TYPE_BOOLEAN
132+
pub b: Boolean, // EFI_IFR_TYPE_BOOLEAN
133133
pub time: HiiTime, // EFI_IFR_TYPE_TIME
134134
pub date: HiiDate, // EFI_IFR_TYPE_DATE
135135
pub string: StringId, // EFI_IFR_TYPE_STRING, EFI_IFR_TYPE_ACTION

uefi-raw/src/protocol/shell.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use core::ffi::c_void;
66

7-
use crate::{Char8, Char16, Event, Guid, Handle, Status, guid};
7+
use crate::{Boolean, Char8, Char16, Event, Guid, Handle, Status, guid};
88

99
use super::device_path::DevicePathProtocol;
1010
use super::file_system::FileInfo;
@@ -58,14 +58,15 @@ pub struct ShellProtocol {
5858
pub set_env: unsafe extern "efiapi" fn(
5959
name: *const Char16,
6060
value: *const Char16,
61-
volatile: bool,
61+
volatile: Boolean,
6262
) -> Status,
63-
pub get_alias: unsafe extern "efiapi" fn(alias: *const Char16, volatile: bool) -> *const Char16,
63+
pub get_alias:
64+
unsafe extern "efiapi" fn(alias: *const Char16, volatile: Boolean) -> *const Char16,
6465
pub set_alias: unsafe extern "efiapi" fn(
6566
command: *const Char16,
6667
alias: *const Char16,
67-
replace: bool,
68-
volatile: bool,
68+
replace: Boolean,
69+
volatile: Boolean,
6970
) -> Status,
7071
pub get_help_text: unsafe extern "efiapi" fn(
7172
command: *const Char16,
@@ -97,11 +98,11 @@ pub struct ShellProtocol {
9798
pub remove_dup_in_file_list:
9899
unsafe extern "efiapi" fn(file_list: *const *const ShellFileInfo) -> Status,
99100

100-
pub batch_is_active: unsafe extern "efiapi" fn() -> bool,
101-
pub is_root_shell: unsafe extern "efiapi" fn() -> bool,
101+
pub batch_is_active: unsafe extern "efiapi" fn() -> Boolean,
102+
pub is_root_shell: unsafe extern "efiapi" fn() -> Boolean,
102103
pub enable_page_break: unsafe extern "efiapi" fn(),
103104
pub disable_page_break: unsafe extern "efiapi" fn(),
104-
pub get_page_break: unsafe extern "efiapi" fn() -> bool,
105+
pub get_page_break: unsafe extern "efiapi" fn() -> Boolean,
105106
pub get_device_name: unsafe extern "efiapi" fn(
106107
device_handle: Handle,
107108
flags: ShellDeviceNameFlags,

uefi-raw/src/protocol/string.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{Char8, Char16, Guid, guid};
3+
use crate::{Boolean, Char8, Char16, Guid, guid};
44

55
#[derive(Debug)]
66
#[repr(C)]
@@ -11,7 +11,7 @@ pub struct UnicodeCollationProtocol {
1111
this: *const Self,
1212
string: *const Char16,
1313
pattern: *const Char16,
14-
) -> bool,
14+
) -> Boolean,
1515
pub str_lwr: unsafe extern "efiapi" fn(this: *const Self, s: *mut Char16),
1616
pub str_upr: unsafe extern "efiapi" fn(this: *const Self, s: *mut Char16),
1717
pub fat_to_str: unsafe extern "efiapi" fn(
@@ -25,7 +25,7 @@ pub struct UnicodeCollationProtocol {
2525
s: *const Char16,
2626
fat_size: usize,
2727
fat: *mut Char8,
28-
) -> bool,
28+
) -> Boolean,
2929
pub supported_languages: *const Char8,
3030
}
3131

uefi/src/proto/string/unicode_collation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl UnicodeCollation {
5454
/// any single character followed by a "." followed by any string.
5555
#[must_use]
5656
pub fn metai_match(&self, s: &CStr16, pattern: &CStr16) -> bool {
57-
unsafe { (self.0.metai_match)(&self.0, s.as_ptr().cast(), pattern.as_ptr().cast()) }
57+
unsafe { (self.0.metai_match)(&self.0, s.as_ptr().cast(), pattern.as_ptr().cast()) }.into()
5858
}
5959

6060
/// Converts the characters in `s` to lower case characters.
@@ -132,7 +132,7 @@ impl UnicodeCollation {
132132
buf.as_mut_ptr(),
133133
)
134134
};
135-
if failed {
135+
if bool::from(failed) {
136136
Err(StrConversionError::ConversionFailed)
137137
} else {
138138
// After the conversion, there is a possibility that the converted string

0 commit comments

Comments
 (0)