diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-09-07 11:17:42 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-09-07 11:17:42 -0700 |
| commit | 52b8239a22aa37fe3914427cd4e2905231769e59 (patch) | |
| tree | cd60ca825c14b5befbcddf674bdb7d3feda81d23 /lib/std/io/reader.zig | |
| parent | 338f155a02b72117ff710f72c8578e7d2f8eb296 (diff) | |
| parent | 533bfc68bf8b4ad7ffbe5814a622f200dc345b69 (diff) | |
| download | zig-52b8239a22aa37fe3914427cd4e2905231769e59.tar.gz zig-52b8239a22aa37fe3914427cd4e2905231769e59.zip | |
Merge remote-tracking branch 'origin/master' into llvm11
Diffstat (limited to 'lib/std/io/reader.zig')
| -rw-r--r-- | lib/std/io/reader.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/io/reader.zig b/lib/std/io/reader.zig index 2ab799046a..4090f5a476 100644 --- a/lib/std/io/reader.zig +++ b/lib/std/io/reader.zig @@ -198,28 +198,28 @@ pub fn Reader( /// Reads a native-endian integer pub fn readIntNative(self: Self, comptime T: type) !T { - const bytes = try self.readBytesNoEof((T.bit_count + 7) / 8); + const bytes = try self.readBytesNoEof((@typeInfo(T).Int.bits + 7) / 8); return mem.readIntNative(T, &bytes); } /// Reads a foreign-endian integer pub fn readIntForeign(self: Self, comptime T: type) !T { - const bytes = try self.readBytesNoEof((T.bit_count + 7) / 8); + const bytes = try self.readBytesNoEof((@typeInfo(T).Int.bits + 7) / 8); return mem.readIntForeign(T, &bytes); } pub fn readIntLittle(self: Self, comptime T: type) !T { - const bytes = try self.readBytesNoEof((T.bit_count + 7) / 8); + const bytes = try self.readBytesNoEof((@typeInfo(T).Int.bits + 7) / 8); return mem.readIntLittle(T, &bytes); } pub fn readIntBig(self: Self, comptime T: type) !T { - const bytes = try self.readBytesNoEof((T.bit_count + 7) / 8); + const bytes = try self.readBytesNoEof((@typeInfo(T).Int.bits + 7) / 8); return mem.readIntBig(T, &bytes); } pub fn readInt(self: Self, comptime T: type, endian: builtin.Endian) !T { - const bytes = try self.readBytesNoEof((T.bit_count + 7) / 8); + const bytes = try self.readBytesNoEof((@typeInfo(T).Int.bits + 7) / 8); return mem.readInt(T, &bytes, endian); } |
