From 4b35e80f96f1b00be8ac3886399c49ce3af5239d Mon Sep 17 00:00:00 2001 From: FalsePattern <30945458+FalsePattern@users.noreply.github.com> Date: Sat, 17 Jun 2023 16:32:09 +0200 Subject: [PATCH] Replace deprecated calls std.math.min, std.math.max, std.math.inf_f32 Were removed from the standard library and no longer compile. --- src/analyser/InternPool.zig | 4 ++-- src/analysis.zig | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/analyser/InternPool.zig b/src/analyser/InternPool.zig index ac3880e..ae08e1b 100644 --- a/src/analyser/InternPool.zig +++ b/src/analyser/InternPool.zig @@ -3023,8 +3023,8 @@ test "float value" { const f32_nan_value = try ip.get(gpa, .{ .float_32_value = std.math.nan_f32 }); const f32_qnan_value = try ip.get(gpa, .{ .float_32_value = std.math.qnan_f32 }); - const f32_inf_value = try ip.get(gpa, .{ .float_32_value = std.math.inf_f32 }); - const f32_ninf_value = try ip.get(gpa, .{ .float_32_value = -std.math.inf_f32 }); + const f32_inf_value = try ip.get(gpa, .{ .float_32_value = std.math.inf(f32) }); + const f32_ninf_value = try ip.get(gpa, .{ .float_32_value = -std.math.inf(f32) }); const f32_zero_value = try ip.get(gpa, .{ .float_32_value = 0.0 }); const f32_nzero_value = try ip.get(gpa, .{ .float_32_value = -0.0 }); diff --git a/src/analysis.zig b/src/analysis.zig index 85986fa..be70947 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -792,7 +792,7 @@ fn resolveTypeOfNodeUncached(analyser: *Analyser, node_handle: NodeWithHandle) e } // Bind type params to the arguments passed in the call. - const param_len = std.math.min(call.ast.params.len, expected_params); + const param_len = @min(call.ast.params.len, expected_params); var i: usize = 0; while (ast.nextFnParam(&it)) |decl_param| : (i += 1) { if (i >= param_len) break;