diff options
| author | Veikka Tuominen <git@vexu.eu> | 2020-09-05 13:58:02 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-05 13:58:02 +0300 |
| commit | 41bbadbb9a27107da539e27e175f5bdb52656bd5 (patch) | |
| tree | 48a89b9ef19eedded7d5b8f3ab9e5e40efacf528 /lib/std/io/serialization.zig | |
| parent | cff14dc2c67d9a35ae2c3e07bd6d2c5594d8a0a1 (diff) | |
| parent | 09c861b829480be525a787e54117c108705256e6 (diff) | |
| download | zig-41bbadbb9a27107da539e27e175f5bdb52656bd5.tar.gz zig-41bbadbb9a27107da539e27e175f5bdb52656bd5.zip | |
Merge pull request #6246 from Vexu/field
Remove deprecated fields on `type`
Diffstat (limited to 'lib/std/io/serialization.zig')
| -rw-r--r-- | lib/std/io/serialization.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/io/serialization.zig b/lib/std/io/serialization.zig index 4f8c149b47..925c929cee 100644 --- a/lib/std/io/serialization.zig +++ b/lib/std/io/serialization.zig @@ -60,7 +60,7 @@ pub fn Deserializer(comptime endian: builtin.Endian, comptime packing: Packing, const U = std.meta.Int(false, t_bit_count); const Log2U = math.Log2Int(U); - const int_size = (U.bit_count + 7) / 8; + const int_size = (t_bit_count + 7) / 8; if (packing == .Bit) { const result = try self.in_stream.readBitsNoEof(U, t_bit_count); @@ -73,7 +73,7 @@ pub fn Deserializer(comptime endian: builtin.Endian, comptime packing: Packing, if (int_size == 1) { if (t_bit_count == 8) return @bitCast(T, buffer[0]); - const PossiblySignedByte = std.meta.Int(T.is_signed, 8); + const PossiblySignedByte = std.meta.Int(@typeInfo(T).Int.is_signed, 8); return @truncate(T, @bitCast(PossiblySignedByte, buffer[0])); } @@ -247,7 +247,7 @@ pub fn Serializer(comptime endian: builtin.Endian, comptime packing: Packing, co const U = std.meta.Int(false, t_bit_count); const Log2U = math.Log2Int(U); - const int_size = (U.bit_count + 7) / 8; + const int_size = (t_bit_count + 7) / 8; const u_value = @bitCast(U, value); |
