Fixed the call to mem.readInt in endian.swap

master
Jimmi Holst Christensen 2018-01-07 00:24:35 +01:00
parent 6f85c860c6
commit e91136d61f
1 changed files with 1 additions and 1 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);
}