@@ -226,7 +226,7 @@ CompressedInputStream::~CompressedInputStream()
226226 try {
227227 close ();
228228 }
229- catch (exception&) {
229+ catch (const exception&) {
230230 // Ignore and continue
231231 }
232232
@@ -302,7 +302,7 @@ void CompressedInputStream::readHeader()
302302 _entropyType = short (_ibs->readBits (5 ));
303303 _ctx.putString (" entropy" , EntropyDecoderFactory::getName (_entropyType));
304304 }
305- catch (invalid_argument&) {
305+ catch (const invalid_argument&) {
306306 stringstream err;
307307 err << " Invalid bitstream, unknown entropy type: " << _entropyType;
308308 throw IOException (err.str (), Error::ERR_INVALID_CODEC);
@@ -313,7 +313,7 @@ void CompressedInputStream::readHeader()
313313 _transformType = _ibs->readBits (48 );
314314 _ctx.putString (" transform" , TransformFactory<byte>::getName (_transformType));
315315 }
316- catch (invalid_argument&) {
316+ catch (const invalid_argument&) {
317317 stringstream err;
318318 err << " Invalid bitstream, unknown transform type: " << _transformType;
319319 throw IOException (err.str (), Error::ERR_INVALID_CODEC);
@@ -453,11 +453,11 @@ int CompressedInputStream::_get(int inc)
453453
454454 return res;
455455 }
456- catch (IOException&) {
456+ catch (const IOException&) {
457457 setstate (ios::badbit);
458458 throw ; // rethrow
459459 }
460- catch (exception&) {
460+ catch (const exception&) {
461461 setstate (ios::badbit);
462462 throw ; // rethrow
463463 }
@@ -694,14 +694,14 @@ int64 CompressedInputStream::processBlock()
694694
695695 return decoded;
696696 }
697- catch (IOException&) {
697+ catch (const IOException&) {
698698 for (vector<DecodingTask<DecodingTaskResult>*>::iterator it = tasks.begin (); it != tasks.end (); ++it)
699699 delete *it;
700700
701701 tasks.clear ();
702702 throw ;
703703 }
704- catch (exception& e) {
704+ catch (const exception& e) {
705705 for (vector<DecodingTask<DecodingTaskResult>*>::iterator it = tasks.begin (); it != tasks.end (); ++it)
706706 delete *it;
707707
@@ -718,7 +718,7 @@ void CompressedInputStream::close()
718718 try {
719719 _ibs->close ();
720720 }
721- catch (BitStreamException& e) {
721+ catch (const BitStreamException& e) {
722722 throw IOException (e.what (), e.error ());
723723 }
724724
@@ -992,7 +992,7 @@ T DecodingTask<T>::run()
992992
993993 return T (*_data, blockId, decoded, checksum1, 0 , " Success" );
994994 }
995- catch (exception& e) {
995+ catch (const exception& e) {
996996 // Make sure to unfreeze next block
997997 if (_processedBlockId->load (memory_order_acquire) == blockId - 1 )
998998 _processedBlockId->store (blockId, memory_order_release);
0 commit comments