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
This commit is contained in:
Davis King 2009-04-24 22:58:00 +00:00
parent 7f75ed83c0
commit 6b277448f4
30 changed files with 223 additions and 223 deletions

View File

@ -426,21 +426,6 @@ namespace dlib
const static bool value = sizeof(test(from_helper())) == sizeof(yes_type);
};
// ----------------------------------------------------------------------------------------
/*!A is_signed_type
This is a template where is_signed_type<T>::value == true when T is a signed
integral type and false when T is an unsigned integral type.
!*/
template <
typename T
>
struct is_signed_type
{
static const bool value = static_cast<T>((static_cast<T>(0)-static_cast<T>(1))) < 0;
};
// ----------------------------------------------------------------------------------------
/*!A is_unsigned_type
@ -456,6 +441,21 @@ namespace dlib
static const bool value = static_cast<T>((static_cast<T>(0)-static_cast<T>(1))) > 0;
};
// ----------------------------------------------------------------------------------------
/*!A is_signed_type
This is a template where is_signed_type<T>::value == true when T is a signed
integral type and false when T is an unsigned integral type.
!*/
template <
typename T
>
struct is_signed_type
{
static const bool value = !is_unsigned_type<T>::value;
};
// ----------------------------------------------------------------------------------------
template <

View File

@ -182,8 +182,8 @@ namespace dlib
{
static void check_operator_bracket_precondition (const cr_type&, const std::string& ) {}
static void check_block_precondition (const cr_type&, const std::string& ) {}
static void check_current_block_name_precondition (const cr_type& cr) {}
static void check_element_precondition (const cr_type& cr) {}
static void check_current_block_name_precondition (const cr_type& ) {}
static void check_element_precondition (const cr_type& ) {}
};
template <typename cr_type>

View File

@ -146,8 +146,8 @@ namespace dlib
struct helper<cr_type,false>
{
static void check_block_precondition (const cr_type&, const std::string& ) {}
static void check_current_block_name_precondition (const cr_type& cr) {}
static void check_element_precondition (const cr_type& cr) {}
static void check_current_block_name_precondition (const cr_type& ) {}
static void check_element_precondition (const cr_type& ) {}
};
template <typename cr_type>

View File

@ -191,15 +191,15 @@ namespace dlib
template <typename node_type, typename directed_graph>
struct directed_graph_checker_helper <node_type, directed_graph, false>
{
static inline void check_parent ( unsigned long edge_index, const node_type& self) { }
static inline void check_child ( unsigned long edge_index, const node_type& self) { }
static inline void check_parent_edge ( unsigned long edge_index, const node_type& self) { }
static inline void check_child_edge ( unsigned long edge_index, const node_type& self) { }
static inline void check_node ( unsigned long index, const directed_graph& self) { }
static inline void check_parent ( unsigned long , const node_type&) { }
static inline void check_child ( unsigned long , const node_type& ) { }
static inline void check_parent_edge ( unsigned long , const node_type&) { }
static inline void check_child_edge ( unsigned long , const node_type& ) { }
static inline void check_node ( unsigned long , const directed_graph& ) { }
static inline void check_has_edge ( unsigned long , unsigned long , const directed_graph& ) { }
static inline void check_add_edge ( unsigned long , unsigned long , const directed_graph& ) { }
static inline void check_remove_edge ( unsigned long , unsigned long , const directed_graph& ) { }
static inline void check_remove_node ( unsigned long index, const directed_graph& self) { }
static inline void check_remove_node ( unsigned long , const directed_graph& ) { }
};
// ----------------------------------------------------------------------------------------

View File

@ -240,11 +240,8 @@ namespace dlib
vector (
const vector& item
)
) : matrix<T,3,1>(item)
{
x() = item.x();
y() = item.y();
z() = item.z();
}
// ---------------------------------------
@ -652,10 +649,8 @@ namespace dlib
vector (
const vector& item
)
) : matrix<T,2,1>(item)
{
x() = item.x();
y() = item.y();
}
// ---------------------------------------

View File

