Author: post
Date: 2012-01-12 18:44:16 +0100 (Thu, 12 Jan 2012)
New Revision: 403
Modified:
RawSpeed/ArwDecoder.cpp
RawSpeed/Cr2Decoder.cpp
RawSpeed/DngDecoder.cpp
RawSpeed/DngDecoderSlices.cpp
RawSpeed/NefDecoder.cpp
RawSpeed/OrfDecoder.cpp
RawSpeed/PefDecoder.cpp
RawSpeed/RawDecoder.cpp
RawSpeed/RawSpeed.cpp
RawSpeed/TiffIFD.cpp
RawSpeed/TiffIFDBE.cpp
Log:
Use catch by reference to avoid object copy.
Modified: RawSpeed/ArwDecoder.cpp
===================================================================
--- RawSpeed/ArwDecoder.cpp 2012-01-08 11:47:29 UTC (rev 402)
+++ RawSpeed/ArwDecoder.cpp 2012-01-12 17:44:16 UTC (rev 403)
@@ -105,7 +105,7 @@
DecodeARW(input, width, height);
else
DecodeARW2(input, width, height, bitPerPixel);
- } catch (IOException e) {
+ } catch (IOException &e) {
errors.push_back(_strdup(e.what()));
// Let's ignore it, it may have delivered somewhat useful data.
}
Modified: RawSpeed/Cr2Decoder.cpp
===================================================================
--- RawSpeed/Cr2Decoder.cpp 2012-01-08 11:47:29 UTC (rev 402)
+++ RawSpeed/Cr2Decoder.cpp 2012-01-12 17:44:16 UTC (rev 403)
@@ -116,12 +116,12 @@
l.addSlices(s_width);
l.mUseBigtable = true;
l.startDecoder(slice.offset, slice.count, 0, offY);
- } catch (RawDecoderException e) {
+ } catch (RawDecoderException &e) {
if (i == 0)
throw;
// These may just be single slice error - store the error and move on
errors.push_back(_strdup(e.what()));
- } catch (IOException e) {
+ } catch (IOException &e) {
// Let's try to ignore this - it might be truncated data, so something
might be useful.
errors.push_back(_strdup(e.what()));
}
Modified: RawSpeed/DngDecoder.cpp
===================================================================
--- RawSpeed/DngDecoder.cpp 2012-01-08 11:47:29 UTC (rev 402)
+++ RawSpeed/DngDecoder.cpp 2012-01-12 17:44:16 UTC (rev 403)
@@ -215,7 +215,7 @@
big_endian = true;
try {
readUncompressedRaw(in, size, pos, width*bps / 8, bps, big_endian);
- } catch(IOException ex) {
+ } catch(IOException &ex) {
if (i > 0)
errors.push_back(_strdup(ex.what()));
else
Modified: RawSpeed/DngDecoderSlices.cpp
===================================================================
--- RawSpeed/DngDecoderSlices.cpp 2012-01-08 11:47:29 UTC (rev 402)
+++ RawSpeed/DngDecoderSlices.cpp 2012-01-12 17:44:16 UTC (rev 403)
@@ -93,9 +93,9 @@
t->slices.pop();
try {
l.startDecoder(e.byteOffset, e.byteCount, e.offX, e.offY);
- } catch (RawDecoderException err) {
+ } catch (RawDecoderException &err) {
setError(err.what());
- } catch (IOException err) {
+ } catch (IOException) {
setError("DngDecoderSlices::decodeSlice: IO error occurred.");
}
}
Modified: RawSpeed/NefDecoder.cpp
===================================================================
--- RawSpeed/NefDecoder.cpp 2012-01-08 11:47:29 UTC (rev 402)
+++ RawSpeed/NefDecoder.cpp 2012-01-12 17:44:16 UTC (rev 403)
@@ -124,7 +124,7 @@
decompressor.DecompressNikon(metastream, width, height, bitPerPixel,
offsets->getInt(), counts->getInt());
delete metastream;
- } catch (IOException e) {
+ } catch (IOException &e) {
errors.push_back(_strdup(e.what()));
// Let's ignore it, it may have delivered somewhat useful data.
}
Modified: RawSpeed/OrfDecoder.cpp
===================================================================
--- RawSpeed/OrfDecoder.cpp 2012-01-08 11:47:29 UTC (rev 402)
+++ RawSpeed/OrfDecoder.cpp 2012-01-12 17:44:16 UTC (rev 403)
@@ -94,7 +94,7 @@
try {
decodeCompressed(s, width, height);
- } catch (IOException e) {
+ } catch (IOException &e) {
errors.push_back(_strdup(e.what()));
// Let's ignore it, it may have delivered somewhat useful data.
}
Modified: RawSpeed/PefDecoder.cpp
===================================================================
--- RawSpeed/PefDecoder.cpp 2012-01-08 11:47:29 UTC (rev 402)
+++ RawSpeed/PefDecoder.cpp 2012-01-12 17:44:16 UTC (rev 403)
@@ -73,7 +73,7 @@
try {
PentaxDecompressor l(mFile, mRaw);
l.decodePentax(mRootIFD, offsets->getInt(), counts->getInt());
- } catch (IOException e) {
+ } catch (IOException &e) {
errors.push_back(_strdup(e.what()));
// Let's ignore it, it may have delivered somewhat useful data.
}
Modified: RawSpeed/RawDecoder.cpp
===================================================================
--- RawSpeed/RawDecoder.cpp 2012-01-08 11:47:29 UTC (rev 402)
+++ RawSpeed/RawDecoder.cpp 2012-01-12 17:44:16 UTC (rev 403)
@@ -79,12 +79,12 @@
bitPerPixel = (int)((uint64)(slice.count * 8) / (slice.h * width));
try {
readUncompressedRaw(in, size, pos, width*bitPerPixel / 8, bitPerPixel,
MSBOrder);
- } catch (RawDecoderException e) {
+ } catch (RawDecoderException &e) {
if (i>0)
errors.push_back(_strdup(e.what()));
else
throw;
- } catch (IOException e) {
+ } catch (IOException &e) {
if (i>0)
errors.push_back(_strdup(e.what()));
else
@@ -252,9 +252,9 @@
RawDecoderThread* me = (RawDecoderThread*)_this;
try {
me->parent->decodeThreaded(me);
- } catch (RawDecoderException ex) {
+ } catch (RawDecoderException &ex) {
me->error = _strdup(ex.what());
- } catch (IOException ex) {
+ } catch (IOException &ex) {
me->error = _strdup(ex.what());
}
@@ -304,11 +304,11 @@
{
try {
return decodeRawInternal();
- } catch (TiffParserException e) {
+ } catch (TiffParserException &e) {
ThrowRDE("%s", e.what());
- } catch (FileIOException e) {
+ } catch (FileIOException &e) {
ThrowRDE("%s", e.what());
- } catch (IOException e) {
+ } catch (IOException &e) {
ThrowRDE("%s", e.what());
}
return NULL;
Modified: RawSpeed/RawSpeed.cpp
===================================================================
--- RawSpeed/RawSpeed.cpp 2012-01-08 11:47:29 UTC (rev 402)
+++ RawSpeed/RawSpeed.cpp 2012-01-12 17:44:16 UTC (rev 403)
@@ -47,7 +47,7 @@
// wprintf(L"Opening:%s\n",f.Filename());
try {
m = f.readFile();
- } catch (FileIOException e) {
+ } catch (FileIOException &e) {
printf("Could not open image:%s\n", e.what());
return;
}
@@ -116,7 +116,7 @@
gflSaveBitmap((char*)savename.c_str(),b,&s);
gflFreeBitmap(b);
#endif
- } catch (RawDecoderException e) {
+ } catch (RawDecoderException &e) {
wchar_t uni[1024];
MultiByteToWideChar(CP_ACP, 0, e.what(), -1, uni, 1024);
// MessageBox(0,uni, L"RawDecoder Exception",0);
@@ -138,7 +138,7 @@
wprintf(L"Opening:%s\n",f.Filename());
try {
m = f.readFile();
- } catch (FileIOException e) {
+ } catch (FileIOException &e) {
printf("Could not open image:%s\n", e.what());
return;
}
@@ -168,7 +168,7 @@
/* for (uint32 i = 0; i < d->errors.size(); i++) {
printf("Error Encountered:%s\n", d->errors[i]);
}*/
- } catch (RawDecoderException e) {
+ } catch (RawDecoderException &e) {
wchar_t uni[1024];
MultiByteToWideChar(CP_ACP, 0, e.what(), -1, uni, 1024);
wprintf(L"Raw Decoder Exception:%s\n",uni);
@@ -200,7 +200,7 @@
/* for (uint32 i = 0; i < d->errors.size(); i++) {
printf("Error Encountered:%s\n", d->errors[i]);
}*/
- } catch (RawDecoderException e) {
+ } catch (RawDecoderException &e) {
wchar_t uni[1024];
MultiByteToWideChar(CP_ACP, 0, e.what(), -1, uni, 1024);
wprintf(L"Raw Decoder Exception:%s\n",uni);
@@ -1062,7 +1062,7 @@
OpenFile(FileReader(L"..\\testimg\\Nikon-D3XFARI0100.NEF"),&meta);
- } catch (CameraMetadataException e) {
+ } catch (CameraMetadataException &e) {
}
MessageBox(0,L"Finished", L"Finished",0);
Modified: RawSpeed/TiffIFD.cpp
===================================================================
--- RawSpeed/TiffIFD.cpp 2012-01-08 11:47:29 UTC (rev 402)
+++ RawSpeed/TiffIFD.cpp 2012-01-12 17:44:16 UTC (rev 403)
@@ -54,7 +54,7 @@
TiffIFD *maker_ifd = parseDngPrivateData(t);
mSubIFD.push_back(maker_ifd);
delete(t);
- } catch (TiffParserException e) {
+ } catch (TiffParserException) {
// Unparsable private data are added as entries
mEntry[t->tag] = t;
}
@@ -62,7 +62,7 @@
try {
mSubIFD.push_back(parseMakerNote(f, t->getDataOffset(), endian));
delete(t);
- } catch (TiffParserException e) {
+ } catch (TiffParserException) {
// Unparsable makernotes are added as entries
mEntry[t->tag] = t;
}
@@ -73,7 +73,7 @@
mSubIFD.push_back(new TiffIFD(f, sub_offsets[j]));
}
delete(t);
- } catch (TiffParserException e) {
+ } catch (TiffParserException) {
// Unparsable subifds are added as entries
mEntry[t->tag] = t;
}
@@ -142,7 +142,7 @@
TiffIFD *maker_ifd;
try {
maker_ifd = parseMakerNote(maker_map, org_offset, makernote_endian);
- } catch (TiffParserException e) {
+ } catch (TiffParserException &e) {
delete[] maker_data;
delete maker_map;
throw e;
Modified: RawSpeed/TiffIFDBE.cpp
===================================================================
--- RawSpeed/TiffIFDBE.cpp 2012-01-08 11:47:29 UTC (rev 402)
+++ RawSpeed/TiffIFDBE.cpp 2012-01-12 17:44:16 UTC (rev 403)
@@ -47,7 +47,7 @@
TiffIFD *maker_ifd = parseDngPrivateData(t);
mSubIFD.push_back(maker_ifd);
delete(t);
- } catch (TiffParserException e) {
+ } catch (TiffParserException) {
// Unparsable private data are added as entries
mEntry[t->tag] = t;
}
@@ -55,7 +55,7 @@
try {
mSubIFD.push_back(parseMakerNote(f, t->getDataOffset(), endian));
delete(t);
- } catch (TiffParserException e) {
+ } catch (TiffParserException) {
// Unparsable makernotes are added as entries
mEntry[t->tag] = t;
}
@@ -66,7 +66,7 @@
mSubIFD.push_back(new TiffIFDBE(f, sub_offsets[j]));
}
delete(t);
- } catch (TiffParserException e) {
+ } catch (TiffParserException) {
// Unparsable subifds are added as entries
mEntry[t->tag] = t;
}
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit