Skip to content

uefi: Fix use of tuples in pointer structs #822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- Renamed `FileSystemIOErrorContext` to `IoErrorContext`.
- `ResetType` is now a newtype-enum instead of a Rust enum. Its members now have
upper-case names.
- `PointerMode` and `PointerState` now contain arrays rather than tuples, as
tuples are not FFI safe.

## uefi-macros - [Unreleased]

Expand Down
8 changes: 4 additions & 4 deletions uefi/src/proto/console/pointer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ impl Pointer {
pub struct PointerMode {
/// The pointer device's resolution on the X/Y/Z axis in counts/mm.
/// If a value is 0, then the device does _not_ support that axis.
pub resolution: (u64, u64, u64),
pub resolution: [u64; 3],
/// Whether the devices has a left button / right button.
pub has_button: (bool, bool),
pub has_button: [bool; 2],
}

/// The relative change in the pointer's state.
Expand All @@ -76,9 +76,9 @@ pub struct PointerState {
/// The relative movement on the X/Y/Z axis.
///
/// If `PointerMode` indicates an axis is not supported, it must be ignored.
pub relative_movement: (i32, i32, i32),
pub relative_movement: [i32; 3],
/// Whether the left / right mouse button is currently pressed.
///
/// If `PointerMode` indicates a button is not supported, it must be ignored.
pub button: (bool, bool),
pub button: [bool; 2],
}