@ -161,13 +161,13 @@ namespace dlib
template <typename node_type, typename graph>
struct graph_checker_helper <node_type, graph, false>
{
static inline void check_edge ( unsigned long edge_index, const node_type& self) { }
static inline void check_neighbor ( unsigned long edge_index, const node_type& self) { }
static inline void check_node ( unsigned long index, const graph& self) { }
static inline void check_edge ( unsigned long , const node_type& ) { }
static inline void check_neighbor ( unsigned long , const node_type& ) { }
static inline void check_node ( unsigned long , const graph& ) { }
static inline void check_has_edge ( unsigned long , unsigned long , const graph& ) { }
static inline void check_add_edge ( unsigned long , unsigned long , const graph& ) { }
static inline void check_remove_edge ( unsigned long , unsigned long , const graph& ) { }
static inline void check_remove_node ( unsigned long index, const graph& self) { }
static inline void check_remove_node ( unsigned long , const graph& ) { }
};
// ----------------------------------------------------------------------------------------

View File

@ -328,7 +328,7 @@ namespace dlib
// ----------------------------------------------------------------------------------------
Bool XCheckIfEventPredicate (
Display* disp,
Display* ,
XEvent* event,
XPointer arg
)
@ -356,8 +356,8 @@ namespace dlib
static bool map_keys (
KeySym keycode,
bool shift,
bool caps,
bool ,
bool ,
unsigned long& result,
bool& is_printable
)
@ -1359,9 +1359,9 @@ namespace dlib
// ----------------------------------------------------------------------------------------
Bool clip_peek_helper (
Display *display,
XEvent *event,
XPointer arg
Display*,
XEvent* event,
XPointer
)
{
if ( event->type == SelectionNotify)

View File

@ -334,29 +334,29 @@ namespace dlib
virtual void on_window_moved(
){}
virtual void on_user_event (
void* p,
int i
void* ,
int
){}
virtual void on_mouse_down (
unsigned long btn,
unsigned long state,
long x,
long y,
bool is_double_click
unsigned long ,
unsigned long ,
long ,
long ,
bool
){}
virtual void on_mouse_up (
unsigned long btn,
unsigned long state,
long x,
long y
unsigned long ,
unsigned long ,
long ,
long
){}
virtual void on_mouse_move (
unsigned long state,
long x,
long y
unsigned long ,
long ,
long
){}
virtual void on_mouse_leave (
@ -366,11 +366,11 @@ namespace dlib
){}
virtual void on_wheel_up (
unsigned long state
unsigned long
){}
virtual void on_wheel_down (
unsigned long state
unsigned long
){}
virtual void on_focus_gained (
@ -380,13 +380,13 @@ namespace dlib
){}
virtual void on_keydown (
unsigned long key,
bool is_printable,
unsigned long state
unsigned long ,
bool ,
unsigned long
){}
virtual void on_string_put (
const std::wstring &str
const std::wstring&
){}
private:

View File

@ -328,10 +328,10 @@ namespace dlib
void draggable::
on_mouse_up (
unsigned long btn,
unsigned long ,
unsigned long state,
long x,
long y
long ,
long
)
{
if (drag && (state & base_window::LEFT) == 0)
@ -385,7 +385,7 @@ namespace dlib
void mouse_over_event::
on_mouse_move (
unsigned long state,
unsigned long ,
long x,
long y
)
@ -1826,7 +1826,7 @@ namespace dlib
void popup_menu::
on_mouse_move (
unsigned long state,
unsigned long ,
long x,
long y
)
@ -2259,7 +2259,7 @@ namespace dlib
void zoomable_region::
on_wheel_down (
unsigned long state
unsigned long
)
{
// zoom out
@ -2279,7 +2279,7 @@ namespace dlib
void zoomable_region::
on_wheel_up (
unsigned long state
unsigned long
)
{
// zoom in
@ -2321,10 +2321,10 @@ namespace dlib
void zoomable_region::
on_mouse_up (
unsigned long btn,
unsigned long state,
long x,
long y
unsigned long ,
unsigned long ,
long ,
long
)
{
mouse_drag_screen = false;
@ -2335,10 +2335,10 @@ namespace dlib
void zoomable_region::
on_mouse_down (
unsigned long btn,
unsigned long state,
unsigned long ,
long x,
long y,
bool is_double_click
bool
)
{
if (enabled && !hidden && display_rect_.contains(x,y) && btn == base_window::LEFT)
@ -2919,7 +2919,7 @@ namespace dlib
void scrollable_region::
on_wheel_down (
unsigned long state
unsigned long
)
{
if (rect.contains(lastx,lasty) && enabled && !hidden)
@ -2966,10 +2966,10 @@ namespace dlib
void scrollable_region::
on_mouse_down (
unsigned long btn,
unsigned long state,
unsigned long ,
long x,
long y,
bool is_double_click
bool
)
{
if (mouse_drag_enabled_ && enabled && !hidden && display_rect().contains(x,y) && (btn==base_window::LEFT))
@ -2987,10 +2987,10 @@ namespace dlib
void scrollable_region::
on_mouse_up (
unsigned long btn,
unsigned long state,
long x,
long y
unsigned long ,
unsigned long ,
long ,
long
)
{
user_is_dragging_mouse = false;
@ -3000,7 +3000,7 @@ namespace dlib
void scrollable_region::
on_wheel_up (
unsigned long state
unsigned long
)
{
if (rect.contains(lastx,lasty) && enabled && !hidden)
@ -3256,10 +3256,10 @@ namespace dlib
void popup_menu_region::
on_mouse_down (
unsigned long btn,
unsigned long state,
unsigned long ,
long x,
long y,
bool is_double_click
bool
)
{
if (enabled && !hidden && rect.contains(x,y) && btn == base_window::RIGHT)

View File

@ -230,7 +230,7 @@ namespace dlib
){}
virtual void on_button_up (
bool mouse_over
bool
){}
void on_mouse_not_over (
@ -358,7 +358,7 @@ namespace dlib
// this object doesn't draw anything but also isn't abstract
void draw (
const canvas& c
const canvas&
) const {}
private:
@ -1389,31 +1389,31 @@ namespace dlib
) const { return 0; }
virtual void draw_background (
const canvas& c,
const rectangle& rect,
const bool enabled,
const bool is_selected
const canvas& ,
const rectangle& ,
const bool ,
const bool
) const {}
virtual void draw_left (
const canvas& c,
const rectangle& rect,
const bool enabled,
const bool is_selected
const canvas& ,
const rectangle& ,
const bool ,
const bool
) const {}
virtual void draw_middle (
const canvas& c,
const rectangle& rect,
const bool enabled,
const bool is_selected
const canvas& ,
const rectangle& ,
const bool ,
const bool
) const = 0;
virtual void draw_right (
const canvas& c,
const rectangle& rect,
const bool enabled,
const bool is_selected
const canvas& ,
const rectangle& ,
const bool ,
const bool
) const {}
virtual void on_click (
@ -1521,7 +1521,7 @@ namespace dlib
const canvas& c,
const rectangle& rect,
const bool enabled,
const bool is_selected
const bool
) const
{
if (c.intersect(rect).is_empty())
@ -1544,7 +1544,7 @@ namespace dlib
const canvas& c,
const rectangle& rect,
const bool enabled,
const bool is_selected
const bool
) const
{
if (c.intersect(rect).is_empty())
@ -1681,7 +1681,7 @@ namespace dlib
const canvas& c,
const rectangle& rect,
const bool enabled,
const bool is_selected
const bool
) const
{
if (c.intersect(rect).is_empty())
@ -1733,8 +1733,8 @@ namespace dlib
virtual void draw_background (
const canvas& c,
const rectangle& rect,
const bool enabled,
const bool is_selected
const bool ,
const bool
) const
{
if (c.intersect(rect).is_empty())
@ -1750,10 +1750,10 @@ namespace dlib
}
virtual void draw_middle (
const canvas& c,
const rectangle& rect,
const bool enabled,
const bool is_selected
const canvas& ,
const rectangle& ,
const bool ,
const bool
) const
{
}

View File

@ -452,7 +452,7 @@ namespace dlib
) const=0;
virtual void on_user_event (
int i
int
){}
virtual void on_window_resized(
@ -462,24 +462,24 @@ namespace dlib
){}
virtual void on_mouse_down (
unsigned long btn,
unsigned long state,
long x,
long y,
bool is_double_click
unsigned long ,
unsigned long ,
long ,
long ,
bool
){}
virtual void on_mouse_up (
unsigned long btn,
unsigned long state,
long x,
long y
unsigned long ,
unsigned long ,
long ,
long
){}
virtual void on_mouse_move (
unsigned long state,
long x,
long y
unsigned long ,
long ,
long
){}
virtual void on_mouse_leave (
@ -489,11 +489,11 @@ namespace dlib
){}
virtual void on_wheel_up (
unsigned long state
unsigned long
){}
virtual void on_wheel_down (
unsigned long state
unsigned long
){}
virtual void on_focus_gained (
@ -503,13 +503,13 @@ namespace dlib
){}
virtual void on_keydown (
unsigned long key,
bool is_printable,
unsigned long state
unsigned long ,
bool ,
unsigned long
){}
virtual void on_string_put (
const std::wstring &str
const std::wstring&
){}
};

View File

@ -459,7 +459,7 @@ namespace nativefont
};
struct image_size_setter{
void operator()(int &width, int &height){
void operator()(int&, int&){
}
};

View File

@ -19,8 +19,8 @@ namespace dlib
const rectangle& rect,
const bool enabled,
const font& mfont,
const long lastx,
const long lasty,
const long ,
const long ,
const ustring& name,
const bool is_depressed
) const
@ -214,10 +214,10 @@ namespace dlib
const canvas& c,
const rectangle& rect,
const bool enabled,
const font& mfont,
const font& ,
const long lastx,
const long lasty,
const ustring& name,
const ustring& ,
const bool is_depressed
) const
{
@ -274,8 +274,8 @@ namespace dlib
rectangle button_style_toolbar_icon1::
get_min_size (
const ustring& name,
const font& mfont
const ustring& ,
const font&
) const
{
return rectangle(img_normal.nc()+2*padding, img_normal.nr()+2*padding);
@ -290,10 +290,10 @@ namespace dlib
const canvas& c,
const rectangle& rect,
const bool enabled,
const font& mfont,
const long lastx,
const long lasty,
const ustring& name,
const font& ,
const long ,
const long ,
const ustring& ,
const bool is_depressed
) const
{
@ -411,8 +411,8 @@ namespace dlib
const rectangle& rect,
const bool enabled,
const font& mfont,
const long lastx,
const long lasty,
const long ,
const long ,
const ustring& name,
const bool is_depressed,
const bool is_checked
@ -501,8 +501,8 @@ namespace dlib
const rectangle& rect,
const bool enabled,
const font& mfont,
const long lastx,
const long lasty,
const long ,
const long ,
const ustring& name,
const bool is_depressed,
const bool is_checked
@ -593,8 +593,8 @@ namespace dlib
const rectangle& rect,
const bool enabled,
const font& mfont,
const long lastx,
const long lasty,
const long ,
const long ,
const ustring& name,
const bool is_depressed,
const bool is_checked
@ -745,7 +745,7 @@ namespace dlib
long scroll_bar_style_default::
get_button_length (
long total_length,
long max_pos
long
) const
{
// if the length is too small then we have to smash up the arrow buttons
@ -766,9 +766,9 @@ namespace dlib
draw_scroll_bar_background (
const canvas& c,
const rectangle& rect,
const bool enabled,
const long lastx,
const long lasty,
const bool ,
const long ,
const long ,
const bool is_depressed
) const
{
@ -784,10 +784,10 @@ namespace dlib
draw_scroll_bar_slider (
const canvas& c,
const rectangle& rect,
const bool enabled,
const long lastx,
const long lasty,
const bool is_being_dragged
const bool ,
const long ,
const long ,
const bool
) const
{
fill_rect(c, rect, rgb_pixel(212,208,200));

View File

@ -152,7 +152,7 @@ namespace dlib
make_images();
}
button_style_toolbar_icon1( const button_style_toolbar_icon1& item): padding(item.padding)
button_style_toolbar_icon1( const button_style_toolbar_icon1& item): button_style(item), padding(item.padding)
{
assign_image(img_mouseover, item.img_mouseover);
assign_image(img_normal, item.img_normal);
@ -258,8 +258,8 @@ namespace dlib
) const;
virtual rectangle get_min_size (
const ustring& name,
const font& mfont
const ustring& ,
const font&
) const { return rectangle(); }
private:
@ -523,7 +523,7 @@ namespace dlib
virtual void draw_scrollable_region_border (
const canvas& c,
const rectangle& rect,
const bool enabled
const bool
) const { draw_sunken_rectangle(c,rect); }
};
@ -716,7 +716,7 @@ namespace dlib
{}
virtual unsigned long get_padding (
const font& mfont
const font&
) const { return 1; }
virtual void draw_text_box (

View File

@ -2352,8 +2352,8 @@ namespace dlib
void on_keydown (
unsigned long key,
bool is_printable,
unsigned long state
bool ,
unsigned long
)
{
// ignore all keyboard input if the last thing the user clicked on

View File

@ -1521,12 +1521,12 @@ namespace dlib
template <typename U, long iNR, long iNC, typename mm, typename l >
bool aliases (
const matrix<U,iNR,iNC,mm,l>& item
const matrix<U,iNR,iNC,mm,l>&
) const { return false; }
template <typename U, long iNR, long iNC, typename mm, typename l>
bool destructively_aliases (
const matrix<U,iNR,iNC,mm,l>& item
const matrix<U,iNR,iNC,mm,l>&
) const { return false; }
bool aliases (

View File

@ -295,6 +295,11 @@ namespace dlib
}
};
#ifdef __GNUC__
#define DLIB_SHUT_UP_GCC_ABOUT_THIS_UNUSED_VARIABLE __attribute__ ((unused))
#else
#define DLIB_SHUT_UP_GCC_ABOUT_THIS_UNUSED_VARIABLE
#endif
// This is a macro to help us add overloads for the matrix_assign_blas_helper template.
// Using this macro it is easy to add overloads for arbitrary matrix expressions.
#define DLIB_ADD_BLAS_BINDING(src_expression) \
@ -309,7 +314,7 @@ namespace dlib
const src_exp& src, \
typename src_exp::type alpha, \
bool add_to, \
bool transpose \
bool DLIB_SHUT_UP_GCC_ABOUT_THIS_UNUSED_VARIABLE transpose \
) { \
typedef typename dest_exp::type T;

View File

@ -168,8 +168,8 @@ namespace dlib
) const { return num_cols; }
void set_size (
long nr,
long nc
long ,
long
)
{
}
@ -231,8 +231,8 @@ namespace dlib
) const { return num_cols; }
void set_size (
long nr,
long nc
long ,
long
)
{
}
@ -581,8 +581,8 @@ namespace dlib
) const { return num_cols; }
void set_size (
long nr,
long nc
long,
long
)
{
}
@ -644,8 +644,8 @@ namespace dlib
) const { return num_cols; }
void set_size (
long nr,
long nc
long ,
long
)
{
}

View File

@ -827,12 +827,12 @@ namespace dlib
template <typename U, long iNR, long iNC, typename MM, typename L >
bool aliases (
const matrix<U,iNR,iNC,MM,L>& item
const matrix<U,iNR,iNC,MM,L>&
) const { return false; }
template <typename U, long iNR, long iNC , typename MM, typename L>
bool destructively_aliases (
const matrix<U,iNR,iNC,MM,L>& item
const matrix<U,iNR,iNC,MM,L>&
) const { return false; }
long nr (
@ -908,12 +908,12 @@ namespace dlib
template <typename U, long iNR, long iNC, typename MM, typename L >
bool aliases (
const matrix<U,iNR,iNC,MM,L>& item
const matrix<U,iNR,iNC,MM,L>&
) const { return false; }
template <typename U, long iNR, long iNC, typename MM, typename L >
bool destructively_aliases (
const matrix<U,iNR,iNC,MM,L>& item
const matrix<U,iNR,iNC,MM,L>&
) const { return false; }
long nr (
@ -957,7 +957,7 @@ namespace dlib
typedef typename matrix_traits<matrix_zeroary_exp>::layout_type layout_type;
matrix_zeroary_exp (
const matrix_zeroary_exp& item
const matrix_zeroary_exp&
) :
matrix_exp<matrix_zeroary_exp>(*this)
{}
@ -1155,12 +1155,12 @@ namespace dlib
template <typename U, long iNR, long iNC, typename MM, typename L>
bool aliases (
const matrix<U,iNR,iNC,MM,L>& item
const matrix<U,iNR,iNC,MM,L>&
) const { return false; }
template <typename U, long iNR, long iNC , typename MM, typename L>
bool destructively_aliases (
const matrix<U,iNR,iNC,MM,L>& item
const matrix<U,iNR,iNC,MM,L>&
) const { return false; }
long nr (
@ -1321,12 +1321,12 @@ namespace dlib
template <typename U, long iNR, long iNC, typename MM, typename L>
bool aliases (
const matrix<U,iNR,iNC,MM,L>& item
const matrix<U,iNR,iNC,MM,L>&
) const { return false; }
template <typename U, long iNR, long iNC , typename MM, typename L>
bool destructively_aliases (
const matrix<U,iNR,iNC,MM,L>& item
const matrix<U,iNR,iNC,MM,L>&
) const { return false; }
long nr (
@ -1531,12 +1531,12 @@ namespace dlib
template <typename U, long iNR, long iNC , typename MM, typename L>
bool aliases (
const matrix<U,iNR,iNC,MM,L>& item
const matrix<U,iNR,iNC,MM,L>&
) const { return false; }
template <typename U, long iNR, long iNC, typename MM, typename L >
bool destructively_aliases (
const matrix<U,iNR,iNC,MM,L>& item
const matrix<U,iNR,iNC,MM,L>&
) const { return false; }
long nr (
@ -1618,12 +1618,12 @@ namespace dlib
template <typename U, long iNR, long iNC , typename MM, typename L>
bool aliases (
const matrix<U,iNR,iNC,MM,L>& item
const matrix<U,iNR,iNC,MM,L>&
) const { return false; }
template <typename U, long iNR, long iNC, typename MM, typename L >
bool destructively_aliases (
const matrix<U,iNR,iNC,MM,L>& item
const matrix<U,iNR,iNC,MM,L>&
) const { return false; }
long nr (
@ -1667,7 +1667,7 @@ namespace dlib
const static long inc = (start <= end)?inc_:-inc_;
matrix_range_static_exp (
const matrix_range_static_exp& item
const matrix_range_static_exp&
) :
matrix_exp<matrix_range_static_exp>(*this)
{}
@ -1678,7 +1678,7 @@ namespace dlib
{}
long operator() (
long r,
long ,
long c
) const { return start + c*inc; }

View File

@ -176,7 +176,7 @@ namespace dlib
{ return m(row,c); }
template <typename M>
static long nr (const M& m) { return 1; }
static long nr (const M& ) { return 1; }
template <typename M>
static long nc (const M& m) { return m.nc(); }
};
@ -215,13 +215,13 @@ namespace dlib
typedef typename EXP::type type;
typedef typename EXP::mem_manager_type mem_manager_type;
template <typename M>
static type apply ( const M& m, long row, long length, long r, long c)
static type apply ( const M& m, long row, long , long , long c)
{ return m(row,c); }
template <typename M>
static long nr (const M& m, long, long) { return 1; }
static long nr (const M& , long, long) { return 1; }
template <typename M>
static long nc (const M& m, long, long length) { return length; }
static long nc (const M& , long, long length) { return length; }
};
};
@ -266,7 +266,7 @@ namespace dlib
{ return m1(rows(r),c); }
template <typename M1, typename M2>
static long nr (const M1& m1, const M2& rows ) { return rows.size(); }
static long nr (const M1& , const M2& rows ) { return rows.size(); }
template <typename M1, typename M2>
static long nc (const M1& m1, const M2& ) { return m1.nc(); }
};
@ -318,7 +318,7 @@ namespace dlib
template <typename M>
static long nr (const M& m) { return m.nr(); }
template <typename M>
static long nc (const M& m) { return 1; }
static long nc (const M& ) { return 1; }
};
};
@ -355,13 +355,13 @@ namespace dlib
typedef typename EXP::type type;
typedef typename EXP::mem_manager_type mem_manager_type;
template <typename M>
static type apply ( const M& m, long col, long length, long r, long c)
static type apply ( const M& m, long col, long , long r, long )
{ return m(r,col); }
template <typename M>
static long nr (const M& m, long, long length) { return length; }
static long nr (const M&, long, long length) { return length; }
template <typename M>
static long nc (const M& m, long, long) { return 1; }
static long nc (const M&, long, long) { return 1; }
};
};
@ -406,9 +406,9 @@ namespace dlib
{ return m1(r,cols(c)); }
template <typename M1, typename M2>
static long nr (const M1& m1, const M2& cols ) { return m1.nr(); }
static long nr (const M1& m1, const M2& ) { return m1.nr(); }
template <typename M1, typename M2>
static long nc (const M1& m1, const M2& cols ) { return cols.size(); }
static long nc (const M1& , const M2& cols ) { return cols.size(); }
};
};
@ -733,7 +733,7 @@ namespace dlib
T& operator() (
long r,
long c
long
)
{
return m(r,col);
@ -741,7 +741,7 @@ namespace dlib
const T& operator() (
long r,
long c
long
) const
{
return m(r,col);
@ -831,7 +831,7 @@ namespace dlib
T& operator() (
long r,
long ,
long c
)
{
@ -839,7 +839,7 @@ namespace dlib
}
const T& operator() (
long r,
long ,
long c
) const
{

View File

@ -721,13 +721,13 @@ namespace dlib
typedef typename EXP::type type;
typedef typename EXP::mem_manager_type mem_manager_type;
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); }
template <typename M>
static long nr (const M& m) { return std::min(m.nc(),m.nr()); }
template <typename M>
static long nc (const M& m) { return 1; }
static long nc (const M& ) { return 1; }
};
};
@ -1035,7 +1035,7 @@ namespace dlib
const static long NC = 0;
typedef typename memory_manager<char>::kernel_1a mem_manager_type;
typedef T type;
static type apply (const T& val, long r, long c)
static type apply (const T& val, long , long )
{ return val; }
};
@ -1072,7 +1072,7 @@ namespace dlib
const static long NC = NC_;
typedef typename memory_manager<char>::kernel_1a mem_manager_type;
typedef T type;
static type apply (const T& val, long r, long c)
static type apply (const T& val, long , long )
{ return val; }
};
@ -1106,7 +1106,7 @@ namespace dlib
const static long NC = NC_;
typedef typename memory_manager<char>::kernel_1a mem_manager_type;
typedef T type;
static type apply ( long r, long c)
static type apply ( long , long )
{ return val; }
};

