From 39952817b30f6579653d38cbdafa0ad0b474b259 Mon Sep 17 00:00:00 2001
From: lording
Date: Thu, 22 Jun 2023 08:23:01 +0000
Subject: [PATCH 1/3] Fix broken builtin name in exercise 36
---
exercises/036_enums2.zig | 6 +++---
patches/patches/036_enums2.patch | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/exercises/036_enums2.zig b/exercises/036_enums2.zig
index 820a71e..1477b20 100644
--- a/exercises/036_enums2.zig
+++ b/exercises/036_enums2.zig
@@ -57,8 +57,8 @@ pub fn main() void {
\\
\\
, .{
- @enumToInt(Color.red),
- @enumToInt(Color.green),
- @enumToInt(???), // Oops! We're missing something!
+ @intFromEnum(Color.red),
+ @intFromEnum(Color.green),
+ @intFromEnum(???), // Oops! We're missing something!
});
}
diff --git a/patches/patches/036_enums2.patch b/patches/patches/036_enums2.patch
index c20905a..367b780 100644
--- a/patches/patches/036_enums2.patch
+++ b/patches/patches/036_enums2.patch
@@ -7,6 +7,6 @@
---
> \\ Blue
62c62
-< @enumToInt(???), // Oops! We're missing something!
+< @intFromEnum(???), // Oops! We're missing something!
---
-> @enumToInt(Color.blue), // Oops! We're missing something!
+> @intFromEnum(Color.blue), // Oops! We're missing something!
From ccb580f95db5024962ff91ef522143646a3d1835 Mon Sep 17 00:00:00 2001
From: lording
Date: Thu, 22 Jun 2023 08:23:22 +0000
Subject: [PATCH 2/3] Fix broken builtin name in exercise 96
---
exercises/096_memory_allocation.zig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/exercises/096_memory_allocation.zig b/exercises/096_memory_allocation.zig
index 8e348be..7538ba4 100644
--- a/exercises/096_memory_allocation.zig
+++ b/exercises/096_memory_allocation.zig
@@ -45,7 +45,7 @@ fn runningAverage(arr: []const f64, avg: []f64) void {
for (0.., arr) |index, val| {
sum += val;
- avg[index] = sum / @intToFloat(f64, index + 1);
+ avg[index] = sum / @floatFromInt(f64, index + 1);
}
}
From bd4a48c3c9a41773cabd66b4fb985e699fb5527f Mon Sep 17 00:00:00 2001
From: Chris Boesch
Date: Thu, 22 Jun 2023 11:31:46 +0200
Subject: [PATCH 3/3] Changed to zig developer version 3747.
---
README.md | 5 +++--
src/compat.zig | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 3843647..fce0d78 100644
--- a/README.md
+++ b/README.md
@@ -45,7 +45,7 @@ Verify the installation and build number of `zig` like so:
```
$ zig version
-0.11.0-dev.3295+xxxxxxxxx
+0.11.0-dev.3747+xxxxxxxxx
```
Clone this repository with Git:
@@ -89,7 +89,8 @@ that if you update one, you may need to also update the other.
### Version Changes
-Version-0.11.0-dev.3295+7cb2e653a
+Version-0.11.0-dev.3747+7b5bd3a93
+* *2023-05-25* zig 0.11.0-dev.3747 - `@enumToInt` is now `@intFromEnum` and `@intToFloat` is now `@floatFromInt`
* *2023-05-25* zig 0.11.0-dev.3295 - `std.debug.TTY` is now `std.io.tty`
* *2023-04-30* zig 0.11.0-dev.2704 - use of the new `std.Build.ExecutableOptions.link_libc` field
* *2023-04-12* zig 0.11.0-dev.2560 - changes in `std.Build` - remove run() and install()
diff --git a/src/compat.zig b/src/compat.zig
index a014b24..951899a 100644
--- a/src/compat.zig
+++ b/src/compat.zig
@@ -15,7 +15,7 @@ const print = if (@hasDecl(debug, "print")) debug.print else debug.warn;
// When changing this version, be sure to also update README.md in two places:
// 1) Getting Started
// 2) Version Changes
-const needed_version_str = "0.11.0-dev.3295";
+const needed_version_str = "0.11.0-dev.3747";
fn isCompatible() bool {
if (!@hasDecl(builtin, "zig_version") or !@hasDecl(std, "SemanticVersion")) {