aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-08-22 14:32:31 +0300
committerGitHub <noreply@github.com>2022-08-22 14:32:31 +0300
commit8667d6d61e8217159377c0e22bc35075848d1202 (patch)
tree4dd89f89f346d2a1f435efff54cd27d33485f2c5 /lib/std
parentf1999712b0a8560bd84726c8a5e8fd37dbdf5375 (diff)
parent5404dcdfd844e4b9f47dc49a1f43f0e1075a563f (diff)
downloadzig-8667d6d61e8217159377c0e22bc35075848d1202.tar.gz
zig-8667d6d61e8217159377c0e22bc35075848d1202.zip
Merge pull request #12563 from Vexu/stage2-fixes
Stage2 fixes
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/fs/path.zig2
-rw-r--r--lib/std/math.zig2
-rw-r--r--lib/std/math/float.zig2
-rw-r--r--lib/std/zig/c_translation.zig2
-rw-r--r--lib/std/zig/parse.zig2
5 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/fs/path.zig b/lib/std/fs/path.zig
index d5583dcc80..9dc3367688 100644
--- a/lib/std/fs/path.zig
+++ b/lib/std/fs/path.zig
@@ -42,7 +42,7 @@ pub fn isSep(byte: u8) bool {
/// This is different from mem.join in that the separator will not be repeated if
/// it is found at the end or beginning of a pair of consecutive paths.
-fn joinSepMaybeZ(allocator: Allocator, separator: u8, sepPredicate: fn (u8) bool, paths: []const []const u8, zero: bool) ![]u8 {
+fn joinSepMaybeZ(allocator: Allocator, separator: u8, comptime sepPredicate: fn (u8) bool, paths: []const []const u8, zero: bool) ![]u8 {
if (paths.len == 0) return if (zero) try allocator.dupe(u8, &[1]u8{0}) else &[0]u8{};
// Find first non-empty path index.
diff --git a/lib/std/math.zig b/lib/std/math.zig
index 40b5eb9204..1ed9604612 100644
--- a/lib/std/math.zig
+++ b/lib/std/math.zig
@@ -1548,7 +1548,7 @@ test "boolMask" {
}
/// Return the mod of `num` with the smallest integer type
-pub fn comptimeMod(num: anytype, denom: comptime_int) IntFittingRange(0, denom - 1) {
+pub fn comptimeMod(num: anytype, comptime denom: comptime_int) IntFittingRange(0, denom - 1) {
return @intCast(IntFittingRange(0, denom - 1), @mod(num, denom));
}
diff --git a/lib/std/math/float.zig b/lib/std/math/float.zig
index 30e456fcbd..768cc03285 100644
--- a/lib/std/math/float.zig
+++ b/lib/std/math/float.zig
@@ -8,7 +8,7 @@ inline fn mantissaOne(comptime T: type) comptime_int {
}
/// Creates floating point type T from an unbiased exponent and raw mantissa.
-inline fn reconstructFloat(comptime T: type, exponent: comptime_int, mantissa: comptime_int) T {
+inline fn reconstructFloat(comptime T: type, comptime exponent: comptime_int, comptime mantissa: comptime_int) T {
const TBits = @Type(.{ .Int = .{ .signedness = .unsigned, .bits = @bitSizeOf(T) } });
const biased_exponent = @as(TBits, exponent + floatExponentMax(T));
return @bitCast(T, (biased_exponent << floatMantissaBits(T)) | @as(TBits, mantissa));
diff --git a/lib/std/zig/c_translation.zig b/lib/std/zig/c_translation.zig
index 8a2086e9ad..348e3a7133 100644
--- a/lib/std/zig/c_translation.zig
+++ b/lib/std/zig/c_translation.zig
@@ -349,7 +349,7 @@ test "shuffleVectorIndex" {
/// Constructs a [*c] pointer with the const and volatile annotations
/// from SelfType for pointing to a C flexible array of ElementType.
-pub fn FlexibleArrayType(comptime SelfType: type, ElementType: type) type {
+pub fn FlexibleArrayType(comptime SelfType: type, comptime ElementType: type) type {
switch (@typeInfo(SelfType)) {
.Pointer => |ptr| {
return @Type(.{ .Pointer = .{
diff --git a/lib/std/zig/parse.zig b/lib/std/zig/parse.zig
index a03764a91c..fda6ad98b9 100644
--- a/lib/std/zig/parse.zig
+++ b/lib/std/zig/parse.zig
@@ -3670,7 +3670,7 @@ const Parser = struct {
}
/// KEYWORD_if LPAREN Expr RPAREN PtrPayload? Body (KEYWORD_else Payload? Body)?
- fn parseIf(p: *Parser, bodyParseFn: fn (p: *Parser) Error!Node.Index) !Node.Index {
+ fn parseIf(p: *Parser, comptime bodyParseFn: fn (p: *Parser) Error!Node.Index) !Node.Index {
const if_token = p.eatToken(.keyword_if) orelse return null_node;
_ = try p.expectToken(.l_paren);
const condition = try p.expectExpr();