aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorBenoitJGirard <BenoitJGirard@users.noreply.github.com>2019-02-17 14:38:55 -0500
committerGitHub <noreply@github.com>2019-02-17 14:38:55 -0500
commit6daa041932ae5ab03eed953dacf3ca506078390c (patch)
tree0f51f6c2ff84dde51b61bba6799e5c5abccf91b4 /example
parentf0ec308e26ff957c7fbb50ccc69d3d549c42c4da (diff)
parent8d2a902945ef97f28152c3d5a68bb974809c8539 (diff)
downloadzig-6daa041932ae5ab03eed953dacf3ca506078390c.tar.gz
zig-6daa041932ae5ab03eed953dacf3ca506078390c.zip
Merge pull request #2 from ziglang/master
Refreshing fork.
Diffstat (limited to 'example')
-rw-r--r--example/guess_number/main.zig2
-rw-r--r--example/hello_world/hello.zig2
2 files changed, 2 insertions, 2 deletions
diff --git a/example/guess_number/main.zig b/example/guess_number/main.zig
index 66264666bc..b4eb1c292a 100644
--- a/example/guess_number/main.zig
+++ b/example/guess_number/main.zig
@@ -15,7 +15,7 @@ pub fn main() !void {
std.debug.warn("unable to seed random number generator: {}", err);
return err;
};
- const seed = std.mem.readInt(seed_bytes, u64, builtin.Endian.Big);
+ const seed = std.mem.readIntNative(u64, &seed_bytes);
var prng = std.rand.DefaultPrng.init(seed);
const answer = prng.random.range(u8, 0, 100) + 1;
diff --git a/example/hello_world/hello.zig b/example/hello_world/hello.zig
index 8e65e06a96..cb7d5ef157 100644
--- a/example/hello_world/hello.zig
+++ b/example/hello_world/hello.zig
@@ -2,7 +2,7 @@ const std = @import("std");
pub fn main() !void {
// If this program is run without stdout attached, exit with an error.
- var stdout_file = try std.io.getStdOut();
+ const stdout_file = try std.io.getStdOut();
// If this program encounters pipe failure when printing to stdout, exit
// with an error.
try stdout_file.write("Hello, world!\n");