all: zig fmt and rename "@XToY" to "@YFromX"

Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
This commit is contained in:
Eric Joldasov
2023-06-15 13:14:16 +06:00
committed by Andrew Kelley
parent a6c8ee5231
commit 50339f595a
665 changed files with 6204 additions and 5889 deletions

View File

@@ -143,11 +143,11 @@ export fn zig_longdouble(x: c_longdouble) void {
extern fn c_ptr(*anyopaque) void;
test "C ABI pointer" {
c_ptr(@intToPtr(*anyopaque, 0xdeadbeef));
c_ptr(@ptrFromInt(*anyopaque, 0xdeadbeef));
}
export fn zig_ptr(x: *anyopaque) void {
expect(@ptrToInt(x) == 0xdeadbeef) catch @panic("test failure: zig_ptr");
expect(@intFromPtr(x) == 0xdeadbeef) catch @panic("test failure: zig_ptr");
}
extern fn c_bool(bool) void;
@@ -1058,14 +1058,14 @@ test "C function that takes byval struct called via function pointer" {
var fn_ptr = &c_func_ptr_byval;
fn_ptr(
@intToPtr(*anyopaque, 1),
@intToPtr(*anyopaque, 2),
@ptrFromInt(*anyopaque, 1),
@ptrFromInt(*anyopaque, 2),
ByVal{
.origin = .{ .x = 9, .y = 10, .z = 11 },
.size = .{ .width = 12, .height = 13, .depth = 14 },
},
@as(c_ulong, 3),
@intToPtr(*anyopaque, 4),
@ptrFromInt(*anyopaque, 4),
@as(c_ulong, 5),
);
}