summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkleines Filmröllchen <malu.bertsch@gmail.com>2021-08-16 21:59:53 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-17 00:16:00 +0200
commit442aa48a61e018d7d1d4aeefaa9c0f4fd53192eb (patch)
tree0e772d4837e3c5cb3307487cd575f7b6a972b28f
parentf3aa87c436e24fc535e8df8e596264a1183be2e2 (diff)
downloadserenity-442aa48a61e018d7d1d4aeefaa9c0f4fd53192eb.zip
LibAudio: Use size_t in loops
This is more idiomatic :^)
-rw-r--r--Userland/Libraries/LibAudio/FlacLoader.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibAudio/FlacLoader.cpp b/Userland/Libraries/LibAudio/FlacLoader.cpp
index 44f8671f01..1276c95a91 100644
--- a/Userland/Libraries/LibAudio/FlacLoader.cpp
+++ b/Userland/Libraries/LibAudio/FlacLoader.cpp
@@ -740,17 +740,17 @@ Vector<i32> FlacLoaderPlugin::decode_residual(Vector<i32>& decoded, FlacSubframe
{
u8 residual_mode = bit_input.read_bits_big_endian(2);
u8 partition_order = bit_input.read_bits_big_endian(4);
- u32 partitions = 1 << partition_order;
+ size_t partitions = 1 << partition_order;
if (residual_mode == FlacResidualMode::Rice4Bit) {
// decode a single Rice partition with four bits for the order k
- for (u32 i = 0; i < partitions; ++i) {
+ for (size_t i = 0; i < partitions; ++i) {
auto rice_partition = decode_rice_partition(4, partitions, i, subframe, bit_input);
decoded.extend(move(rice_partition));
}
} else if (residual_mode == FlacResidualMode::Rice5Bit) {
// five bits equivalent
- for (u32 i = 0; i < partitions; ++i) {
+ for (size_t i = 0; i < partitions; ++i) {
auto rice_partition = decode_rice_partition(5, partitions, i, subframe, bit_input);
decoded.extend(move(rice_partition));
}
@@ -782,11 +782,11 @@ ALWAYS_INLINE Vector<i32> FlacLoaderPlugin::decode_rice_partition(u8 partition_t
// escape code for unencoded binary partition
if (k == (1 << partition_type) - 1) {
u8 unencoded_bps = bit_input.read_bits_big_endian(5);
- for (u32 r = 0; r < residual_sample_count; ++r) {
+ for (size_t r = 0; r < residual_sample_count; ++r) {
rice_partition[r] = bit_input.read_bits_big_endian(unencoded_bps);
}
} else {
- for (u32 r = 0; r < residual_sample_count; ++r) {
+ for (size_t r = 0; r < residual_sample_count; ++r) {
rice_partition[r] = decode_unsigned_exp_golomb(k, bit_input);
}
}