Merge branch 'master' of github.com:zig-lang/zig
This commit is contained in:
commit
ad438cfd40
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user