authorgravatar for contact@fengb.meBenjamin Feng <contact@fengb.me> 2019-11-21 18:41:02-06:00
committergravatar for contact@fengb.meBenjamin Feng <contact@fengb.me> 2019-11-21 18:41:02-06:00
log0f0d01a0374dd62d55a0fe3eed72b9ec009af410
tree54b69968d477eb51fae09756ab40d2773714b911
parentd27721f58cfeff5fcd805125875e9c55b54b65bd

Replace magic numbers with named constants


1 files changed, 4 insertions(+), 4 deletions(-)

lib/std/os/wasi.zig+4-4
......@@ -90,8 +90,8 @@ pub fn clock_getres(clock_id: i32, res: *timespec) errno_t {
9090 return err;
9191 }
9292 res.* = .{
93 .tv_sec = @intCast(i64, ts / 1000000000),
94 .tv_nsec = @intCast(isize, ts % 1000000000),
93 .tv_sec = @intCast(i64, ts / std.time.ns_per_s),
94 .tv_nsec = @intCast(isize, ts % std.time.ns_per_s),
9595 };
9696 return 0;
9797}
......@@ -103,8 +103,8 @@ pub fn clock_gettime(clock_id: i32, tp: *timespec) errno_t {
103103 return err;
104104 }
105105 tp.* = .{
106 .tv_sec = @intCast(i64, ts / 1000000000),
107 .tv_nsec = @intCast(isize, ts % 1000000000),
106 .tv_sec = @intCast(i64, ts / std.time.ns_per_s),
107 .tv_nsec = @intCast(isize, ts % std.time.ns_per_s),
108108 };
109109 return 0;
110110}