Rename std/bzip2 num_nodes variable
diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c
index 5d3504a..735217b 100644
--- a/release/c/wuffs-unsupported-snapshot.c
+++ b/release/c/wuffs-unsupported-snapshot.c
@@ -25800,7 +25800,7 @@
uint32_t a_which) {
uint32_t v_code_length = 0;
uint32_t v_symbol_index = 0;
- uint32_t v_num_nodes = 0;
+ uint32_t v_num_branch_nodes = 0;
uint32_t v_stack_height = 0;
uint32_t v_stack_values[21] = {0};
uint32_t v_node_index = 0;
@@ -25808,7 +25808,7 @@
self->private_data.f_huffman_trees[a_which][0][0] = 0;
self->private_data.f_huffman_trees[a_which][0][1] = 0;
- v_num_nodes = 1;
+ v_num_branch_nodes = 1;
v_stack_height = 1;
v_stack_values[0] = 0;
v_code_length = 1;
@@ -25833,17 +25833,17 @@
}
v_node_index = v_stack_values[(v_stack_height - 1)];
if (self->private_data.f_huffman_trees[a_which][v_node_index][0] == 0) {
- self->private_data.f_huffman_trees[a_which][v_node_index][0] = ((uint16_t)(v_num_nodes));
+ self->private_data.f_huffman_trees[a_which][v_node_index][0] = ((uint16_t)(v_num_branch_nodes));
} else {
- self->private_data.f_huffman_trees[a_which][v_node_index][1] = ((uint16_t)(v_num_nodes));
+ self->private_data.f_huffman_trees[a_which][v_node_index][1] = ((uint16_t)(v_num_branch_nodes));
}
- if (v_num_nodes >= 257) {
+ if (v_num_branch_nodes >= 257) {
return wuffs_base__make_status(wuffs_bzip2__error__bad_huffman_code_under_subscribed);
}
- v_stack_values[v_stack_height] = v_num_nodes;
- self->private_data.f_huffman_trees[a_which][v_num_nodes][0] = 0;
- self->private_data.f_huffman_trees[a_which][v_num_nodes][1] = 0;
- v_num_nodes += 1;
+ v_stack_values[v_stack_height] = v_num_branch_nodes;
+ self->private_data.f_huffman_trees[a_which][v_num_branch_nodes][0] = 0;
+ self->private_data.f_huffman_trees[a_which][v_num_branch_nodes][1] = 0;
+ v_num_branch_nodes += 1;
v_stack_height += 1;
}
label__2__break:;
diff --git a/std/bzip2/decode_bzip2.wuffs b/std/bzip2/decode_bzip2.wuffs
index 1e9f6c0..ee34906 100644
--- a/std/bzip2/decode_bzip2.wuffs
+++ b/std/bzip2/decode_bzip2.wuffs
@@ -589,18 +589,18 @@
// height (here, 3) then it would pop the stack. Otherwise it would push new
// nodes onto the stack until the stack height matched that code length.
pri func decoder.build_huffman_tree!(which: base.u32[..= 5]) base.status {
- var code_length : base.u32
- var symbol_index : base.u32
- var num_nodes : base.u32[..= 257]
- var stack_height : base.u32[..= 21]
- var stack_values : array[21] base.u32[..= 256]
- var node_index : base.u32[..= 256]
- var leaf_value : base.u16
+ var code_length : base.u32
+ var symbol_index : base.u32
+ var num_branch_nodes : base.u32[..= 257]
+ var stack_height : base.u32[..= 21]
+ var stack_values : array[21] base.u32[..= 256]
+ var node_index : base.u32[..= 256]
+ var leaf_value : base.u16
// Push a root node.
this.huffman_trees[args.which][0][0] = 0
this.huffman_trees[args.which][0][1] = 0
- num_nodes = 1
+ num_branch_nodes = 1
stack_height = 1
stack_values[0] = 0
@@ -634,17 +634,17 @@
node_index = stack_values[stack_height - 1]
if this.huffman_trees[args.which][node_index][0] == 0 {
- this.huffman_trees[args.which][node_index][0] = num_nodes as base.u16
+ this.huffman_trees[args.which][node_index][0] = num_branch_nodes as base.u16
} else {
- this.huffman_trees[args.which][node_index][1] = num_nodes as base.u16
+ this.huffman_trees[args.which][node_index][1] = num_branch_nodes as base.u16
}
- if num_nodes >= 257 {
+ if num_branch_nodes >= 257 {
return "#bad Huffman code (under-subscribed)"
}
- stack_values[stack_height] = num_nodes
- this.huffman_trees[args.which][num_nodes][0] = 0
- this.huffman_trees[args.which][num_nodes][1] = 0
- num_nodes += 1
+ stack_values[stack_height] = num_branch_nodes
+ this.huffman_trees[args.which][num_branch_nodes][0] = 0
+ this.huffman_trees[args.which][num_branch_nodes][1] = 0
+ num_branch_nodes += 1
stack_height += 1
} endwhile