From 5fa13625a1ca0ea1a3a1c5bb86d0880dcfac349f Mon Sep 17 00:00:00 2001 From: Dylan Conway <35280289+dylan-conway@users.noreply.github.com> Date: Wed, 21 Jun 2023 23:38:18 -0700 Subject: upgrade zig to `v0.11.0-dev.3737+9eb008717` (#3374) * progress * finish `@memset/@memcpy` update * Update build.zig * change `@enumToInt` to `@intFromEnum` and friends * update zig versions * it was 1 * add link to issue * add `compileError` reminder * fix merge * format * upgrade to llvm 16 * Revert "upgrade to llvm 16" This reverts commit cc930ceb1c5b4db9614a7638596948f704544ab8. --------- Co-authored-by: Jarred Sumner Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> --- src/deps/diffz/DiffMatchPatch.zig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/deps/diffz/DiffMatchPatch.zig') diff --git a/src/deps/diffz/DiffMatchPatch.zig b/src/deps/diffz/DiffMatchPatch.zig index 7e545f364..a5cc02af4 100644 --- a/src/deps/diffz/DiffMatchPatch.zig +++ b/src/deps/diffz/DiffMatchPatch.zig @@ -178,7 +178,7 @@ fn diffInternal( } fn diffCommonPrefix(before: []const u8, after: []const u8) usize { - const n = std.math.min(before.len, after.len); + const n = @min(before.len, after.len); var i: usize = 0; while (i < n) : (i += 1) { @@ -191,7 +191,7 @@ fn diffCommonPrefix(before: []const u8, after: []const u8) usize { } fn diffCommonSuffix(before: []const u8, after: []const u8) usize { - const n = std.math.min(before.len, after.len); + const n = @min(before.len, after.len); var i: usize = 1; while (i <= n) : (i += 1) { @@ -996,8 +996,8 @@ fn diffCleanupSemantic(allocator: std.mem.Allocator, diffs: *DiffList) DiffError // Eliminate an equality that is smaller or equal to the edits on both // sides of it. if (last_equality != null and - (last_equality.?.len <= std.math.max(length_insertions1, length_deletions1)) and - (last_equality.?.len <= std.math.max(length_insertions2, length_deletions2))) + (last_equality.?.len <= @max(length_insertions1, length_deletions1)) and + (last_equality.?.len <= @max(length_insertions2, length_deletions2))) { // Duplicate record. try diffs.insert( @@ -1046,8 +1046,8 @@ fn diffCleanupSemantic(allocator: std.mem.Allocator, diffs: *DiffList) DiffError var overlap_length1: usize = diffCommonOverlap(deletion, insertion); var overlap_length2: usize = diffCommonOverlap(insertion, deletion); if (overlap_length1 >= overlap_length2) { - if (@intToFloat(f32, overlap_length1) >= @intToFloat(f32, deletion.len) / 2.0 or - @intToFloat(f32, overlap_length1) >= @intToFloat(f32, insertion.len) / 2.0) + if (@floatFromInt(f32, overlap_length1) >= @floatFromInt(f32, deletion.len) / 2.0 or + @floatFromInt(f32, overlap_length1) >= @floatFromInt(f32, insertion.len) / 2.0) { // Overlap found. // Insert an equality and trim the surrounding edits. @@ -1063,8 +1063,8 @@ fn diffCleanupSemantic(allocator: std.mem.Allocator, diffs: *DiffList) DiffError pointer += 1; } } else { - if (@intToFloat(f32, overlap_length2) >= @intToFloat(f32, deletion.len) / 2.0 or - @intToFloat(f32, overlap_length2) >= @intToFloat(f32, insertion.len) / 2.0) + if (@floatFromInt(f32, overlap_length2) >= @floatFromInt(f32, deletion.len) / 2.0 or + @floatFromInt(f32, overlap_length2) >= @floatFromInt(f32, insertion.len) / 2.0) { // Reverse overlap found. // Insert an equality and swap and trim the surrounding edits. -- cgit v1.2.3