Merge branch 'main' into refactor-var-to-const

This commit is contained in:
lording 2023-06-22 09:48:10 +00:00
commit 3e502fe69b
5 changed files with 10 additions and 9 deletions

View file

@ -45,7 +45,7 @@ Verify the installation and build number of `zig` like so:
``` ```
$ zig version $ zig version
0.11.0-dev.3295+xxxxxxxxx 0.11.0-dev.3747+xxxxxxxxx
``` ```
Clone this repository with Git: 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 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-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-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() * *2023-04-12* zig 0.11.0-dev.2560 - changes in `std.Build` - remove run() and install()

View file

@ -57,8 +57,8 @@ pub fn main() void {
\\</p> \\</p>
\\ \\
, .{ , .{
@enumToInt(Color.red), @intFromEnum(Color.red),
@enumToInt(Color.green), @intFromEnum(Color.green),
@enumToInt(???), // Oops! We're missing something! @intFromEnum(???), // Oops! We're missing something!
}); });
} }

View file

@ -45,7 +45,7 @@ fn runningAverage(arr: []const f64, avg: []f64) void {
for (0.., arr) |index, val| { for (0.., arr) |index, val| {
sum += val; sum += val;
avg[index] = sum / @intToFloat(f64, index + 1); avg[index] = sum / @floatFromInt(f64, index + 1);
} }
} }

View file

@ -7,6 +7,6 @@
--- ---
> \\ <span style="color: #{x:0>6}">Blue</span> > \\ <span style="color: #{x:0>6}">Blue</span>
62c62 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!

View file

@ -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: // When changing this version, be sure to also update README.md in two places:
// 1) Getting Started // 1) Getting Started
// 2) Version Changes // 2) Version Changes
const needed_version_str = "0.11.0-dev.3295"; const needed_version_str = "0.11.0-dev.3747";
fn isCompatible() bool { fn isCompatible() bool {
if (!@hasDecl(builtin, "zig_version") or !@hasDecl(std, "SemanticVersion")) { if (!@hasDecl(builtin, "zig_version") or !@hasDecl(std, "SemanticVersion")) {