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

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
...@@ -428,32 +428,32 @@ namespace dlib ...@@ -428,32 +428,32 @@ namespace dlib
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
/*!A is_signed_type /*!A is_unsigned_type
This is a template where is_signed_type<T>::value == true when T is a signed This is a template where is_unsigned_type<T>::value == true when T is an unsigned
integral type and false when T is an unsigned integral type. integral type and false when T is a signed integral type.
!*/ !*/
template < template <
typename T typename T
> >
struct is_signed_type struct is_unsigned_type
{ {
static const bool value = static_cast<T>((static_cast<T>(0)-static_cast<T>(1))) < 0; static const bool value = static_cast<T>((static_cast<T>(0)-static_cast<T>(1))) > 0;
}; };
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
/*!A is_unsigned_type /*!A is_signed_type
This is a template where is_unsigned_type<T>::value == true when T is an unsigned This is a template where is_signed_type<T>::value == true when T is a signed
integral type and false when T is a signed integral type. integral type and false when T is an unsigned integral type.
!*/ !*/
template < template <
typename T typename T
> >
struct is_unsigned_type struct is_signed_type
{ {
static const bool value = static_cast<T>((static_cast<T>(0)-static_cast<T>(1))) > 0; static const bool value = !is_unsigned_type<T>::value;
}; };
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -182,8 +182,8 @@ namespace dlib ...@@ -182,8 +182,8 @@ namespace dlib
{ {
static void check_operator_bracket_precondition (const cr_type&, const std::string& ) {} 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_block_precondition (const cr_type&, const std::string& ) {}
static void check_current_block_name_precondition (const cr_type& cr) {} static void check_current_block_name_precondition (const cr_type& ) {}
static void check_element_precondition (const cr_type& cr) {} static void check_element_precondition (const cr_type& ) {}
}; };
template <typename cr_type> template <typename cr_type>
......
...@@ -146,8 +146,8 @@ namespace dlib ...@@ -146,8 +146,8 @@ namespace dlib
struct helper<cr_type,false> struct helper<cr_type,false>
{ {
static void check_block_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_current_block_name_precondition (const cr_type& ) {}
static void check_element_precondition (const cr_type& cr) {} static void check_element_precondition (const cr_type& ) {}
}; };
template <typename cr_type> template <typename cr_type>
......
...@@ -191,15 +191,15 @@ namespace dlib ...@@ -191,15 +191,15 @@ namespace dlib
template <typename node_type, typename directed_graph> template <typename node_type, typename directed_graph>
struct directed_graph_checker_helper <node_type, directed_graph, false> 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_parent ( unsigned long , const node_type&) { }
static inline void check_child ( unsigned long edge_index, const node_type& self) { } static inline void check_child ( unsigned long , const node_type& ) { }
static inline void check_parent_edge ( unsigned long edge_index, const node_type& self) { } static inline void check_parent_edge ( unsigned long , const node_type&) { }
static inline void check_child_edge ( unsigned long edge_index, const node_type& self) { } static inline void check_child_edge ( unsigned long , const node_type& ) { }
static inline void check_node ( unsigned long index, const directed_graph& self) { } 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_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_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_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& ) { }
}; };
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -240,11 +240,8 @@ namespace dlib ...@@ -240,11 +240,8 @@ namespace dlib
vector ( vector (
const vector& item const vector& item
) ) : matrix<T,3,1>(item)
{ {
x() = item.x();
y() = item.y();
z() = item.z();
} }
// --------------------------------------- // ---------------------------------------
...@@ -652,10 +649,8 @@ namespace dlib ...@@ -652,10 +649,8 @@ namespace dlib
vector ( vector (
const vector& item const vector& item
) ) : matrix<T,2,1>(item)
{ {
x() = item.x();
y() = item.y();
} }
// --------------------------------------- // ---------------------------------------
......
...@@ -161,13 +161,13 @@ namespace dlib ...@@ -161,13 +161,13 @@ namespace dlib
template <typename node_type, typename graph> template <typename node_type, typename graph>
struct graph_checker_helper <node_type, graph, false> 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_edge ( unsigned long , const node_type& ) { }
static inline void check_neighbor ( unsigned long edge_index, const node_type& self) { } static inline void check_neighbor ( unsigned long , const node_type& ) { }
static inline void check_node ( unsigned long index, const graph& self) { } 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_has_edge ( unsigned long , unsigned long , const graph& ) { }
static inline void check_add_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_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& ) { }
}; };
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -328,7 +328,7 @@ namespace dlib ...@@ -328,7 +328,7 @@ namespace dlib
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Bool XCheckIfEventPredicate ( Bool XCheckIfEventPredicate (
Display* disp, Display* ,
XEvent* event, XEvent* event,
XPointer arg XPointer arg
) )
...@@ -356,8 +356,8 @@ namespace dlib ...@@ -356,8 +356,8 @@ namespace dlib
static bool map_keys ( static bool map_keys (
KeySym keycode, KeySym keycode,
bool shift, bool ,
bool caps, bool ,
unsigned long& result, unsigned long& result,
bool& is_printable bool& is_printable
) )
...@@ -1359,9 +1359,9 @@ namespace dlib ...@@ -1359,9 +1359,9 @@ namespace dlib
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
Bool clip_peek_helper ( Bool clip_peek_helper (
Display *display, Display*,
XEvent *event, XEvent* event,
XPointer arg XPointer
) )
{ {
if ( event->type == SelectionNotify) if ( event->type == SelectionNotify)
......
...@@ -334,29 +334,29 @@ namespace dlib ...@@ -334,29 +334,29 @@ namespace dlib
virtual void on_window_moved( virtual void on_window_moved(
){} ){}
virtual void on_user_event ( virtual void on_user_event (
void* p, void* ,
int i int
){} ){}
virtual void on_mouse_down ( virtual void on_mouse_down (
unsigned long btn, unsigned long ,
unsigned long state, unsigned long ,
long x, long ,
long y, long ,
bool is_double_click bool
){} ){}
virtual void on_mouse_up ( virtual void on_mouse_up (
unsigned long btn, unsigned long ,
unsigned long state, unsigned long ,
long x, long ,
long y long
){} ){}
virtual void on_mouse_move ( virtual void on_mouse_move (
unsigned long state, unsigned long ,
long x, long ,
long y long
){} ){}
virtual void on_mouse_leave ( virtual void on_mouse_leave (
...@@ -366,11 +366,11 @@ namespace dlib ...@@ -366,11 +366,11 @@ namespace dlib
){} ){}
virtual void on_wheel_up ( virtual void on_wheel_up (
unsigned long state unsigned long
){} ){}
virtual void on_wheel_down ( virtual void on_wheel_down (
unsigned long state unsigned long
){} ){}
virtual void on_focus_gained ( virtual void on_focus_gained (
...@@ -380,13 +380,13 @@ namespace dlib ...@@ -380,13 +380,13 @@ namespace dlib
){} ){}
virtual void on_keydown ( virtual void on_keydown (
unsigned long key, unsigned long ,
bool is_printable, bool ,
unsigned long state unsigned long
){} ){}
virtual void on_string_put ( virtual void on_string_put (
const std::wstring &str const std::wstring&
){} ){}
private: private:
......
...@@ -328,10 +328,10 @@ namespace dlib ...@@ -328,10 +328,10 @@ namespace dlib
void draggable:: void draggable::
on_mouse_up ( on_mouse_up (
unsigned long btn, unsigned long ,
unsigned long state, unsigned long state,
long x, long ,
long y long
) )
{ {
if (drag && (state & base_window::LEFT) == 0) if (drag && (state & base_window::LEFT) == 0)
...@@ -385,7 +385,7 @@ namespace dlib ...@@ -385,7 +385,7 @@ namespace dlib
void mouse_over_event:: void mouse_over_event::
on_mouse_move ( on_mouse_move (
unsigned long state, unsigned long ,
long x, long x,
long y long y
) )
...@@ -1826,7 +1826,7 @@ namespace dlib ...@@ -1826,7 +1826,7 @@ namespace dlib
void popup_menu:: void popup_menu::
on_mouse_move ( on_mouse_move (
unsigned long state, unsigned long ,
long x, long x,
long y long y
) )
...@@ -2259,7 +2259,7 @@ namespace dlib ...@@ -2259,7 +2259,7 @@ namespace dlib
void zoomable_region:: void zoomable_region::
on_wheel_down ( on_wheel_down (
unsigned long state unsigned long
) )
{ {
// zoom out // zoom out
...@@ -2279,7 +2279,7 @@ namespace dlib ...@@ -2279,7 +2279,7 @@ namespace dlib
void zoomable_region:: void zoomable_region::
on_wheel_up ( on_wheel_up (
unsigned long state unsigned long
) )
{ {
// zoom in // zoom in
...@@ -2321,10 +2321,10 @@ namespace dlib ...@@ -2321,10 +2321,10 @@ namespace dlib
void zoomable_region:: void zoomable_region::
on_mouse_up ( on_mouse_up (
unsigned long btn, unsigned long ,
unsigned long state, unsigned long ,
long x, long ,
long y long
) )
{ {
mouse_drag_screen = false; mouse_drag_screen = false;
...@@ -2335,10 +2335,10 @@ namespace dlib ...@@ -2335,10 +2335,10 @@ namespace dlib
void zoomable_region:: void zoomable_region::
on_mouse_down ( on_mouse_down (
unsigned long btn, unsigned long btn,
unsigned long state, unsigned long ,
long x, long x,
long y, long y,
bool is_double_click bool
) )
{ {
if (enabled && !hidden && display_rect_.contains(x,y) && btn == base_window::LEFT) if (enabled && !hidden && display_rect_.contains(x,y) && btn == base_window::LEFT)
...@@ -2919,7 +2919,7 @@ namespace dlib ...@@ -2919,7 +2919,7 @@ namespace dlib
void scrollable_region:: void scrollable_region::
on_wheel_down ( on_wheel_down (
unsigned long state unsigned long
) )
{ {
if (rect.contains(lastx,lasty) && enabled && !hidden) if (rect.contains(lastx,lasty) && enabled && !hidden)
...@@ -2966,10 +2966,10 @@ namespace dlib ...@@ -2966,10 +2966,10 @@ namespace dlib
void scrollable_region:: void scrollable_region::
on_mouse_down ( on_mouse_down (
unsigned long btn, unsigned long btn,
unsigned long state, unsigned long ,
long x, long x,
long y, long y,
bool is_double_click bool
) )
{ {
if (mouse_drag_enabled_ && enabled && !hidden && display_rect().contains(x,y) && (btn==base_window::LEFT)) if (mouse_drag_enabled_ && enabled && !hidden && display_rect().contains(x,y) && (btn==base_window::LEFT))
...@@ -2987,10 +2987,10 @@ namespace dlib ...@@ -2987,10 +2987,10 @@ namespace dlib
void scrollable_region:: void scrollable_region::
on_mouse_up ( on_mouse_up (
unsigned long btn, unsigned long ,
unsigned long state, unsigned long ,
long x, long ,
long y long
) )
{ {
user_is_dragging_mouse = false; user_is_dragging_mouse = false;
...@@ -3000,7 +3000,7 @@ namespace dlib ...@@ -3000,7 +3000,7 @@ namespace dlib
void scrollable_region:: void scrollable_region::
on_wheel_up ( on_wheel_up (
unsigned long state unsigned long
) )
{ {
if (rect.contains(lastx,lasty) && enabled && !hidden) if (rect.contains(lastx,lasty) && enabled && !hidden)
...@@ -3256,10 +3256,10 @@ namespace dlib ...@@ -3256,10 +3256,10 @@ namespace dlib
void popup_menu_region:: void popup_menu_region::
on_mouse_down ( on_mouse_down (
unsigned long btn, unsigned long btn,
unsigned long state, unsigned long ,
long x, long x,
long y, long y,
bool is_double_click bool
) )
{ {
if (enabled && !hidden && rect.contains(x,y) && btn == base_window::RIGHT) if (enabled && !hidden && rect.contains(x,y) && btn == base_window::RIGHT)
......
...@@ -230,7 +230,7 @@ namespace dlib ...@@ -230,7 +230,7 @@ namespace dlib
){} ){}
virtual void on_button_up ( virtual void on_button_up (
bool mouse_over bool
){} ){}
void on_mouse_not_over ( void on_mouse_not_over (
...@@ -358,7 +358,7 @@ namespace dlib ...@@ -358,7 +358,7 @@ namespace dlib
// this object doesn't draw anything but also isn't abstract // this object doesn't draw anything but also isn't abstract
void draw ( void draw (
const canvas& c const canvas&
) const {} ) const {}
private: private:
...@@ -1389,31 +1389,31 @@ namespace dlib ...@@ -1389,31 +1389,31 @@ namespace dlib
) const { return 0; } ) const { return 0; }
virtual void draw_background ( virtual void draw_background (
const canvas& c, const canvas& ,
const rectangle& rect, const rectangle& ,
const bool enabled, const bool ,
const bool is_selected const bool
) const {} ) const {}
virtual void draw_left ( virtual void draw_left (
const canvas& c, const canvas& ,
const rectangle& rect, const rectangle& ,
const bool enabled, const bool ,
const bool is_selected const bool
) const {} ) const {}
virtual void draw_middle ( virtual void draw_middle (
const canvas& c, const canvas& ,
const rectangle& rect, const rectangle& ,
const bool enabled, const bool ,
const bool is_selected const bool
) const = 0; ) const = 0;
virtual void draw_right ( virtual void draw_right (
const canvas& c, const canvas& ,
const rectangle& rect, const rectangle& ,
const bool enabled, const bool ,
const bool is_selected const bool
) const {} ) const {}
virtual void on_click ( virtual void on_click (
...@@ -1521,7 +1521,7 @@ namespace dlib ...@@ -1521,7 +1521,7 @@ namespace dlib
const canvas& c, const canvas& c,
const rectangle& rect, const rectangle& rect,
const bool enabled, const bool enabled,
const bool is_selected const bool
) const ) const
{ {
if (c.intersect(rect).is_empty()) if (c.intersect(rect).is_empty())
...@@ -1544,7 +1544,7 @@ namespace dlib ...@@ -1544,7 +1544,7 @@ namespace dlib
const canvas& c, const canvas& c,
const rectangle& rect, const rectangle& rect,
const bool enabled, const bool enabled,
const bool is_selected const bool
) const ) const
{ {
if (c.intersect(rect).is_empty()) if (c.intersect(rect).is_empty())
...@@ -1681,7 +1681,7 @@ namespace dlib ...@@ -1681,7 +1681,7 @@ namespace dlib
const canvas& c, const canvas& c,
const rectangle& rect, const rectangle& rect,
const bool enabled, const bool enabled,
const bool is_selected const bool
) const ) const
{ {
if (c.intersect(rect).is_empty()) if (c.intersect(rect).is_empty())
...@@ -1733,8 +1733,8 @@ namespace dlib ...@@ -1733,8 +1733,8 @@ namespace dlib
virtual void draw_background ( virtual void draw_background (
const canvas& c, const canvas& c,
const rectangle& rect, const rectangle& rect,
const bool enabled, const bool ,
const bool is_selected const bool
) const ) const
{ {
if (c.intersect(rect).is_empty()) if (c.intersect(rect).is_empty())
...@@ -1750,10 +1750,10 @@ namespace dlib ...@@ -1750,10 +1750,10 @@ namespace dlib
} }
virtual void draw_middle ( virtual void draw_middle (
const canvas& c, const canvas& ,
const rectangle& rect, const rectangle& ,
const bool enabled, const bool ,
const bool is_selected const bool
) const ) const
{ {
} }
......
...@@ -452,7 +452,7 @@ namespace dlib ...@@ -452,7 +452,7 @@ namespace dlib
) const=0; ) const=0;
virtual void on_user_event ( virtual void on_user_event (
int i int
){} ){}
virtual void on_window_resized( virtual void on_window_resized(
...@@ -462,24 +462,24 @@ namespace dlib ...@@ -462,24 +462,24 @@ namespace dlib
){} ){}
virtual void on_mouse_down ( virtual void on_mouse_down (
unsigned long btn, unsigned long ,
unsigned long state, unsigned long ,
long x, long ,
long y, long ,
bool is_double_click bool
){} ){}
virtual void on_mouse_up ( virtual void on_mouse_up (
unsigned long btn, unsigned long ,
unsigned long state, unsigned long ,
long x, long ,
long y long
){} ){}
virtual void on_mouse_move ( virtual void on_mouse_move (
unsigned long state, unsigned long ,
long x, long ,
long y long
){} ){}
virtual void on_mouse_leave ( virtual void on_mouse_leave (
...@@ -489,11 +489,11 @@ namespace dlib ...@@ -489,11 +489,11 @@ namespace dlib
){} ){}
virtual void on_wheel_up ( virtual void on_wheel_up (
unsigned long state unsigned long
){} ){}
virtual void on_wheel_down ( virtual void on_wheel_down (
unsigned long state unsigned long
){} ){}
virtual void on_focus_gained ( virtual void on_focus_gained (
...@@ -503,13 +503,13 @@ namespace dlib ...@@ -503,13 +503,13 @@ namespace dlib
){} ){}
virtual void on_keydown ( virtual void on_keydown (
unsigned long key, unsigned long ,
bool is_printable, bool ,
unsigned long state unsigned long
){} ){}
virtual void on_string_put ( virtual void on_string_put (
const std::wstring &str const std::wstring&
){} ){}
}; };
......
...@@ -459,7 +459,7 @@ namespace nativefont ...@@ -459,7 +459,7 @@ namespace nativefont
}; };
struct image_size_setter{ struct image_size_setter{
void operator()(int &width, int &height){ void operator()(int&, int&){
} }
}; };
......
...@@ -19,8 +19,8 @@ namespace dlib ...@@ -19,8 +19,8 @@ namespace dlib
const rectangle& rect, const rectangle& rect,
const bool enabled, const bool enabled,
const font& mfont, const font& mfont,
const long lastx, const long ,
const long lasty, const long ,
const ustring& name, const ustring& name,
const bool is_depressed const bool is_depressed
) const ) const
...@@ -214,10 +214,10 @@ namespace dlib ...@@ -214,10 +214,10 @@ namespace dlib
const canvas& c, const canvas& c,
const rectangle& rect, const rectangle& rect,
const bool enabled, const bool enabled,
const font& mfont, const font& ,
const long lastx, const long lastx,
const long lasty, const long lasty,
const ustring& name, const ustring& ,
const bool is_depressed const bool is_depressed
) const ) const
{ {
...@@ -274,8 +274,8 @@ namespace dlib ...@@ -274,8 +274,8 @@ namespace dlib
rectangle button_style_toolbar_icon1:: rectangle button_style_toolbar_icon1::
get_min_size ( get_min_size (
const ustring& name, const ustring& ,
const font& mfont const font&
) const ) const
{ {
return rectangle(img_normal.nc()+2*padding, img_normal.nr()+2*padding); return rectangle(img_normal.nc()+2*padding, img_normal.nr()+2*padding);
...@@ -290,10 +290,10 @@ namespace dlib ...@@ -290,10 +290,10 @@ namespace dlib
const canvas& c, const canvas& c,
const rectangle& rect, const rectangle& rect,
const bool enabled, const bool enabled,
const font& mfont, const font& ,
const long lastx, const long ,
const long lasty, const long ,
const ustring& name, const ustring& ,
const bool is_depressed const bool is_depressed
) const ) const
{ {
...@@ -411,8 +411,8 @@ namespace dlib ...@@ -411,8 +411,8 @@ namespace dlib
const rectangle& rect, const rectangle& rect,
const bool enabled, const bool enabled,
const font& mfont, const font& mfont,
const long lastx, const long ,
const long lasty, const long ,
const ustring& name, const ustring& name,
const bool is_depressed, const bool is_depressed,
const bool is_checked const bool is_checked
...@@ -501,8 +501,8 @@ namespace dlib ...@@ -501,8 +501,8 @@ namespace dlib
const rectangle& rect, const rectangle& rect,
const bool enabled, const bool enabled,
const font& mfont, const font& mfont,
const long lastx, const long ,
const long lasty, const long ,
const ustring& name, const ustring& name,
const bool is_depressed, const bool is_depressed,
const bool is_checked const bool is_checked
...@@ -593,8 +593,8 @@ namespace dlib ...@@ -593,8 +593,8 @@ namespace dlib
const rectangle& rect, const rectangle& rect,
const bool enabled, const bool enabled,
const font& mfont, const font& mfont,
const long lastx, const long ,
const long lasty, const long ,
const ustring& name, const ustring& name,
const bool is_depressed, const bool is_depressed,
const bool is_checked const bool is_checked
...@@ -745,7 +745,7 @@ namespace dlib ...@@ -745,7 +745,7 @@ namespace dlib
long scroll_bar_style_default:: long scroll_bar_style_default::
get_button_length ( get_button_length (
long total_length, long total_length,
long max_pos long
) const ) const
{ {
// if the length is too small then we have to smash up the arrow buttons // if the length is too small then we have to smash up the arrow buttons
...@@ -766,9 +766,9 @@ namespace dlib ...@@ -766,9 +766,9 @@ namespace dlib
draw_scroll_bar_background ( draw_scroll_bar_background (
const canvas& c, const canvas& c,
const rectangle& rect, const rectangle& rect,
const bool enabled, const bool ,
const long lastx, const long ,
const long lasty, const long ,
const bool is_depressed const bool is_depressed
) const ) const
{ {
...@@ -784,10 +784,10 @@ namespace dlib ...@@ -784,10 +784,10 @@ namespace dlib
draw_scroll_bar_slider ( draw_scroll_bar_slider (
const canvas& c, const canvas& c,
const rectangle& rect, const rectangle& rect,
const bool enabled, const bool ,
const long lastx, const long ,
const long lasty, const long ,
const bool is_being_dragged const bool
) const ) const
{ {
fill_rect(c, rect, rgb_pixel(212,208,200)); fill_rect(c, rect, rgb_pixel(212,208,200));
......
...@@ -152,7 +152,7 @@ namespace dlib ...@@ -152,7 +152,7 @@ namespace dlib
make_images(); 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_mouseover, item.img_mouseover);
assign_image(img_normal, item.img_normal); assign_image(img_normal, item.img_normal);
...@@ -258,8 +258,8 @@ namespace dlib ...@@ -258,8 +258,8 @@ namespace dlib
) const; ) const;
virtual rectangle get_min_size ( virtual rectangle get_min_size (
const ustring& name, const ustring& ,
const font& mfont const font&
) const { return rectangle(); } ) const { return rectangle(); }
private: private:
...@@ -523,7 +523,7 @@ namespace dlib ...@@ -523,7 +523,7 @@ namespace dlib
virtual void draw_scrollable_region_border ( virtual void draw_scrollable_region_border (
const canvas& c, const canvas& c,
const rectangle& rect, const rectangle& rect,
const bool enabled const bool
) const { draw_sunken_rectangle(c,rect); } ) const { draw_sunken_rectangle(c,rect); }
}; };
...@@ -716,7 +716,7 @@ namespace dlib ...@@ -716,7 +716,7 @@ namespace dlib
{} {}
virtual unsigned long get_padding ( virtual unsigned long get_padding (
const font& mfont const font&
) const { return 1; } ) const { return 1; }
virtual void draw_text_box ( virtual void draw_text_box (
......
...@@ -2352,8 +2352,8 @@ namespace dlib ...@@ -2352,8 +2352,8 @@ namespace dlib
void on_keydown ( void on_keydown (
unsigned long key, unsigned long key,
bool is_printable, bool ,
unsigned long state unsigned long
) )
{ {
// ignore all keyboard input if the last thing the user clicked on // ignore all keyboard input if the last thing the user clicked on
......
...@@ -1521,12 +1521,12 @@ namespace dlib ...@@ -1521,12 +1521,12 @@ namespace dlib
template <typename U, long iNR, long iNC, typename mm, typename l > template <typename U, long iNR, long iNC, typename mm, typename l >
bool aliases ( bool aliases (
const matrix<U,iNR,iNC,mm,l>& item const matrix<U,iNR,iNC,mm,l>&
) const { return false; } ) const { return false; }
template <typename U, long iNR, long iNC, typename mm, typename l> template <typename U, long iNR, long iNC, typename mm, typename l>
bool destructively_aliases ( bool destructively_aliases (
const matrix<U,iNR,iNC,mm,l>& item const matrix<U,iNR,iNC,mm,l>&
) const { return false; } ) const { return false; }
bool aliases ( bool aliases (
......
...@@ -295,6 +295,11 @@ namespace dlib ...@@ -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. // 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. // Using this macro it is easy to add overloads for arbitrary matrix expressions.
#define DLIB_ADD_BLAS_BINDING(src_expression) \ #define DLIB_ADD_BLAS_BINDING(src_expression) \
...@@ -309,7 +314,7 @@ namespace dlib ...@@ -309,7 +314,7 @@ namespace dlib
const src_exp& src, \ const src_exp& src, \
typename src_exp::type alpha, \ typename src_exp::type alpha, \
bool add_to, \ bool add_to, \
bool transpose \ bool DLIB_SHUT_UP_GCC_ABOUT_THIS_UNUSED_VARIABLE transpose \
) { \ ) { \
typedef typename dest_exp::type T; typedef typename dest_exp::type T;
......
...@@ -168,8 +168,8 @@ namespace dlib ...@@ -168,8 +168,8 @@ namespace dlib
) const { return num_cols; } ) const { return num_cols; }
void set_size ( void set_size (
long nr, long ,
long nc long
) )
{ {
} }
...@@ -231,8 +231,8 @@ namespace dlib ...@@ -231,8 +231,8 @@ namespace dlib
) const { return num_cols; } ) const { return num_cols; }
void set_size ( void set_size (
long nr, long ,
long nc long
) )
{ {
} }
...@@ -581,8 +581,8 @@ namespace dlib ...@@ -581,8 +581,8 @@ namespace dlib
) const { return num_cols; } ) const { return num_cols; }
void set_size ( void set_size (
long nr, long,
long nc long
) )
{ {
} }
...@@ -644,8 +644,8 @@ namespace dlib ...@@ -644,8 +644,8 @@ namespace dlib
) const { return num_cols; } ) const { return num_cols; }
void set_size ( void set_size (
long nr, long ,
long nc long
) )
{ {
} }
......
...@@ -827,12 +827,12 @@ namespace dlib ...@@ -827,12 +827,12 @@ namespace dlib
template <typename U, long iNR, long iNC, typename MM, typename L > template <typename U, long iNR, long iNC, typename MM, typename L >
bool aliases ( bool aliases (
const matrix<U,iNR,iNC,MM,L>& item const matrix<U,iNR,iNC,MM,L>&
) const { return false; } ) const { return false; }
template <typename U, long iNR, long iNC , typename MM, typename L> template <typename U, long iNR, long iNC , typename MM, typename L>
bool destructively_aliases ( bool destructively_aliases (
const matrix<U,iNR,iNC,MM,L>& item const matrix<U,iNR,iNC,MM,L>&
) const { return false; } ) const { return false; }
long nr ( long nr (
...@@ -908,12 +908,12 @@ namespace dlib ...@@ -908,12 +908,12 @@ namespace dlib
template <typename U, long iNR, long iNC, typename MM, typename L > template <typename U, long iNR, long iNC, typename MM, typename L >
bool aliases ( bool aliases (
const matrix<U,iNR,iNC,MM,L>& item const matrix<U,iNR,iNC,MM,L>&
) const { return false; } ) const { return false; }
template <typename U, long iNR, long iNC, typename MM, typename L > template <typename U, long iNR, long iNC, typename MM, typename L >
bool destructively_aliases ( bool destructively_aliases (
const matrix<U,iNR,iNC,MM,L>& item const matrix<U,iNR,iNC,MM,L>&
) const { return false; } ) const { return false; }
long nr ( long nr (
...@@ -957,7 +957,7 @@ namespace dlib ...@@ -957,7 +957,7 @@ namespace dlib
typedef typename matrix_traits<matrix_zeroary_exp>::layout_type layout_type; typedef typename matrix_traits<matrix_zeroary_exp>::layout_type layout_type;
matrix_zeroary_exp ( matrix_zeroary_exp (
const matrix_zeroary_exp& item const matrix_zeroary_exp&
) : ) :
matrix_exp<matrix_zeroary_exp>(*this) matrix_exp<matrix_zeroary_exp>(*this)
{} {}
...@@ -1155,12 +1155,12 @@ namespace dlib ...@@ -1155,12 +1155,12 @@ namespace dlib
template <typename U, long iNR, long iNC, typename MM, typename L> template <typename U, long iNR, long iNC, typename MM, typename L>
bool aliases ( bool aliases (
const matrix<U,iNR,iNC,MM,L>& item const matrix<U,iNR,iNC,MM,L>&
) const { return false; } ) const { return false; }
template <typename U, long iNR, long iNC , typename MM, typename L> template <typename U, long iNR, long iNC , typename MM, typename L>
bool destructively_aliases ( bool destructively_aliases (
const matrix<U,iNR,iNC,MM,L>& item const matrix<U,iNR,iNC,MM,L>&
) const { return false; } ) const { return false; }
long nr ( long nr (
...@@ -1321,12 +1321,12 @@ namespace dlib ...@@ -1321,12 +1321,12 @@ namespace dlib
template <typename U, long iNR, long iNC, typename MM, typename L> template <typename U, long iNR, long iNC, typename MM, typename L>
bool aliases ( bool aliases (
const matrix<U,iNR,iNC,MM,L>& item const matrix<U,iNR,iNC,MM,L>&
) const { return false; } ) const { return false; }
template <typename U, long iNR, long iNC , typename MM, typename L> template <typename U, long iNR, long iNC , typename MM, typename L>
bool destructively_aliases ( bool destructively_aliases (
const matrix<U,iNR,iNC,MM,L>& item const matrix<U,iNR,iNC,MM,L>&
) const { return false; } ) const { return false; }
long nr ( long nr (
...@@ -1531,12 +1531,12 @@ namespace dlib ...@@ -1531,12 +1531,12 @@ namespace dlib
template <typename U, long iNR, long iNC , typename MM, typename L> template <typename U, long iNR, long iNC , typename MM, typename L>
bool aliases ( bool aliases (
const matrix<U,iNR,iNC,MM,L>& item const matrix<U,iNR,iNC,MM,L>&
) const { return false; } ) const { return false; }
template <typename U, long iNR, long iNC, typename MM, typename L > template <typename U, long iNR, long iNC, typename MM, typename L >
bool destructively_aliases ( bool destructively_aliases (
const matrix<U,iNR,iNC,MM,L>& item const matrix<U,iNR,iNC,MM,L>&
) const { return false; } ) const { return false; }
long nr ( long nr (
...@@ -1618,12 +1618,12 @@ namespace dlib ...@@ -1618,12 +1618,12 @@ namespace dlib
template <typename U, long iNR, long iNC , typename MM, typename L> template <typename U, long iNR, long iNC , typename MM, typename L>
bool aliases ( bool aliases (
const matrix<U,iNR,iNC,MM,L>& item const matrix<U,iNR,iNC,MM,L>&
) const { return false; } ) const { return false; }
template <typename U, long iNR, long iNC, typename MM, typename L > template <typename U, long iNR, long iNC, typename MM, typename L >
bool destructively_aliases ( bool destructively_aliases (
const matrix<U,iNR,iNC,MM,L>& item const matrix<U,iNR,iNC,MM,L>&
) const { return false; } ) const { return false; }
long nr ( long nr (
...@@ -1667,7 +1667,7 @@ namespace dlib ...@@ -1667,7 +1667,7 @@ namespace dlib
const static long inc = (start <= end)?inc_:-inc_; const static long inc = (start <= end)?inc_:-inc_;
matrix_range_static_exp ( matrix_range_static_exp (
const matrix_range_static_exp& item const matrix_range_static_exp&
) : ) :
matrix_exp<matrix_range_static_exp>(*this) matrix_exp<matrix_range_static_exp>(*this)
{} {}
...@@ -1678,7 +1678,7 @@ namespace dlib ...@@ -1678,7 +1678,7 @@ namespace dlib
{} {}
long operator() ( long operator() (
long r, long ,
long c long c
) const { return start + c*inc; } ) const { return start + c*inc; }
......
...@@ -176,7 +176,7 @@ namespace dlib ...@@ -176,7 +176,7 @@ namespace dlib
{ return m(row,c); } { return m(row,c); }
template <typename M> template <typename M>
static long nr (const M& m) { return 1; } static long nr (const M& ) { return 1; }
template <typename M> template <typename M>
static long nc (const M& m) { return m.nc(); } static long nc (const M& m) { return m.nc(); }
}; };
...@@ -215,13 +215,13 @@ namespace dlib ...@@ -215,13 +215,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 row, long length, long r, long c) static type apply ( const M& m, long row, long , long , long c)
{ return m(row,c); } { return m(row,c); }
template <typename M> 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> 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 ...@@ -266,7 +266,7 @@ namespace dlib
{ return m1(rows(r),c); } { return m1(rows(r),c); }
template <typename M1, typename M2> 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> template <typename M1, typename M2>
static long nc (const M1& m1, const M2& ) { return m1.nc(); } static long nc (const M1& m1, const M2& ) { return m1.nc(); }
}; };
...@@ -318,7 +318,7 @@ namespace dlib ...@@ -318,7 +318,7 @@ namespace dlib
template <typename M> template <typename M>
static long nr (const M& m) { return m.nr(); } static long nr (const M& m) { return m.nr(); }
template <typename M> template <typename M>
static long nc (const M& m) { return 1; } static long nc (const M& ) { return 1; }
}; };
}; };
...@@ -355,13 +355,13 @@ namespace dlib ...@@ -355,13 +355,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 col, long length, long r, long c) static type apply ( const M& m, long col, long , long r, long )
{ return m(r,col); } { return m(r,col); }
template <typename M> 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> 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 ...@@ -406,9 +406,9 @@ namespace dlib
{ return m1(r,cols(c)); } { return m1(r,cols(c)); }
template <typename M1, typename M2> 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> 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 ...@@ -733,7 +733,7 @@ namespace dlib
T& operator() ( T& operator() (
long r, long r,
long c long
) )
{ {
return m(r,col); return m(r,col);
...@@ -741,7 +741,7 @@ namespace dlib ...@@ -741,7 +741,7 @@ namespace dlib
const T& operator() ( const T& operator() (
long r, long r,
long c long
) const ) const
{ {
return m(r,col); return m(r,col);
...@@ -831,7 +831,7 @@ namespace dlib ...@@ -831,7 +831,7 @@ namespace dlib
T& operator() ( T& operator() (
long r, long ,
long c long c
) )
{ {
...@@ -839,7 +839,7 @@ namespace dlib ...@@ -839,7 +839,7 @@ namespace dlib
} }
const T& operator() ( const T& operator() (
long r, long ,
long c long c
) const ) const
{ {
......
...@@ -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