authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-01-06 19:45:08-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2018-01-06 19:45:08-05:00
loga9d2a7f00296ecda62d10fcecae52e1d9a7fc979
tree9a7be41e0753a19b8662f8a1ff1321fde34f2120
parentdde7cc52d2f4780587b37604889c4568b8d79c62
parente91136d61f732dad5fe1e65a2c9a05a30fe6541d
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #674 from Hejsil/readInt-calling-fix

Fixed calls to mem.readInt

2 files changed, 2 insertions(+), 2 deletions(-)

std/endian.zig+1-1
...@@ -16,5 +16,5 @@ pub fn swapIf(endian: builtin.Endian, comptime T: type, x: T) -> T {...@@ -16,5 +16,5 @@ pub fn swapIf(endian: builtin.Endian, comptime T: type, x: T) -> T {
16pub fn swap(comptime T: type, x: T) -> T {16pub fn swap(comptime T: type, x: T) -> T {
17 var buf: [@sizeOf(T)]u8 = undefined;17 var buf: [@sizeOf(T)]u8 = undefined;
18 mem.writeInt(buf[0..], x, false);18 mem.writeInt(buf[0..], x, false);
19 return mem.readInt(buf, T, true);19 return mem.readInt(buf, T, builtin.Endian.Big);
20}20}
std/rand.zig+1-1
...@@ -43,7 +43,7 @@ pub const Rand = struct {...@@ -43,7 +43,7 @@ pub const Rand = struct {
43 } else {43 } else {
44 var result: [@sizeOf(T)]u8 = undefined;44 var result: [@sizeOf(T)]u8 = undefined;
45 r.fillBytes(result[0..]);45 r.fillBytes(result[0..]);
46 return mem.readInt(result, T, false);46 return mem.readInt(result, T, builtin.Endian.Little);
47 }47 }
48 }48 }
4949