aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/api/ffi.zig
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-07-18 01:20:20 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-18 01:20:20 -0700
commit661355546a4658ea927bfd70698577c1db301243 (patch)
tree2b8d33ea64ab6f23c5f1729d106076cbadd44c89 /src/bun.js/api/ffi.zig
parent71f1aa1802360d74d823b1a1544454b199b27898 (diff)
downloadbun-661355546a4658ea927bfd70698577c1db301243.tar.gz
bun-661355546a4658ea927bfd70698577c1db301243.tar.zst
bun-661355546a4658ea927bfd70698577c1db301243.zip
zig upgrade (#3667)
* upgrade * more fixes * Bump Zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js/api/ffi.zig')
-rw-r--r--src/bun.js/api/ffi.zig16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/bun.js/api/ffi.zig b/src/bun.js/api/ffi.zig
index ba31b67ed..1ca44619d 100644
--- a/src/bun.js/api/ffi.zig
+++ b/src/bun.js/api/ffi.zig
@@ -383,7 +383,7 @@ pub const FFI = struct {
const cb = JSC.NewRuntimeFunction(
global,
&str,
- @intCast(u32, function.arg_types.items.len),
+ @as(u32, @intCast(function.arg_types.items.len)),
bun.cast(JSC.JSHostFunctionPtr, compiled.ptr),
false,
);
@@ -479,7 +479,7 @@ pub const FFI = struct {
const cb = JSC.NewRuntimeFunction(
global,
name,
- @intCast(u32, function.arg_types.items.len),
+ @as(u32, @intCast(function.arg_types.items.len)),
bun.cast(JSC.JSHostFunctionPtr, compiled.ptr),
false,
);
@@ -523,7 +523,7 @@ pub const FFI = struct {
const int = val.to(i32);
switch (int) {
0...ABIType.max => {
- abi_types.appendAssumeCapacity(@enumFromInt(ABIType, int));
+ abi_types.appendAssumeCapacity(@as(ABIType, @enumFromInt(int)));
continue;
},
else => {
@@ -560,7 +560,7 @@ pub const FFI = struct {
const int = ret_value.toInt32();
switch (int) {
0...ABIType.max => {
- return_type = @enumFromInt(ABIType, int);
+ return_type = @as(ABIType, @enumFromInt(int));
break :brk;
},
else => {
@@ -594,11 +594,11 @@ pub const FFI = struct {
if (ptr.isNumber()) {
const num = ptr.asPtrAddress();
if (num > 0)
- function.symbol_from_dynamic_library = @ptrFromInt(*anyopaque, num);
+ function.symbol_from_dynamic_library = @as(*anyopaque, @ptrFromInt(num));
} else {
const num = ptr.toUInt64NoTruncate();
if (num > 0) {
- function.symbol_from_dynamic_library = @ptrFromInt(*anyopaque, num);
+ function.symbol_from_dynamic_library = @as(*anyopaque, @ptrFromInt(num));
}
}
}
@@ -831,7 +831,7 @@ pub const FFI = struct {
return;
}
- var bytes: []u8 = try allocator.alloc(u8, @intCast(usize, relocation_size));
+ var bytes: []u8 = try allocator.alloc(u8, @as(usize, @intCast(relocation_size)));
defer {
if (this.step == .failed) {
allocator.free(bytes);
@@ -1001,7 +1001,7 @@ pub const FFI = struct {
return;
}
- var bytes: []u8 = try allocator.alloc(u8, @intCast(usize, relocation_size));
+ var bytes: []u8 = try allocator.alloc(u8, @as(usize, @intCast(relocation_size)));
defer {
if (this.step == .failed) {
allocator.free(bytes);