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 {...@@ -112,17 +112,17 @@ pub const DecoderState = struct {
112 .lzma_props = lzma_props,112 .lzma_props = lzma_props,
113 .unpacked_size = unpacked_size,113 .unpacked_size = unpacked_size,
114 .literal_probs = try Vec2D(u16).init(allocator, 0x400, .{ @as(usize, 1) << (lzma_props.lc + lzma_props.lp), 0x300 }),114 .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(.{}),
116 .align_decoder = .{},116 .align_decoder = .{},
117 .pos_decoders = .{0x400} ** 115,117 .pos_decoders = @splat(0x400),
118 .is_match = .{0x400} ** 192,118 .is_match = @splat(0x400),
119 .is_rep = .{0x400} ** 12,119 .is_rep = @splat(0x400),
120 .is_rep_g0 = .{0x400} ** 12,120 .is_rep_g0 = @splat(0x400),
121 .is_rep_g1 = .{0x400} ** 12,121 .is_rep_g1 = @splat(0x400),
122 .is_rep_g2 = .{0x400} ** 12,122 .is_rep_g2 = @splat(0x400),
123 .is_rep_0long = .{0x400} ** 192,123 .is_rep_0long = @splat(0x400),
124 .state = 0,124 .state = 0,
125 .rep = .{0} ** 4,125 .rep = @splat(0),
126 .len_decoder = .{},126 .len_decoder = .{},
127 .rep_len_decoder = .{},127 .rep_len_decoder = .{},
128 };128 };
...@@ -145,15 +145,15 @@ pub const DecoderState = struct {...@@ -145,15 +145,15 @@ pub const DecoderState = struct {
145 self.lzma_props = new_props;145 self.lzma_props = new_props;
146 for (&self.pos_slot_decoder) |*t| t.reset();146 for (&self.pos_slot_decoder) |*t| t.reset();
147 self.align_decoder.reset();147 self.align_decoder.reset();
148 self.pos_decoders = .{0x400} ** 115;148 self.pos_decoders = @splat(0x400);
149 self.is_match = .{0x400} ** 192;149 self.is_match = @splat(0x400);
150 self.is_rep = .{0x400} ** 12;150 self.is_rep = @splat(0x400);
151 self.is_rep_g0 = .{0x400} ** 12;151 self.is_rep_g0 = @splat(0x400);
152 self.is_rep_g1 = .{0x400} ** 12;152 self.is_rep_g1 = @splat(0x400);
153 self.is_rep_g2 = .{0x400} ** 12;153 self.is_rep_g2 = @splat(0x400);
154 self.is_rep_0long = .{0x400} ** 192;154 self.is_rep_0long = @splat(0x400);
155 self.state = 0;155 self.state = 0;
156 self.rep = .{0} ** 4;156 self.rep = @splat(0);
157 self.len_decoder.reset();157 self.len_decoder.reset();
158 self.rep_len_decoder.reset();158 self.rep_len_decoder.reset();
159 }159 }
lib/std/compress/lzma/decode/rangecoder.zig+3-3
...@@ -120,7 +120,7 @@ pub const RangeDecoder = struct {...@@ -120,7 +120,7 @@ pub const RangeDecoder = struct {
120120
121pub fn BitTree(comptime num_bits: usize) type {121pub fn BitTree(comptime num_bits: usize) type {
122 return struct {122 return struct {
123 probs: [1 << num_bits]u16 = .{0x400} ** (1 << num_bits),123 probs: [1 << num_bits]u16 = @splat(0x400),
124124
125 const Self = @This();125 const Self = @This();
126126
...@@ -151,8 +151,8 @@ pub fn BitTree(comptime num_bits: usize) type {...@@ -151,8 +151,8 @@ pub fn BitTree(comptime num_bits: usize) type {
151pub const LenDecoder = struct {151pub const LenDecoder = struct {
152 choice: u16 = 0x400,152 choice: u16 = 0x400,
153 choice2: u16 = 0x400,153 choice2: u16 = 0x400,
154 low_coder: [16]BitTree(3) = .{.{}} ** 16,154 low_coder: [16]BitTree(3) = @splat(.{}),
155 mid_coder: [16]BitTree(3) = .{.{}} ** 16,155 mid_coder: [16]BitTree(3) = @splat(.{}),
156 high_coder: BitTree(8) = .{},156 high_coder: BitTree(8) = .{},
157157
158 pub fn decode(158 pub fn decode(