From 287a054d228b3b12d8b7721605e7b5cbb5af3891 Mon Sep 17 00:00:00 2001 From: kayomn Date: Tue, 11 Oct 2022 01:15:19 +0100 Subject: [PATCH] Tidy up Oar Entry default data --- src/oar.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/oar.zig b/src/oar.zig index b85304a..be4f3d4 100644 --- a/src/oar.zig +++ b/src/oar.zig @@ -7,19 +7,19 @@ const sys = @import("./sys.zig"); /// Typically, following this block in memory is the file data it holds the meta-information for. /// pub const Entry = extern struct { - signature: [3]u8, + signature: [3]u8 = signature_magic, revision: u8, - name_length: u8, + name_length: u8 = 0, name_buffer: [255]u8 = std.mem.zeroes([255]u8), file_size: u64, - padding: [244]u8, + padding: [244]u8 = std.mem.zeroes([244]u8), /// /// Returns `true` if `entry` correctly identifies itself as a valid Oar entry, otherwise /// `false`. /// pub fn isValid(entry: Entry) bool { - return std.mem.eql(u8, &entry.signature, "oar"); + return std.mem.eql(u8, &entry.signature, signature_magic[0 ..]); } /// @@ -44,5 +44,5 @@ pub const Entry = extern struct { /// /// Magic identifier used to validate [Entry] data. /// - const signature_magic = "oar"; + const signature_magic = [3]u8{'o', 'a', 'r'}; };