View File

@ -79,7 +79,7 @@ namespace dlib
//allocate but don't initialize num elements of type T
pointer allocate (
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));
@ -101,7 +101,7 @@ namespace dlib
}
//deallocate storage p of deleted elements
void deallocate (pointer p, size_type num)
void deallocate (pointer p, size_type )
{
pool.deallocate_array((char*)p);
}

View File

@ -336,7 +336,7 @@ namespace dlib
}
bool operator== (
const linear_kernel& k
const linear_kernel&
) const
{
return true;

View File

@ -288,7 +288,7 @@ namespace dlib
}
bool operator== (
const sparse_linear_kernel& k
const sparse_linear_kernel&
) const
{
return true;

View File

@ -1475,7 +1475,7 @@ namespace dlib
typename scalar_type
>
inline void optimize_working_pair (
const scalar_vector_type2& y,
const scalar_vector_type2& ,
scalar_vector_type& alpha,
const kernel_matrix_cache<K, sample_vector_type, scalar_vector_type2>& Q,
const scalar_vector_type& df,

View File

@ -149,7 +149,7 @@ namespace
for (unsigned long i = 0; i < alphabet_size-1; ++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(high_count == low_count+1);
@ -546,7 +546,7 @@ namespace
{
if(!test.increment_count(i))
oom = true;
unsigned long low_count, high_count, total_count;
unsigned long low_count = 0, high_count = 0, total_count = 0;
if (!oom)
{

View File

@ -263,7 +263,7 @@ class win : public drawable_window
void tab_change (
unsigned long new_idx,
unsigned long old_idx
unsigned long
)
{
tab_label.set_text(tabs.tab_name(new_idx));
@ -298,7 +298,7 @@ class win : public drawable_window
}
void lb_double_click (
unsigned long idx
unsigned long
)
{
dlib::queue<unsigned long>::kernel_2a_c sel;
@ -335,7 +335,7 @@ class win : public drawable_window
}
static void try_this_junk2 (
void* param
void*
)
{

View File

@ -46,7 +46,7 @@ namespace
}
bool operator== (
const unopt_sparse_linear_kernel& k
const unopt_sparse_linear_kernel&
) const
{
return true;
@ -69,7 +69,7 @@ namespace
}
bool operator== (
const unopt_linear_kernel& k
const unopt_linear_kernel&
) const
{
return true;

View File

@ -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 history_size_before = test.get_history_buffer_size();
test.find_match(match_index,match_length,2);

View File

@ -49,7 +49,7 @@ namespace dlib
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));
}