mirror of
https://github.com/ziglang/zig.git
synced 2024-11-17 01:23:54 +00:00
Replace magic numbers with named constants
This commit is contained in:
parent
d27721f58c
commit
0f0d01a037
@ -90,8 +90,8 @@ pub fn clock_getres(clock_id: i32, res: *timespec) errno_t {
|
||||
return err;
|
||||
}
|
||||
res.* = .{
|
||||
.tv_sec = @intCast(i64, ts / 1000000000),
|
||||
.tv_nsec = @intCast(isize, ts % 1000000000),
|
||||
.tv_sec = @intCast(i64, ts / std.time.ns_per_s),
|
||||
.tv_nsec = @intCast(isize, ts % std.time.ns_per_s),
|
||||
};
|
||||
return 0;
|
||||
}
|
||||
@ -103,8 +103,8 @@ pub fn clock_gettime(clock_id: i32, tp: *timespec) errno_t {
|
||||
return err;
|
||||
}
|
||||
tp.* = .{
|
||||
.tv_sec = @intCast(i64, ts / 1000000000),
|
||||
.tv_nsec = @intCast(isize, ts % 1000000000),
|
||||
.tv_sec = @intCast(i64, ts / std.time.ns_per_s),
|
||||
.tv_nsec = @intCast(isize, ts % std.time.ns_per_s),
|
||||
};
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user