Commit 88fdb303ff

Nick Erdmann <n@nirf.de>
2019-08-06 18:06:18
std/os/uefi: replace init() with default values
1 parent 20ce0b9
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,
 };
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) {
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,
 };
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 {