mirror of
https://github.com/ziglang/zig.git
synced 2026-01-06 13:33:21 +00:00
Merge pull request #674 from Hejsil/readInt-calling-fix
Fixed calls to mem.readInt
This commit is contained in:
commit
a9d2a7f002
@ -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…
x
Reference in New Issue
Block a user