| author | |
| committer | |
| log | 6395cf8d6b2cf585214a284039c16d6dc5ef5de3 |
| tree | 2b961279c2eb92f0ea23a5daa15773b96b59e42d |
| parent | 7417f2e4b3a9c21249bac38688ef453c6b86acfa |
| signature |
2 files changed, 2 insertions(+), 2 deletions(-)
doc/langref.html.in+1-1| ... | @@ -5313,7 +5313,7 @@ comptime { | ... | @@ -5313,7 +5313,7 @@ comptime { |
| 5313 | {#header_close#} | 5313 | {#header_close#} |
| 5314 | 5314 | ||
| 5315 | {#header_open|@bswap#} | 5315 | {#header_open|@bswap#} |
| 5316 | <pre>{#syntax#}@swap(comptime T: type, value: T) T{#endsyntax#}</pre> | 5316 | <pre>{#syntax#}@bswap(comptime T: type, value: T) T{#endsyntax#}</pre> |
| 5317 | <p>{#syntax#}T{#endsyntax#} must be an integer type with bit count evenly divisible by 8.</p> | 5317 | <p>{#syntax#}T{#endsyntax#} must be an integer type with bit count evenly divisible by 8.</p> |
| 5318 | <p> | 5318 | <p> |
| 5319 | Swaps the byte order of the integer. This converts a big endian integer to a little endian integer, | 5319 | Swaps the byte order of the integer. This converts a big endian integer to a little endian integer, |
std/io.zig+1-1| ... | @@ -186,7 +186,7 @@ pub fn InStream(comptime ReadError: type) type { | ... | @@ -186,7 +186,7 @@ pub fn InStream(comptime ReadError: type) type { |
| 186 | pub fn readVarInt(self: *Self, comptime T: type, endian: builtin.Endian, size: usize) !T { | 186 | pub fn readVarInt(self: *Self, comptime T: type, endian: builtin.Endian, size: usize) !T { |
| 187 | assert(size <= @sizeOf(T)); | 187 | assert(size <= @sizeOf(T)); |
| 188 | var bytes: [@sizeOf(T)]u8 = undefined; | 188 | var bytes: [@sizeOf(T)]u8 = undefined; |
| 189 | try self.readNoEof(bytes[0..]); | 189 | try self.readNoEof(bytes[0..size]); |
| 190 | return mem.readIntSlice(T, bytes, endian); | 190 | return mem.readIntSlice(T, bytes, endian); |
| 191 | } | 191 | } |
| 192 | 192 |