From 12466d70839cd1b59d4ac557f92e35aaa3ca3fb5 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 22 Sep 2023 23:24:03 -0400 Subject: [PATCH] Fix build after recasting --- Quantum/Decompressor.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Quantum/Decompressor.cs b/Quantum/Decompressor.cs index 946df56..47f5c39 100644 --- a/Quantum/Decompressor.cs +++ b/Quantum/Decompressor.cs @@ -165,9 +165,9 @@ namespace SabreTools.Compression.Quantum /// private void GetCode(int prevFrequency, int currentFrequency, int totalFrequency) { - uint range = (CS_H - CS_L) + 1; - CS_H = CS_L + (uint)((prevFrequency * range) / totalFrequency) - 1; - CS_L = CS_L + (uint)((currentFrequency * range) / totalFrequency); + uint range = (ushort)((CS_H - CS_L) + 1); + CS_H = (ushort)(CS_L + (prevFrequency * range) / totalFrequency - 1); + CS_L = (ushort)(CS_L + (currentFrequency * range) / totalFrequency); while (true) { @@ -187,8 +187,8 @@ namespace SabreTools.Compression.Quantum } CS_L <<= 1; - CS_H = (CS_H << 1) | 1; - CS_C = (CS_C << 1) | _bitStream.ReadBit() ?? 0; + CS_H = (ushort)((CS_H << 1) | 1); + CS_C = (ushort)((CS_C << 1) | _bitStream.ReadBit() ?? 0); } }