mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Zig fmt
This commit is contained in:
parent
f3d9c2f2bb
commit
2159d94b87
2 changed files with 6 additions and 7 deletions
|
@ -3,11 +3,11 @@ const always_inline = std.builtin.CallOptions.Modifier.always_inline;
|
||||||
const math = std.math;
|
const math = std.math;
|
||||||
|
|
||||||
pub fn atan(num: f64) callconv(.C) f64 {
|
pub fn atan(num: f64) callconv(.C) f64 {
|
||||||
return @call(.{ .modifier = always_inline }, math.atan, .{ num });
|
return @call(.{ .modifier = always_inline }, math.atan, .{num});
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn isFinite(num: f64) callconv(.C) bool {
|
pub fn isFinite(num: f64) callconv(.C) bool {
|
||||||
return @call(.{ .modifier = always_inline }, math.isFinite, .{ num });
|
return @call(.{ .modifier = always_inline }, math.isFinite, .{num});
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn powInt(base: i64, exp: i64) callconv(.C) i64 {
|
pub fn powInt(base: i64, exp: i64) callconv(.C) i64 {
|
||||||
|
@ -15,9 +15,9 @@ pub fn powInt(base: i64, exp: i64) callconv(.C) i64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn acos(num: f64) callconv(.C) f64 {
|
pub fn acos(num: f64) callconv(.C) f64 {
|
||||||
return @call(.{ .modifier = always_inline }, math.acos, .{ num });
|
return @call(.{ .modifier = always_inline }, math.acos, .{num});
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn asin(num: f64) callconv(.C) f64 {
|
pub fn asin(num: f64) callconv(.C) f64 {
|
||||||
return @call(.{ .modifier = always_inline }, math.asin, .{ num });
|
return @call(.{ .modifier = always_inline }, math.asin, .{num});
|
||||||
}
|
}
|
||||||
|
|
|
@ -276,7 +276,7 @@ pub const RocStr = extern struct {
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn init(bytes_ptr: [*]const u8, length: usize) callconv(.C) RocStr {
|
pub fn init(bytes_ptr: [*]const u8, length: usize) callconv(.C) RocStr {
|
||||||
return @call(.{ .modifier = always_inline }, RocStr.init, .{ std.heap.c_allocator, bytes_ptr, length});
|
return @call(.{ .modifier = always_inline }, RocStr.init, .{ std.heap.c_allocator, bytes_ptr, length });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Str.equal
|
// Str.equal
|
||||||
|
@ -956,7 +956,7 @@ test "RocStr.joinWith: result is big" {
|
||||||
|
|
||||||
pub fn isValidUnicode(ptr: [*]u8, len: usize) callconv(.C) bool {
|
pub fn isValidUnicode(ptr: [*]u8, len: usize) callconv(.C) bool {
|
||||||
const bytes: []u8 = ptr[0..len];
|
const bytes: []u8 = ptr[0..len];
|
||||||
return @call(.{ .modifier = always_inline }, unicode.utf8ValidateSlice, .{ bytes });
|
return @call(.{ .modifier = always_inline }, unicode.utf8ValidateSlice, .{bytes});
|
||||||
}
|
}
|
||||||
|
|
||||||
const Utf8DecodeError = error{
|
const Utf8DecodeError = error{
|
||||||
|
@ -990,7 +990,6 @@ pub const Utf8ByteProblem = packed enum(u8) {
|
||||||
InvalidStartByte = 3,
|
InvalidStartByte = 3,
|
||||||
OverlongEncoding = 4,
|
OverlongEncoding = 4,
|
||||||
UnexpectedEndOfSequence = 5,
|
UnexpectedEndOfSequence = 5,
|
||||||
|
|
||||||
};
|
};
|
||||||
pub const ValidateUtf8BytesResult = extern struct {
|
pub const ValidateUtf8BytesResult = extern struct {
|
||||||
is_ok: bool, byte_index: usize, problem_code: Utf8ByteProblem
|
is_ok: bool, byte_index: usize, problem_code: Utf8ByteProblem
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue