aboutsummaryrefslogtreecommitdiff
path: root/src/linux_c.zig
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-06-21 23:38:18 -0700
committerGravatar GitHub <noreply@github.com> 2023-06-21 23:38:18 -0700
commit5fa13625a1ca0ea1a3a1c5bb86d0880dcfac349f (patch)
tree97f669a178e60772038751d690c3e298a63557b2 /src/linux_c.zig
parentbfb322d618a3f0e9618d311ae69016fe7a08e771 (diff)
downloadbun-5fa13625a1ca0ea1a3a1c5bb86d0880dcfac349f.tar.gz
bun-5fa13625a1ca0ea1a3a1c5bb86d0880dcfac349f.tar.zst
bun-5fa13625a1ca0ea1a3a1c5bb86d0880dcfac349f.zip
upgrade zig to `v0.11.0-dev.3737+9eb008717` (#3374)
* progress * finish `@memset/@memcpy` update * Update build.zig * change `@enumToInt` to `@intFromEnum` and friends * update zig versions * it was 1 * add link to issue * add `compileError` reminder * fix merge * format * upgrade to llvm 16 * Revert "upgrade to llvm 16" This reverts commit cc930ceb1c5b4db9614a7638596948f704544ab8. --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/linux_c.zig')
-rw-r--r--src/linux_c.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/linux_c.zig b/src/linux_c.zig
index dade43a32..12e3c9b73 100644
--- a/src/linux_c.zig
+++ b/src/linux_c.zig
@@ -148,7 +148,7 @@ pub const SystemErrno = enum(u8) {
}
if (code >= max) return null;
- return @intToEnum(SystemErrno, code);
+ return @enumFromInt(SystemErrno, code);
}
pub fn label(this: SystemErrno) ?[]const u8 {
@@ -385,9 +385,9 @@ pub fn splice(fd_in: std.os.fd_t, off_in: ?*i64, fd_out: std.os.fd_t, off_out: ?
return std.os.linux.syscall6(
.splice,
@bitCast(usize, @as(isize, fd_in)),
- @ptrToInt(off_in),
+ @intFromPtr(off_in),
@bitCast(usize, @as(isize, fd_out)),
- @ptrToInt(off_out),
+ @intFromPtr(off_out),
len,
flags,
);
@@ -438,9 +438,9 @@ pub fn get_system_loadavg() [3]f64 {
var info: struct_sysinfo = undefined;
if (sysinfo(&info) == @as(c_int, 0)) {
return [3]f64{
- std.math.ceil((@intToFloat(f64, info.loads[0]) / 65536.0) * 100.0) / 100.0,
- std.math.ceil((@intToFloat(f64, info.loads[1]) / 65536.0) * 100.0) / 100.0,
- std.math.ceil((@intToFloat(f64, info.loads[2]) / 65536.0) * 100.0) / 100.0,
+ std.math.ceil((@floatFromInt(f64, info.loads[0]) / 65536.0) * 100.0) / 100.0,
+ std.math.ceil((@floatFromInt(f64, info.loads[1]) / 65536.0) * 100.0) / 100.0,
+ std.math.ceil((@floatFromInt(f64, info.loads[2]) / 65536.0) * 100.0) / 100.0,
};
}
return [3]f64{ 0, 0, 0 };