comparison dwt/internal/image/PngLzBlockReader.d @ 7:e831403a80a9

Add 'cast' to casts
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 14:30:35 +0200
parents b903c16b6f48
children 5123b17c98ef
comparison
equal deleted inserted replaced
6:b903c16b6f48 7:e831403a80a9
64 window = new byte[windowSize]; 64 window = new byte[windowSize];
65 } 65 }
66 66
67 void readNextBlockHeader() { 67 void readNextBlockHeader() {
68 isLastBlock = stream.getNextIdatBit() !is 0; 68 isLastBlock = stream.getNextIdatBit() !is 0;
69 compressionType = (byte)(stream.getNextIdatBits(2) & 0xFF); 69 compressionType = cast(byte)(stream.getNextIdatBits(2) & 0xFF);
70 if (compressionType > 2) stream.error(); 70 if (compressionType > 2) stream.error();
71 71
72 if (compressionType is UNCOMPRESSED) { 72 if (compressionType is UNCOMPRESSED) {
73 byte b1 = stream.getNextIdatByte(); 73 byte b1 = stream.getNextIdatByte();
74 byte b2 = stream.getNextIdatByte(); 74 byte b2 = stream.getNextIdatByte();
134 return value; 134 return value;
135 } 135 }
136 136
137 int value = huffmanTables.getNextLiteralValue(stream); 137 int value = huffmanTables.getNextLiteralValue(stream);
138 if (value < END_OF_COMPRESSED_BLOCK) { 138 if (value < END_OF_COMPRESSED_BLOCK) {
139 window[windowIndex] = (byte) (value & 0xFF); 139 window[windowIndex] = cast(byte) (value & 0xFF);
140 windowIndex++; 140 windowIndex++;
141 if (windowIndex >= window.length) windowIndex = 0; 141 if (windowIndex >= window.length) windowIndex = 0;
142 return (byte) (value & 0xFF); 142 return cast(byte) (value & 0xFF);
143 } else if (value is END_OF_COMPRESSED_BLOCK) { 143 } else if (value is END_OF_COMPRESSED_BLOCK) {
144 readNextBlockHeader(); 144 readNextBlockHeader();
145 return getNextByte(); 145 return getNextByte();
146 } else if (value <= LAST_LENGTH_CODE) { 146 } else if (value <= LAST_LENGTH_CODE) {
147 int extraBits = extraLengthBits[value - FIRST_LENGTH_CODE]; 147 int extraBits = extraLengthBits[value - FIRST_LENGTH_CODE];