diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-01-06 19:45:08 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-06 19:45:08 -0500 |
| commit | a9d2a7f00296ecda62d10fcecae52e1d9a7fc979 (patch) | |
| tree | 9a7be41e0753a19b8662f8a1ff1321fde34f2120 /std | |
| parent | dde7cc52d2f4780587b37604889c4568b8d79c62 (diff) | |
| parent | e91136d61f732dad5fe1e65a2c9a05a30fe6541d (diff) | |
| download | zig-a9d2a7f00296ecda62d10fcecae52e1d9a7fc979.tar.gz zig-a9d2a7f00296ecda62d10fcecae52e1d9a7fc979.zip | |
Merge pull request #674 from Hejsil/readInt-calling-fix
Fixed calls to mem.readInt
Diffstat (limited to 'std')
| -rw-r--r-- | std/endian.zig | 2 | ||||
| -rw-r--r-- | std/rand.zig | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/std/endian.zig b/std/endian.zig index 9f2d2c8dcd..6f5bfff385 100644 --- a/std/endian.zig +++ b/std/endian.zig @@ -16,5 +16,5 @@ pub fn swapIf(endian: builtin.Endian, comptime T: type, x: T) -> T { pub fn swap(comptime T: type, x: T) -> T { var buf: [@sizeOf(T)]u8 = undefined; mem.writeInt(buf[0..], x, false); - return mem.readInt(buf, T, true); + return mem.readInt(buf, T, builtin.Endian.Big); } diff --git a/std/rand.zig b/std/rand.zig index f35229ea3c..037cf68cd4 100644 --- a/std/rand.zig +++ b/std/rand.zig @@ -43,7 +43,7 @@ pub const Rand = struct { } else { var result: [@sizeOf(T)]u8 = undefined; r.fillBytes(result[0..]); - return mem.readInt(result, T, false); + return mem.readInt(result, T, builtin.Endian.Little); } } |
