authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-12-15 06:22:08 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-12-15 06:22:08 -08:00
logde31b9db43013ae63d69f3a982dc4f5d8f682bc7
treee4bd4f7939fc104961c8e52eac3e47f3139bb5ae
parentcae43d7a20f0aa287b67ffdc58f07a56a8d90c34

util: move byte sizes to funcs


2 files changed, 5 insertions(+), 5 deletions(-)

src/util/funcs.zig+4
...@@ -6,6 +6,10 @@ const u = @import("index.zig");...@@ -6,6 +6,10 @@ const u = @import("index.zig");
6//6//
7//7//
88
9pub const b = 1;
10pub const kb = b * 1024;
11pub const mb = kb * 1024;
12
9pub fn print(comptime fmt: []const u8, args: anytype) void {13pub fn print(comptime fmt: []const u8, args: anytype) void {
10 std.debug.print(fmt++"\n", args);14 std.debug.print(fmt++"\n", args);
11}15}
src/util/module.zig+1-5
...@@ -7,10 +7,6 @@ const u = @import("index.zig");...@@ -7,10 +7,6 @@ const u = @import("index.zig");
7//7//
8//8//
99
10const b = 1;
11const kb = b * 1024;
12const mb = kb * 1024;
13
14pub const Module = struct {10pub const Module = struct {
15 is_sys_lib: bool,11 is_sys_lib: bool,
16 name: []const u8,12 name: []const u8,
...@@ -66,7 +62,7 @@ pub const Module = struct {...@@ -66,7 +62,7 @@ pub const Module = struct {
66 const abs_path = try u.concat(&[_][]const u8{cdpath, "/", self.clean_path, "/", item});62 const abs_path = try u.concat(&[_][]const u8{cdpath, "/", self.clean_path, "/", item});
67 const file = try std.fs.openFileAbsolute(abs_path, .{});63 const file = try std.fs.openFileAbsolute(abs_path, .{});
68 defer file.close();64 defer file.close();
69 const input = try file.reader().readAllAlloc(gpa, mb);65 const input = try file.reader().readAllAlloc(gpa, u.mb);
70 h.update(input);66 h.update(input);
71 }67 }
72 var out: [32]u8 = undefined;68 var out: [32]u8 = undefined;