Commit f9b7ad9a authored by Davis King's avatar Davis King

Fixed compiler warnings in gcc 8

parent 5d03b99a
...@@ -250,7 +250,7 @@ namespace dlib ...@@ -250,7 +250,7 @@ namespace dlib
for (size_t i = 0; i < item.size(); ++i) for (size_t i = 0; i < item.size(); ++i)
serialize(item[i],out); serialize(item[i],out);
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
throw serialization_error(e.info + "\n while serializing object of type array"); throw serialization_error(e.info + "\n while serializing object of type array");
} }
...@@ -275,7 +275,7 @@ namespace dlib ...@@ -275,7 +275,7 @@ namespace dlib
for (size_t i = 0; i < size; ++i) for (size_t i = 0; i < size; ++i)
deserialize(item[i],in); deserialize(item[i],in);
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type array"); throw serialization_error(e.info + "\n while deserializing object of type array");
......
...@@ -394,7 +394,7 @@ namespace dlib ...@@ -394,7 +394,7 @@ namespace dlib
serialize(item.element(),out); serialize(item.element(),out);
item.reset(); item.reset();
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
throw serialization_error(e.info + "\n while serializing object of type array2d"); throw serialization_error(e.info + "\n while serializing object of type array2d");
} }
...@@ -432,7 +432,7 @@ namespace dlib ...@@ -432,7 +432,7 @@ namespace dlib
deserialize(item.element(),in); deserialize(item.element(),in);
item.reset(); item.reset();
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type array2d"); throw serialization_error(e.info + "\n while deserializing object of type array2d");
......
...@@ -43,7 +43,7 @@ namespace dlib ...@@ -43,7 +43,7 @@ namespace dlib
if (item.size() != 0) if (item.size() != 0)
out.write((char*)&item[0][0], sizeof(rgb_pixel)*item.size()); out.write((char*)&item[0][0], sizeof(rgb_pixel)*item.size());
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
throw serialization_error(e.info + "\n while serializing object of type array2d"); throw serialization_error(e.info + "\n while serializing object of type array2d");
} }
...@@ -81,7 +81,7 @@ namespace dlib ...@@ -81,7 +81,7 @@ namespace dlib
if (item.size() != 0) if (item.size() != 0)
in.read((char*)&item[0][0], sizeof(rgb_pixel)*item.size()); in.read((char*)&item[0][0], sizeof(rgb_pixel)*item.size());
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type array2d"); throw serialization_error(e.info + "\n while deserializing object of type array2d");
...@@ -112,7 +112,7 @@ namespace dlib ...@@ -112,7 +112,7 @@ namespace dlib
if (item.size() != 0) if (item.size() != 0)
out.write((char*)&item[0][0], sizeof(bgr_pixel)*item.size()); out.write((char*)&item[0][0], sizeof(bgr_pixel)*item.size());
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
throw serialization_error(e.info + "\n while serializing object of type array2d"); throw serialization_error(e.info + "\n while serializing object of type array2d");
} }
...@@ -151,7 +151,7 @@ namespace dlib ...@@ -151,7 +151,7 @@ namespace dlib
if (item.size() != 0) if (item.size() != 0)
in.read((char*)&item[0][0], sizeof(bgr_pixel)*item.size()); in.read((char*)&item[0][0], sizeof(bgr_pixel)*item.size());
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type array2d"); throw serialization_error(e.info + "\n while deserializing object of type array2d");
...@@ -182,7 +182,7 @@ namespace dlib ...@@ -182,7 +182,7 @@ namespace dlib
if (item.size() != 0) if (item.size() != 0)
out.write((char*)&item[0][0], sizeof(hsi_pixel)*item.size()); out.write((char*)&item[0][0], sizeof(hsi_pixel)*item.size());
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
throw serialization_error(e.info + "\n while serializing object of type array2d"); throw serialization_error(e.info + "\n while serializing object of type array2d");
} }
...@@ -221,7 +221,7 @@ namespace dlib ...@@ -221,7 +221,7 @@ namespace dlib
if (item.size() != 0) if (item.size() != 0)
in.read((char*)&item[0][0], sizeof(hsi_pixel)*item.size()); in.read((char*)&item[0][0], sizeof(hsi_pixel)*item.size());
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type array2d"); throw serialization_error(e.info + "\n while deserializing object of type array2d");
...@@ -252,7 +252,7 @@ namespace dlib ...@@ -252,7 +252,7 @@ namespace dlib
if (item.size() != 0) if (item.size() != 0)
out.write((char*)&item[0][0], sizeof(rgb_alpha_pixel)*item.size()); out.write((char*)&item[0][0], sizeof(rgb_alpha_pixel)*item.size());
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
throw serialization_error(e.info + "\n while serializing object of type array2d"); throw serialization_error(e.info + "\n while serializing object of type array2d");
} }
...@@ -291,7 +291,7 @@ namespace dlib ...@@ -291,7 +291,7 @@ namespace dlib
if (item.size() != 0) if (item.size() != 0)
in.read((char*)&item[0][0], sizeof(rgb_alpha_pixel)*item.size()); in.read((char*)&item[0][0], sizeof(rgb_alpha_pixel)*item.size());
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type array2d"); throw serialization_error(e.info + "\n while deserializing object of type array2d");
...@@ -320,7 +320,7 @@ namespace dlib ...@@ -320,7 +320,7 @@ namespace dlib
if (item.size() != 0) if (item.size() != 0)
out.write((char*)&item[0][0], sizeof(unsigned char)*item.size()); out.write((char*)&item[0][0], sizeof(unsigned char)*item.size());
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
throw serialization_error(e.info + "\n while serializing object of type array2d"); throw serialization_error(e.info + "\n while serializing object of type array2d");
} }
...@@ -356,7 +356,7 @@ namespace dlib ...@@ -356,7 +356,7 @@ namespace dlib
if (item.size() != 0) if (item.size() != 0)
in.read((char*)&item[0][0], sizeof(unsigned char)*item.size()); in.read((char*)&item[0][0], sizeof(unsigned char)*item.size());
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type array2d"); throw serialization_error(e.info + "\n while deserializing object of type array2d");
......
...@@ -534,7 +534,7 @@ namespace dlib ...@@ -534,7 +534,7 @@ namespace dlib
item.add(d,r); item.add(d,r);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type binary_search_tree_kernel_1"); throw serialization_error(e.info + "\n while deserializing object of type binary_search_tree_kernel_1");
......
...@@ -482,7 +482,7 @@ namespace dlib ...@@ -482,7 +482,7 @@ namespace dlib
item.add(d,r); item.add(d,r);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type binary_search_tree_kernel_2"); throw serialization_error(e.info + "\n while deserializing object of type binary_search_tree_kernel_2");
......
...@@ -148,7 +148,7 @@ namespace dlib ...@@ -148,7 +148,7 @@ namespace dlib
serialize(item.points[i].y,out); serialize(item.points[i].y,out);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
throw serialization_error(e.info + "\n while serializing object of type letter"); throw serialization_error(e.info + "\n while serializing object of type letter");
} }
...@@ -178,7 +178,7 @@ namespace dlib ...@@ -178,7 +178,7 @@ namespace dlib
deserialize(item.points[i].y,in); deserialize(item.points[i].y,in);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.w = 0; item.w = 0;
item.count = 0; item.count = 0;
......
...@@ -169,7 +169,7 @@ namespace dlib ...@@ -169,7 +169,7 @@ namespace dlib
item.add(d,r); item.add(d,r);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type hash_map_kernel_1"); throw serialization_error(e.info + "\n while deserializing object of type hash_map_kernel_1");
......
...@@ -151,7 +151,7 @@ namespace dlib ...@@ -151,7 +151,7 @@ namespace dlib
item.add(temp); item.add(temp);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type hash_set_kernel_1"); throw serialization_error(e.info + "\n while deserializing object of type hash_set_kernel_1");
......
...@@ -226,7 +226,7 @@ namespace dlib ...@@ -226,7 +226,7 @@ namespace dlib
item.add(d,r); item.add(d,r);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type hash_table_kernel_1"); throw serialization_error(e.info + "\n while deserializing object of type hash_table_kernel_1");
......
...@@ -194,7 +194,7 @@ namespace dlib ...@@ -194,7 +194,7 @@ namespace dlib
item.add(d,r); item.add(d,r);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type hash_table_kernel_2"); throw serialization_error(e.info + "\n while deserializing object of type hash_table_kernel_2");
......
...@@ -160,7 +160,7 @@ namespace dlib ...@@ -160,7 +160,7 @@ namespace dlib
item.add(d,r); item.add(d,r);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type map_kernel_1"); throw serialization_error(e.info + "\n while deserializing object of type map_kernel_1");
......
...@@ -289,7 +289,7 @@ namespace dlib ...@@ -289,7 +289,7 @@ namespace dlib
doublereal ratio = 0, dnorm = 0, vquad = 0, pqold = 0, tenth = 0; doublereal ratio = 0, dnorm = 0, vquad = 0, pqold = 0, tenth = 0;
integer itest; integer itest;
doublereal sumpq, scaden; doublereal sumpq, scaden;
doublereal errbig, cauchy, fracsq, biglsq, densav; doublereal errbig, cauchy=0, fracsq, biglsq, densav;
doublereal bdtest; doublereal bdtest;
doublereal crvmin, frhosq; doublereal crvmin, frhosq;
doublereal distsq; doublereal distsq;
......
...@@ -184,7 +184,7 @@ namespace dlib ...@@ -184,7 +184,7 @@ namespace dlib
item.enqueue(temp); item.enqueue(temp);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type queue_kernel_1"); throw serialization_error(e.info + "\n while deserializing object of type queue_kernel_1");
......
...@@ -202,7 +202,7 @@ namespace dlib ...@@ -202,7 +202,7 @@ namespace dlib
item.enqueue(temp); item.enqueue(temp);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type queue_kernel_2"); throw serialization_error(e.info + "\n while deserializing object of type queue_kernel_2");
......
...@@ -379,7 +379,7 @@ namespace dlib ...@@ -379,7 +379,7 @@ namespace dlib
item.add(i,temp); item.add(i,temp);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type sequence_kernel_1"); throw serialization_error(e.info + "\n while deserializing object of type sequence_kernel_1");
......
...@@ -199,7 +199,7 @@ namespace dlib ...@@ -199,7 +199,7 @@ namespace dlib
item.add(i,temp); item.add(i,temp);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type sequence_kernel_2"); throw serialization_error(e.info + "\n while deserializing object of type sequence_kernel_2");
......
...@@ -146,7 +146,7 @@ namespace dlib ...@@ -146,7 +146,7 @@ namespace dlib
item.add(temp); item.add(temp);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type set_kernel_1"); throw serialization_error(e.info + "\n while deserializing object of type set_kernel_1");
......
...@@ -215,7 +215,7 @@ namespace dlib ...@@ -215,7 +215,7 @@ namespace dlib
deserialize(item[i],in); deserialize(item[i],in);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type sliding_buffer_kernel_1"); throw serialization_error(e.info + "\n while deserializing object of type sliding_buffer_kernel_1");
......
...@@ -183,7 +183,7 @@ namespace dlib ...@@ -183,7 +183,7 @@ namespace dlib
item.push(temp); item.push(temp);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.clear(); item.clear();
throw serialization_error(e.info + "\n while deserializing object of type stack_kernel_1"); throw serialization_error(e.info + "\n while deserializing object of type stack_kernel_1");
......
...@@ -61,7 +61,7 @@ namespace dlib ...@@ -61,7 +61,7 @@ namespace dlib
deserialize(item.d[i],in); deserialize(item.d[i],in);
} }
} }
catch (serialization_error e) catch (serialization_error& e)
{ {
item.set_size = 0; item.set_size = 0;
if (item.d) if (item.d)
......
...@@ -75,7 +75,7 @@ namespace ...@@ -75,7 +75,7 @@ namespace
bool detected_error = false; bool detected_error = false;
try { try {
test.decompress(sin,sout); test.decompress(sin,sout);
} catch ( typename cs::decompression_error e ) } catch ( typename cs::decompression_error& e )
{ {
detected_error = true; detected_error = true;
++count; ++count;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment