Fix the '-Wcatch-value' warning under gcc 7.3.0

tiv.cpp:464:45: warning: catching polymorphic type ‘struct cimg_library::CImgIOException’ by value [-Wcatch-value=]
pull/45/head
CHEN Feng 2019-03-12 00:47:11 +08:00 committed by Stefan Haustein
parent 949f72ffa9
commit 287fde3341
1 changed files with 2 additions and 2 deletions

View File

@ -459,7 +459,7 @@ int main(int argc, char* argv[]) {
image.resize((int) (image.width() * scale), (int) (image.height() * scale), -100, -100, 5);
}
emit_image(image, flags);
} catch(cimg_library::CImgIOException e) {
} catch(cimg_library::CImgIOException & e) {
error = 1;
std::cerr << "File format is not recognized for '" << file_names[i] << "'" << std::endl;
}
@ -489,7 +489,7 @@ int main(int argc, char* argv[]) {
unsigned int sl = count * (cw + 2);
sb.resize(sl - 2, ' ');
sb += " ";
} catch (std::exception e) {
} catch (std::exception & e) {
// Probably no image; ignore.
}
}