zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 88fdb303ff7a33d87207bbd61a648c5c1dbe56ad (tree)
parent 20ce0b9952167d531f0a0e679c1b0409e9049d09
Author: Nick Erdmann <n@nirf.de>
Date:   Tue,  6 Aug 2019 18:06:18 +0200

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

Diffstat:
Mstd/os/uefi/protocols/absolute_pointer_protocol.zig | 17++++-------------
Mstd/os/uefi/protocols/graphics_output_protocol.zig | 23++++++-----------------
Mstd/os/uefi/protocols/simple_pointer_protocol.zig | 20+++++---------------
Mstd/os/uefi/protocols/simple_text_input_ex_protocol.zig | 11++---------
4 files changed, 17 insertions(+), 54 deletions(-)

diff --git a/std/os/uefi/protocols/absolute_pointer_protocol.zig b/std/os/uefi/protocols/absolute_pointer_protocol.zig @@ -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, }; diff --git a/std/os/uefi/protocols/graphics_output_protocol.zig b/std/os/uefi/protocols/graphics_output_protocol.zig @@ -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) { diff --git a/std/os/uefi/protocols/simple_pointer_protocol.zig b/std/os/uefi/protocols/simple_pointer_protocol.zig @@ -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, }; diff --git a/std/os/uefi/protocols/simple_text_input_ex_protocol.zig b/std/os/uefi/protocols/simple_text_input_ex_protocol.zig @@ -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 {