Skip to content

Commit

Permalink
Add doc and change ceil_n to camelCase
Browse files Browse the repository at this point in the history
  • Loading branch information
dnjulek committed Apr 25, 2024
1 parent 7fac343 commit 3f6e7f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vshelper.zig
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ pub inline fn muldivRational(num: *i64, den: *i64, mul: i64, div: i64) void {
}
}

pub inline fn ceil_n(x: usize, n: usize) usize {
pub inline fn ceilN(x: usize, n: usize) usize {
return (x + (n - 1)) & ~(n - 1);
}

/// Helper to use Zig Optionals and saturate to return type
/// https://ziglang.org/documentation/master/#Optionals
pub fn mapGetN(comptime T: type, in: ?*const vs.Map, key: [*]const u8, index: c_int, vsapi: ?*const vs.API) ?T {
var err: vs.MapPropertyError = undefined;
const val: T = switch (@typeInfo(T)) {
Expand Down

0 comments on commit 3f6e7f6

Please sign in to comment.