aboutsummaryrefslogtreecommitdiff
path: root/lib/std/io/reader.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2020-09-05 13:58:02 +0300
committerGitHub <noreply@github.com>2020-09-05 13:58:02 +0300
commit41bbadbb9a27107da539e27e175f5bdb52656bd5 (patch)
tree48a89b9ef19eedded7d5b8f3ab9e5e40efacf528 /lib/std/io/reader.zig
parentcff14dc2c67d9a35ae2c3e07bd6d2c5594d8a0a1 (diff)
parent09c861b829480be525a787e54117c108705256e6 (diff)
downloadzig-41bbadbb9a27107da539e27e175f5bdb52656bd5.tar.gz
zig-41bbadbb9a27107da539e27e175f5bdb52656bd5.zip
Merge pull request #6246 from Vexu/field
Remove deprecated fields on `type`
Diffstat (limited to 'lib/std/io/reader.zig')
-rw-r--r--lib/std/io/reader.zig10
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);
}