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

Fixed calls to mem.readInt
This commit is contained in:
Andrew Kelley 2018-01-06 19:45:08 -05:00 committed by GitHub
commit a9d2a7f002
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}

View File

@ -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);
}
}