Merge branch 'master' of github.com:zig-lang/zig

This commit is contained in:
Andrea Orru 2018-01-06 23:13:51 -05:00
commit ad438cfd40
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);
}
}