aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/scicore/decompressor.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2009-05-15 13:52:22 +0000
committerFilippos Karapetis2009-05-15 13:52:22 +0000
commitce29fec17a9316b5fee0349d013a4d7863af9c03 (patch)
tree09fc239597e552901c995d951aaff13ef81a36bc /engines/sci/scicore/decompressor.cpp
parent3771f9aef2f80b3cfe0d3d284c4361267e04ba1b (diff)
downloadscummvm-rg350-ce29fec17a9316b5fee0349d013a4d7863af9c03.tar.gz
scummvm-rg350-ce29fec17a9316b5fee0349d013a4d7863af9c03.tar.bz2
scummvm-rg350-ce29fec17a9316b5fee0349d013a4d7863af9c03.zip
Removed unused defines and merged several different compression errors
svn-id: r40607
Diffstat (limited to 'engines/sci/scicore/decompressor.cpp')
-rw-r--r--engines/sci/scicore/decompressor.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/sci/scicore/decompressor.cpp b/engines/sci/scicore/decompressor.cpp
index 7245d8a622..91738aa1d8 100644
--- a/engines/sci/scicore/decompressor.cpp
+++ b/engines/sci/scicore/decompressor.cpp
@@ -199,7 +199,7 @@ int DecompressorLZW::unpackLZW(Common::ReadStream *src, byte *dest, uint32 nPack
if (token > 0xff) {
if (token >= _curtoken) {
warning("unpackLZW: Bad token %x", token);
- return SCI_ERROR_DECOMPRESSION_INSANE;
+ return SCI_ERROR_DECOMPRESSION_ERROR;
}
tokenlastlength = tokenlengthlist[token] + 1;
if (_dwWrote + tokenlastlength > _szUnpacked) {
@@ -231,7 +231,7 @@ int DecompressorLZW::unpackLZW(Common::ReadStream *src, byte *dest, uint32 nPack
}
}
- return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_INSANE;
+ return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR;
}
int DecompressorLZW::unpackLZW1(Common::ReadStream *src, byte *dest, uint32 nPacked,
@@ -310,7 +310,7 @@ int DecompressorLZW::unpackLZW1(Common::ReadStream *src, byte *dest, uint32 nPac
break;
}
}
- return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_INSANE;
+ return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR;
}
#define PAL_SIZE 1284
@@ -853,12 +853,12 @@ int DecompressorDCL::unpackDCL(byte* dest) {
if (val_length + _dwWrote > _szUnpacked) {
warning("DCL-INFLATE Error: Write out of bounds while copying %d bytes", val_length);
- return SCI_ERROR_DECOMPRESSION_OVERFLOW;
+ return SCI_ERROR_DECOMPRESSION_ERROR;
}
if (_dwWrote < val_distance) {
warning("DCL-INFLATE Error: Attempt to copy from before beginning of input stream");
- return SCI_ERROR_DECOMPRESSION_INSANE;
+ return SCI_ERROR_DECOMPRESSION_ERROR;
}
while (val_length) {
@@ -885,7 +885,7 @@ int DecompressorDCL::unpackDCL(byte* dest) {
}
}
- return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_INSANE;
+ return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR;
}
#ifdef ENABLE_SCI32
@@ -910,21 +910,21 @@ int DecompressorLZS::unpackLZS() {
break;
if (!(clen = getCompLen())) {
warning("lzsDecomp: length mismatch");
- return SCI_ERROR_DECOMPRESSION_INSANE;
+ return SCI_ERROR_DECOMPRESSION_ERROR;
}
copyComp(offs, clen);
} else { // Eleven bit offset follows
offs = getBitsMSB(11);
if (!(clen = getCompLen())) {
warning("lzsDecomp: length mismatch");
- return SCI_ERROR_DECOMPRESSION_INSANE;
+ return SCI_ERROR_DECOMPRESSION_ERROR;
}
copyComp(offs, clen);
}
} else // Literal byte follows
putByte(getByteMSB());
} // end of while ()
- return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_INSANE;
+ return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR;
}
uint16 DecompressorLZS::getCompLen() {