Commit 782a9096 authored by Davis King's avatar Davis King

Fixed warnings in gcc 7

parent d1d45f50
...@@ -214,7 +214,9 @@ namespace dlib ...@@ -214,7 +214,9 @@ namespace dlib
switch(len & 3) switch(len & 3)
{ {
case 3: k1 ^= tail[2] << 16; case 3: k1 ^= tail[2] << 16;
// fall through
case 2: k1 ^= tail[1] << 8; case 2: k1 ^= tail[1] << 8;
// fall through
case 1: k1 ^= tail[0]; case 1: k1 ^= tail[0];
k1 *= c1; k1 = DLIB_ROTL32(k1,15); k1 *= c2; h1 ^= k1; k1 *= c1; k1 = DLIB_ROTL32(k1,15); k1 *= c2; h1 ^= k1;
}; };
...@@ -384,24 +386,24 @@ namespace dlib ...@@ -384,24 +386,24 @@ namespace dlib
switch(len & 15) switch(len & 15)
{ {
case 15: k2 ^= uint64(tail[14]) << 48; case 15: k2 ^= uint64(tail[14]) << 48; // fall through
case 14: k2 ^= uint64(tail[13]) << 40; case 14: k2 ^= uint64(tail[13]) << 40; // fall through
case 13: k2 ^= uint64(tail[12]) << 32; case 13: k2 ^= uint64(tail[12]) << 32; // fall through
case 12: k2 ^= uint64(tail[11]) << 24; case 12: k2 ^= uint64(tail[11]) << 24; // fall through
case 11: k2 ^= uint64(tail[10]) << 16; case 11: k2 ^= uint64(tail[10]) << 16; // fall through
case 10: k2 ^= uint64(tail[ 9]) << 8; case 10: k2 ^= uint64(tail[ 9]) << 8; // fall through
case 9: k2 ^= uint64(tail[ 8]) << 0; case 9: k2 ^= uint64(tail[ 8]) << 0;
k2 *= c2; k2 = DLIB_ROTL64(k2,33); k2 *= c1; h2 ^= k2; k2 *= c2; k2 = DLIB_ROTL64(k2,33); k2 *= c1; h2 ^= k2; // fall through
case 8: k1 ^= uint64(tail[ 7]) << 56; case 8: k1 ^= uint64(tail[ 7]) << 56; // fall through
case 7: k1 ^= uint64(tail[ 6]) << 48; case 7: k1 ^= uint64(tail[ 6]) << 48; // fall through
case 6: k1 ^= uint64(tail[ 5]) << 40; case 6: k1 ^= uint64(tail[ 5]) << 40; // fall through
case 5: k1 ^= uint64(tail[ 4]) << 32; case 5: k1 ^= uint64(tail[ 4]) << 32; // fall through
case 4: k1 ^= uint64(tail[ 3]) << 24; case 4: k1 ^= uint64(tail[ 3]) << 24; // fall through
case 3: k1 ^= uint64(tail[ 2]) << 16; case 3: k1 ^= uint64(tail[ 2]) << 16; // fall through
case 2: k1 ^= uint64(tail[ 1]) << 8; case 2: k1 ^= uint64(tail[ 1]) << 8; // fall through
case 1: k1 ^= uint64(tail[ 0]) << 0; case 1: k1 ^= uint64(tail[ 0]) << 0;
k1 *= c1; k1 = DLIB_ROTL64(k1,31); k1 *= c2; h1 ^= k1; k1 *= c1; k1 = DLIB_ROTL64(k1,31); k1 *= c2; h1 ^= k1; // fall through
}; };
//---------- //----------
......
...@@ -277,7 +277,7 @@ namespace dlib ...@@ -277,7 +277,7 @@ namespace dlib
size &= 0x0F; size &= 0x0F;
// check if the serialized object is too big // check if the serialized object is too big
if (size > sizeof(T)) if (size > (unsigned long)tmin<sizeof(T),8>::value || size == 0)
{ {
return true; return true;
} }
...@@ -391,7 +391,7 @@ namespace dlib ...@@ -391,7 +391,7 @@ namespace dlib
size &= 0x8F; size &= 0x8F;
// check if an error occurred // check if an error occurred
if (size > sizeof(T)) if (size > (unsigned long)tmin<sizeof(T),8>::value || size == 0)
return true; return true;
......
...@@ -355,7 +355,7 @@ namespace dlib ...@@ -355,7 +355,7 @@ namespace dlib
//typedef typename K::sample_type sample_type; //typedef typename K::sample_type sample_type;
typedef typename K::mem_manager_type mem_manager_type; typedef typename K::mem_manager_type mem_manager_type;
caching_kernel () : samples(0), counter(0), counter_threshold(0) {} caching_kernel () {}
caching_kernel ( caching_kernel (
const K& kern, const K& kern,
...@@ -458,12 +458,12 @@ namespace dlib ...@@ -458,12 +458,12 @@ namespace dlib
std::vector<std::pair<long,long> > frequency_of_use; std::vector<std::pair<long,long> > frequency_of_use;
}; };
const sample_vector_type* samples; const sample_vector_type* samples = 0;
std::shared_ptr<cache_type> cache; std::shared_ptr<cache_type> cache;
mutable unsigned long counter; mutable unsigned long counter = 0;
unsigned long counter_threshold; unsigned long counter_threshold = 0;
long cache_size; long cache_size = 0;
}; };
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
......
...@@ -692,7 +692,7 @@ namespace dlib ...@@ -692,7 +692,7 @@ namespace dlib
bool learn_nonnegative_weights; bool learn_nonnegative_weights;
bool last_weight_1; bool last_weight_1;
matrix<scalar_type,0,1> prior; matrix<scalar_type,0,1> prior;
scalar_type prior_b; scalar_type prior_b = 0;
}; };
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -375,6 +375,7 @@ namespace ...@@ -375,6 +375,7 @@ namespace
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
/*
typedef std::vector<std::pair<unsigned int, float>> sv; typedef std::vector<std::pair<unsigned int, float>> sv;
sv rand_sparse_vector() sv rand_sparse_vector()
{ {
...@@ -423,6 +424,7 @@ namespace ...@@ -423,6 +424,7 @@ namespace
timing::print(); timing::print();
} }
*/
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -357,6 +357,7 @@ namespace dlib ...@@ -357,6 +357,7 @@ namespace dlib
case empty_element: is_empty = true; case empty_element: is_empty = true;
// fall through
case element_start: case element_start:
{ {
seen_root_tag = true; seen_root_tag = true;
......
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