Commit 6b277448 authored by Davis King's avatar Davis King
Browse files

Changed the code so that gcc doesn't give warnings when supplied with the "-Wall -W"

combined warning option.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403015
parent 7f75ed83
...@@ -721,13 +721,13 @@ namespace dlib ...@@ -721,13 +721,13 @@ namespace dlib
typedef typename EXP::type type; typedef typename EXP::type type;
typedef typename EXP::mem_manager_type mem_manager_type; typedef typename EXP::mem_manager_type mem_manager_type;
template <typename M> template <typename M>
static type apply ( const M& m, long r, long c) static type apply ( const M& m, long r, long )
{ return m(r,r); } { return m(r,r); }
template <typename M> template <typename M>
static long nr (const M& m) { return std::min(m.nc(),m.nr()); } static long nr (const M& m) { return std::min(m.nc(),m.nr()); }
template <typename M> template <typename M>
static long nc (const M& m) { return 1; } static long nc (const M& ) { return 1; }
}; };
}; };
...@@ -1035,7 +1035,7 @@ namespace dlib ...@@ -1035,7 +1035,7 @@ namespace dlib
const static long NC = 0; const static long NC = 0;
typedef typename memory_manager<char>::kernel_1a mem_manager_type; typedef typename memory_manager<char>::kernel_1a mem_manager_type;
typedef T type; typedef T type;
static type apply (const T& val, long r, long c) static type apply (const T& val, long , long )
{ return val; } { return val; }
}; };
...@@ -1072,7 +1072,7 @@ namespace dlib ...@@ -1072,7 +1072,7 @@ namespace dlib
const static long NC = NC_; const static long NC = NC_;
typedef typename memory_manager<char>::kernel_1a mem_manager_type; typedef typename memory_manager<char>::kernel_1a mem_manager_type;
typedef T type; typedef T type;
static type apply (const T& val, long r, long c) static type apply (const T& val, long , long )
{ return val; } { return val; }
}; };
...@@ -1106,7 +1106,7 @@ namespace dlib ...@@ -1106,7 +1106,7 @@ namespace dlib
const static long NC = NC_; const static long NC = NC_;
typedef typename memory_manager<char>::kernel_1a mem_manager_type; typedef typename memory_manager<char>::kernel_1a mem_manager_type;
typedef T type; typedef T type;
static type apply ( long r, long c) static type apply ( long , long )
{ return val; } { return val; }
}; };
......
...@@ -79,7 +79,7 @@ namespace dlib ...@@ -79,7 +79,7 @@ namespace dlib
//allocate but don't initialize num elements of type T //allocate but don't initialize num elements of type T
pointer allocate ( pointer allocate (
size_type num, size_type num,
typename std_allocator<void,M>::const_pointer hint = 0 typename std_allocator<void,M>::const_pointer = 0
) )
{ {
return (pointer) pool.allocate_array(num*sizeof(T)); return (pointer) pool.allocate_array(num*sizeof(T));
...@@ -101,7 +101,7 @@ namespace dlib ...@@ -101,7 +101,7 @@ namespace dlib
} }
//deallocate storage p of deleted elements //deallocate storage p of deleted elements
void deallocate (pointer p, size_type num) void deallocate (pointer p, size_type )
{ {
pool.deallocate_array((char*)p); pool.deallocate_array((char*)p);
} }
......
...@@ -336,7 +336,7 @@ namespace dlib ...@@ -336,7 +336,7 @@ namespace dlib
} }
bool operator== ( bool operator== (
const linear_kernel& k const linear_kernel&
) const ) const
{ {
return true; return true;
......
...@@ -288,7 +288,7 @@ namespace dlib ...@@ -288,7 +288,7 @@ namespace dlib
} }
bool operator== ( bool operator== (
const sparse_linear_kernel& k const sparse_linear_kernel&
) const ) const
{ {
return true; return true;
......
...@@ -1475,7 +1475,7 @@ namespace dlib ...@@ -1475,7 +1475,7 @@ namespace dlib
typename scalar_type typename scalar_type
> >
inline void optimize_working_pair ( inline void optimize_working_pair (
const scalar_vector_type2& y, const scalar_vector_type2& ,
scalar_vector_type& alpha, scalar_vector_type& alpha,
const kernel_matrix_cache<K, sample_vector_type, scalar_vector_type2>& Q, const kernel_matrix_cache<K, sample_vector_type, scalar_vector_type2>& Q,
const scalar_vector_type& df, const scalar_vector_type& df,
......
...@@ -149,7 +149,7 @@ namespace ...@@ -149,7 +149,7 @@ namespace
for (unsigned long i = 0; i < alphabet_size-1; ++i) for (unsigned long i = 0; i < alphabet_size-1; ++i)
{ {
test.increment_count(i); test.increment_count(i);
unsigned long low_count, high_count, total_count; unsigned long low_count = 0, high_count = 0, total_count = 0;
DLIB_TEST(test.get_range(i,low_count,high_count,total_count) == 1); DLIB_TEST(test.get_range(i,low_count,high_count,total_count) == 1);
DLIB_TEST(high_count == low_count+1); DLIB_TEST(high_count == low_count+1);
...@@ -546,7 +546,7 @@ namespace ...@@ -546,7 +546,7 @@ namespace
{ {
if(!test.increment_count(i)) if(!test.increment_count(i))
oom = true; oom = true;
unsigned long low_count, high_count, total_count; unsigned long low_count = 0, high_count = 0, total_count = 0;
if (!oom) if (!oom)
{ {
......
...@@ -263,7 +263,7 @@ class win : public drawable_window ...@@ -263,7 +263,7 @@ class win : public drawable_window
void tab_change ( void tab_change (
unsigned long new_idx, unsigned long new_idx,
unsigned long old_idx unsigned long
) )
{ {
tab_label.set_text(tabs.tab_name(new_idx)); tab_label.set_text(tabs.tab_name(new_idx));
...@@ -298,7 +298,7 @@ class win : public drawable_window ...@@ -298,7 +298,7 @@ class win : public drawable_window
} }
void lb_double_click ( void lb_double_click (
unsigned long idx unsigned long
) )
{ {
dlib::queue<unsigned long>::kernel_2a_c sel; dlib::queue<unsigned long>::kernel_2a_c sel;
...@@ -335,7 +335,7 @@ class win : public drawable_window ...@@ -335,7 +335,7 @@ class win : public drawable_window
} }
static void try_this_junk2 ( static void try_this_junk2 (
void* param void*
) )
{ {
......
...@@ -46,7 +46,7 @@ namespace ...@@ -46,7 +46,7 @@ namespace
} }
bool operator== ( bool operator== (
const unopt_sparse_linear_kernel& k const unopt_sparse_linear_kernel&
) const ) const
{ {
return true; return true;
...@@ -69,7 +69,7 @@ namespace ...@@ -69,7 +69,7 @@ namespace
} }
bool operator== ( bool operator== (
const unopt_linear_kernel& k const unopt_linear_kernel&
) const ) const
{ {
return true; return true;
......
...@@ -509,7 +509,7 @@ namespace ...@@ -509,7 +509,7 @@ namespace
unsigned long match_index, match_length; unsigned long match_index = 0, match_length = 0;
unsigned long lookahead_size_before = test.get_lookahead_buffer_size(); unsigned long lookahead_size_before = test.get_lookahead_buffer_size();
unsigned long history_size_before = test.get_history_buffer_size(); unsigned long history_size_before = test.get_history_buffer_size();
test.find_match(match_index,match_length,2); test.find_match(match_index,match_length,2);
......
...@@ -49,7 +49,7 @@ namespace dlib ...@@ -49,7 +49,7 @@ namespace dlib
template <int N> void wstr2ustring_t(const wchar_t *src, size_t src_len, ustring &dest); template <int N> void wstr2ustring_t(const wchar_t *src, size_t src_len, ustring &dest);
template <> void wstr2ustring_t<4>(const wchar_t *src, size_t src_len, ustring &dest) template <> void wstr2ustring_t<4>(const wchar_t *src, size_t , ustring &dest)
{ {
dest.assign((const unichar *)(src)); dest.assign((const unichar *)(src));
} }
......
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