std/os/uefi: replace init() with default values

This commit is contained in:
Nick Erdmann 2019-08-06 18:06:18 +02:00
parent 20ce0b9952
commit 88fdb303ff
No known key found for this signature in database
GPG Key ID: C174038EAF6578B2
4 changed files with 17 additions and 54 deletions

View File

@ -43,22 +43,13 @@ pub const AbsolutePointerMode = extern struct {
};
pub const AbsolutePointerState = extern struct {
current_x: u64,
current_y: u64,
current_z: u64,
current_x: u64 = undefined,
current_y: u64 = undefined,
current_z: u64 = undefined,
active_buttons: packed struct {
_pad1: u6,
alt_active: bool,
touch_active: bool,
_pad2: u24,
},
pub fn init() AbsolutePointerState {
return AbsolutePointerState{
.current_x = undefined,
.current_y = undefined,
.current_z = undefined,
.active_buttons = undefined,
};
}
} = undefined,
};

View File

@ -40,23 +40,12 @@ pub const GraphicsOutputProtocolMode = extern struct {
};
pub const GraphicsOutputModeInformation = extern struct {
version: u32,
horizontal_resolution: u32,
vertical_resolution: u32,
pixel_format: GraphicsPixelFormat,
pixel_information: PixelBitmask,
pixels_per_scan_line: u32,
pub fn init() GraphicsOutputModeInformation {
return GraphicsOutputModeInformation{
.version = undefined,
.horizontal_resolution = undefined,
.vertical_resolution = undefined,
.pixel_format = undefined,
.pixel_information = undefined,
.pixels_per_scan_line = undefined,
};
}
version: u32 = undefined,
horizontal_resolution: u32 = undefined,
vertical_resolution: u32 = undefined,
pixel_format: GraphicsPixelFormat = undefined,
pixel_information: PixelBitmask = undefined,
pixels_per_scan_line: u32 = undefined,
};
pub const GraphicsPixelFormat = extern enum(u32) {

View File

@ -36,19 +36,9 @@ pub const SimplePointerMode = struct {
};
pub const SimplePointerState = struct {
relative_movement_x: i32,
relative_movement_y: i32,
relative_movement_z: i32,
left_button: bool,
right_button: bool,
pub fn init() SimplePointerState {
return SimplePointerState{
.relative_movement_x = undefined,
.relative_movement_y = undefined,
.relative_movement_z = undefined,
.left_button = undefined,
.right_button = undefined,
};
}
relative_movement_x: i32 = undefined,
relative_movement_y: i32 = undefined,
relative_movement_z: i32 = undefined,
left_button: bool = undefined,
right_button: bool = undefined,
};

View File

@ -42,15 +42,8 @@ pub const SimpleTextInputExProtocol = extern struct {
};
pub const KeyData = extern struct {
key: InputKey,
key_state: KeyState,
pub fn init() KeyData {
return KeyData{
.key = undefined,
.key_state = undefined,
};
}
key: InputKey = undefined,
key_state: KeyState = undefined,
};
pub const KeyState = extern struct {