authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-02-23 13:00:14+00:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-02-26 00:17:09+00:00
log8e074f1549779a5c19dccedfb379c53cd01914d3
treee0108af21e7f47329bc69b9d730fb400a5566fd4
parent84da520c44e9d944fec4f8f54655b1942acb36c7
signaturelock-open Commit is signed but in an unrecognized format.

std: remove dependencies on legacy coercion


2 files changed, 20 insertions(+), 20 deletions(-)

lib/std/compress/lzma/decode.zig+17-17
......@@ -112,17 +112,17 @@ pub const DecoderState = struct {
112112 .lzma_props = lzma_props,
113113 .unpacked_size = unpacked_size,
114114 .literal_probs = try Vec2D(u16).init(allocator, 0x400, .{ @as(usize, 1) << (lzma_props.lc + lzma_props.lp), 0x300 }),
115 .pos_slot_decoder = .{.{}} ** 4,
115 .pos_slot_decoder = @splat(.{}),
116116 .align_decoder = .{},
117 .pos_decoders = .{0x400} ** 115,
118 .is_match = .{0x400} ** 192,
119 .is_rep = .{0x400} ** 12,
120 .is_rep_g0 = .{0x400} ** 12,
121 .is_rep_g1 = .{0x400} ** 12,
122 .is_rep_g2 = .{0x400} ** 12,
123 .is_rep_0long = .{0x400} ** 192,
117 .pos_decoders = @splat(0x400),
118 .is_match = @splat(0x400),
119 .is_rep = @splat(0x400),
120 .is_rep_g0 = @splat(0x400),
121 .is_rep_g1 = @splat(0x400),
122 .is_rep_g2 = @splat(0x400),
123 .is_rep_0long = @splat(0x400),
124124 .state = 0,
125 .rep = .{0} ** 4,
125 .rep = @splat(0),
126126 .len_decoder = .{},
127127 .rep_len_decoder = .{},
128128 };
......@@ -145,15 +145,15 @@ pub const DecoderState = struct {
145145 self.lzma_props = new_props;
146146 for (&self.pos_slot_decoder) |*t| t.reset();
147147 self.align_decoder.reset();
148 self.pos_decoders = .{0x400} ** 115;
149 self.is_match = .{0x400} ** 192;
150 self.is_rep = .{0x400} ** 12;
151 self.is_rep_g0 = .{0x400} ** 12;
152 self.is_rep_g1 = .{0x400} ** 12;
153 self.is_rep_g2 = .{0x400} ** 12;
154 self.is_rep_0long = .{0x400} ** 192;
148 self.pos_decoders = @splat(0x400);
149 self.is_match = @splat(0x400);
150 self.is_rep = @splat(0x400);
151 self.is_rep_g0 = @splat(0x400);
152 self.is_rep_g1 = @splat(0x400);
153 self.is_rep_g2 = @splat(0x400);
154 self.is_rep_0long = @splat(0x400);
155155 self.state = 0;
156 self.rep = .{0} ** 4;
156 self.rep = @splat(0);
157157 self.len_decoder.reset();
158158 self.rep_len_decoder.reset();
159159 }
lib/std/compress/lzma/decode/rangecoder.zig+3-3
......@@ -120,7 +120,7 @@ pub const RangeDecoder = struct {
120120
121121pub fn BitTree(comptime num_bits: usize) type {
122122 return struct {
123 probs: [1 << num_bits]u16 = .{0x400} ** (1 << num_bits),
123 probs: [1 << num_bits]u16 = @splat(0x400),
124124
125125 const Self = @This();
126126
......@@ -151,8 +151,8 @@ pub fn BitTree(comptime num_bits: usize) type {
151151pub const LenDecoder = struct {
152152 choice: u16 = 0x400,
153153 choice2: u16 = 0x400,
154 low_coder: [16]BitTree(3) = .{.{}} ** 16,
155 mid_coder: [16]BitTree(3) = .{.{}} ** 16,
154 low_coder: [16]BitTree(3) = @splat(.{}),
155 mid_coder: [16]BitTree(3) = @splat(.{}),
156156 high_coder: BitTree(8) = .{},
157157
158158 pub fn decode(