 
     final class RangeDecoder {
 
-        private var range: Int
-        private var code: Int
+        private var range: UInt32
+        private var code: UInt32
         private(set) var isCorrupted: Bool
 
         var isFinishedOK: Bool {

            self.choice = Constants.probInitValue
            self.choice2 = Constants.probInitValue
            self.highCoder = BitTreeDecoder(numBits: 8)
            self.lowCoder = Array(repeating: BitTreeDecoder(numBits: 3), count: 1 << Constants.numPosBitsMax)
            self.midCoder = Array(repeating: BitTreeDecoder(numBits: 3), count: 1 << Constants.numPosBitsMax)
        }

        func decode(with rangeDecoder: inout RangeDecoder, posState: Int, pointerData: inout DataWithPointer) -> Int {

        var isRep0Long = Array(repeating: Constants.probInitValue,
                               count: Constants.numStates << Constants.numPosBitsMax)

        var posSlotDecoder: [BitTreeDecoder] = []
        for _ in 0..<Constants.numLenToPosStates {
            posSlotDecoder.append(BitTreeDecoder(numBits: 6))
        }
        var alignDecoder = BitTreeDecoder(numBits: Constants.numAlignBits)
        var posDecoders = Array(repeating: Constants.probInitValue, count: 1 + Constants.numFullDistances - Constants.endPosModelIndex)

