Commit 2376f339 authored by Davis King's avatar Davis King

Fixed a bunch of compiler warnings and errors in the

Intel compiler.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402546
parent 95ece26f
...@@ -69,11 +69,11 @@ namespace std ...@@ -69,11 +69,11 @@ namespace std
/*!A _dT !*/ /*!A _dT !*/
template <typename charT> template <typename charT>
inline const charT _dTcast (const char a, const wchar_t b); inline charT _dTcast (const char a, const wchar_t b);
template <> template <>
inline const char _dTcast<char> (const char a, const wchar_t ) { return a; } inline char _dTcast<char> (const char a, const wchar_t ) { return a; }
template <> template <>
inline const wchar_t _dTcast<wchar_t> (const char , const wchar_t b) { return b; } inline wchar_t _dTcast<wchar_t> (const char , const wchar_t b) { return b; }
template <typename charT> template <typename charT>
inline const charT* _dTcast ( const char* a, const wchar_t* b); inline const charT* _dTcast ( const char* a, const wchar_t* b);
......
...@@ -341,7 +341,7 @@ namespace dlib ...@@ -341,7 +341,7 @@ namespace dlib
} }
} }
const double probability ( double probability (
const assignment& a const assignment& a
) const ) const
{ {
...@@ -851,7 +851,7 @@ namespace dlib ...@@ -851,7 +851,7 @@ namespace dlib
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
template <typename T> template <typename T>
const double node_probability ( double node_probability (
const T& bn, const T& bn,
unsigned long n, unsigned long n,
unsigned long value, unsigned long value,
...@@ -1166,7 +1166,7 @@ namespace dlib ...@@ -1166,7 +1166,7 @@ namespace dlib
template < template <
typename T typename T
> >
const double node_probability ( double node_probability (
const T& bn, const T& bn,
unsigned long n unsigned long n
) )
......
...@@ -79,6 +79,12 @@ namespace dlib ...@@ -79,6 +79,12 @@ namespace dlib
class decompression_error : public dlib::error class decompression_error : public dlib::error
{ {
public: public:
decompression_error(
const char* i
) :
dlib::error(std::string(i))
{}
decompression_error( decompression_error(
const std::string& i const std::string& i
) : ) :
......
...@@ -46,6 +46,12 @@ namespace dlib ...@@ -46,6 +46,12 @@ namespace dlib
class decompression_error : public dlib::error class decompression_error : public dlib::error
{ {
public: public:
decompression_error(
const char* i
) :
dlib::error(std::string(i))
{}
decompression_error( decompression_error(
const std::string& i const std::string& i
) : ) :
......
...@@ -146,7 +146,7 @@ namespace dlib ...@@ -146,7 +146,7 @@ namespace dlib
typename enable_if<is_directed_graph<typename T::graph_type>,bool>::type search_for_undirected_cycles ( typename enable_if<is_directed_graph<typename T::graph_type>,bool>::type search_for_undirected_cycles (
const T& node, const T& node,
std::vector<bool>& visited, std::vector<bool>& visited,
unsigned long prev = -1 unsigned long prev = std::numeric_limits<unsigned long>::max()
) )
/*! /*!
requires requires
...@@ -191,7 +191,7 @@ namespace dlib ...@@ -191,7 +191,7 @@ namespace dlib
typename enable_if<is_graph<typename T::graph_type>,bool>::type search_for_undirected_cycles ( typename enable_if<is_graph<typename T::graph_type>,bool>::type search_for_undirected_cycles (
const T& node, const T& node,
std::vector<bool>& visited, std::vector<bool>& visited,
unsigned long prev = -1 unsigned long prev = std::numeric_limits<unsigned long>::max()
) )
/*! /*!
requires requires
......
...@@ -249,7 +249,7 @@ namespace dlib ...@@ -249,7 +249,7 @@ namespace dlib
XIMStyles *xim_styles; XIMStyles *xim_styles;
window_table.get_mutex().lock(); window_table.get_mutex().lock();
XGetIMValues (xim, XNQueryInputStyle, &xim_styles, NULL); XGetIMValues (xim, XNQueryInputStyle, &xim_styles, (const void*)NULL);
window_table.get_mutex().unlock(); window_table.get_mutex().unlock();
std::set<XIMStyle> xims; std::set<XIMStyle> xims;
for (int i = 0; i < xim_styles->count_styles; ++i){ for (int i = 0; i < xim_styles->count_styles; ++i){
...@@ -1620,13 +1620,13 @@ namespace dlib ...@@ -1620,13 +1620,13 @@ namespace dlib
x11_stuff.fs = XCreateFontSet(globals().disp, fontset, &mlist, &mcount, &def_str); x11_stuff.fs = XCreateFontSet(globals().disp, fontset, &mlist, &mcount, &def_str);
xpoint.x = 0; xpoint.x = 0;
xpoint.y = 0; xpoint.y = 0;
xva_nlist = XVaCreateNestedList(0, XNSpotLocation, &xpoint, XNFontSet, x11_stuff.fs, NULL); xva_nlist = XVaCreateNestedList(0, XNSpotLocation, &xpoint, XNFontSet, x11_stuff.fs, (const void*)NULL);
x11_stuff.xic = XCreateIC( x11_stuff.xic = XCreateIC(
globals().xim, globals().xim,
XNInputStyle, globals().xim_style, XNInputStyle, globals().xim_style,
XNClientWindow, x11_stuff.hwnd, XNClientWindow, x11_stuff.hwnd,
XNPreeditAttributes, xva_nlist, XNPreeditAttributes, xva_nlist,
NULL (const void*)NULL
); );
XFree(xva_nlist); XFree(xva_nlist);
XFreeStringList(mlist); XFreeStringList(mlist);
...@@ -1640,7 +1640,7 @@ namespace dlib ...@@ -1640,7 +1640,7 @@ namespace dlib
// query event mask required by input method // query event mask required by input method
unsigned long event_xim = 0; unsigned long event_xim = 0;
if (x11_stuff.xic) if (x11_stuff.xic)
XGetICValues( x11_stuff.xic, XNFilterEvents, &event_xim, NULL ); XGetICValues( x11_stuff.xic, XNFilterEvents, &event_xim, (const void*)NULL );
XSelectInput( XSelectInput(
globals().disp, globals().disp,
...@@ -2008,8 +2008,8 @@ namespace dlib ...@@ -2008,8 +2008,8 @@ namespace dlib
xpoint.x = x; xpoint.x = x;
xpoint.y = y; xpoint.y = y;
xva_nlist = XVaCreateNestedList(0, XNSpotLocation, &xpoint, NULL); xva_nlist = XVaCreateNestedList(0, XNSpotLocation, &xpoint, (const void*)NULL);
XSetICValues(x11_stuff.xic, XNPreeditAttributes, xva_nlist, NULL); XSetICValues(x11_stuff.xic, XNPreeditAttributes, xva_nlist, (const void*)NULL);
XFree(xva_nlist); XFree(xva_nlist);
} }
......
...@@ -72,10 +72,10 @@ namespace dlib ...@@ -72,10 +72,10 @@ namespace dlib
delete [] points; delete [] points;
} }
const unsigned short width ( unsigned short width (
) const { return w; } ) const { return w; }
const unsigned short num_of_points ( unsigned short num_of_points (
) const { return count;} ) const { return count;}
point& operator[] ( point& operator[] (
...@@ -150,16 +150,16 @@ namespace dlib ...@@ -150,16 +150,16 @@ namespace dlib
unichar ch unichar ch
)const=0; )const=0;
virtual const unsigned long height ( virtual unsigned long height (
) const = 0; ) const = 0;
virtual const unsigned long ascender ( virtual unsigned long ascender (
) const = 0; ) const = 0;
virtual const unsigned long left_overflow ( virtual unsigned long left_overflow (
) const = 0; ) const = 0;
virtual const unsigned long right_overflow ( virtual unsigned long right_overflow (
) const = 0; ) const = 0;
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
...@@ -384,7 +384,7 @@ namespace dlib ...@@ -384,7 +384,7 @@ namespace dlib
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
template <typename T, typename traits, typename alloc> template <typename T, typename traits, typename alloc>
const unsigned long compute_cursor_pos ( unsigned long compute_cursor_pos (
const rectangle& rect, const rectangle& rect,
const std::basic_string<T,traits,alloc>& str, const std::basic_string<T,traits,alloc>& str,
long x, long x,
...@@ -512,16 +512,16 @@ namespace dlib ...@@ -512,16 +512,16 @@ namespace dlib
delete [] l; delete [] l;
} }
const unsigned long height ( unsigned long height (
) const { return 16; } ) const { return 16; }
const unsigned long ascender ( unsigned long ascender (
) const { return 12; } ) const { return 12; }
const unsigned long left_overflow ( unsigned long left_overflow (
) const { return 1; } ) const { return 1; }
const unsigned long right_overflow ( unsigned long right_overflow (
) const { return 2; } ) const { return 2; }
bool has_character ( bool has_character (
...@@ -554,19 +554,19 @@ namespace dlib ...@@ -554,19 +554,19 @@ namespace dlib
bdf_font( long default_char_ = -1 ); bdf_font( long default_char_ = -1 );
long read_bdf_file( std::istream& in, unichar max_enc, unichar min_enc = 0 ); long read_bdf_file( std::istream& in, unichar max_enc, unichar min_enc = 0 );
const unsigned long height() const unsigned long height() const
{ {
return fbb.height(); return fbb.height();
} }
const unsigned long ascender() const unsigned long ascender() const
{ {
return std::max( 0L, 1 - fbb.top() ); return std::max( 0L, 1 - fbb.top() );
} }
const unsigned long left_overflow() const unsigned long left_overflow() const
{ {
return std::max( 0L, -fbb.left() ); return std::max( 0L, -fbb.left() );
} }
const unsigned long right_overflow() const unsigned long right_overflow() const
{ {
return right_overflow_; return right_overflow_;
} }
......
...@@ -583,16 +583,16 @@ namespace nativefont ...@@ -583,16 +583,16 @@ namespace nativefont
return *l; return *l;
} }
virtual const unsigned long height ( virtual unsigned long height (
) const { return 12; } ) const { return 12; }
virtual const unsigned long ascender ( virtual unsigned long ascender (
) const { return ascender_; } ) const { return ascender_; }
virtual const unsigned long left_overflow ( virtual unsigned long left_overflow (
) const { return 1; } ) const { return 1; }
virtual const unsigned long right_overflow ( virtual unsigned long right_overflow (
) const { return 2; } ) const { return 2; }
}; };
......
...@@ -11,6 +11,11 @@ ...@@ -11,6 +11,11 @@
#include <string> #include <string>
#include "../logger.h" #include "../logger.h"
#ifdef __INTEL_COMPILER
// ignore the bogus warning about hiding on_connect()
#pragma warning (disable: 1125)
#endif
namespace dlib namespace dlib
{ {
......
...@@ -146,7 +146,7 @@ namespace dlib ...@@ -146,7 +146,7 @@ namespace dlib
struct string_cast_helper<bool> struct string_cast_helper<bool>
{ {
template < typename charT, typename traits, typename alloc > template < typename charT, typename traits, typename alloc >
static const bool cast ( static bool cast (
const std::basic_string<charT,traits,alloc>& str const std::basic_string<charT,traits,alloc>& str
) )
{ {
...@@ -169,7 +169,7 @@ namespace dlib ...@@ -169,7 +169,7 @@ namespace dlib
struct string_cast_helper<type> \ struct string_cast_helper<type> \
{ \ { \
template < typename charT, typename traits, typename alloc> \ template < typename charT, typename traits, typename alloc> \
static const type cast ( \ static type cast ( \
const std::basic_string<charT,traits,alloc>& str \ const std::basic_string<charT,traits,alloc>& str \
) \ ) \
{ \ { \
......
...@@ -60,7 +60,7 @@ namespace dlib ...@@ -60,7 +60,7 @@ namespace dlib
num_centers = num; num_centers = num;
} }
const unsigned long get_num_centers ( unsigned long get_num_centers (
) const ) const
{ {
return num_centers; return num_centers;
......
...@@ -929,7 +929,7 @@ namespace dlib ...@@ -929,7 +929,7 @@ namespace dlib
cache_size = cache_size_; cache_size = cache_size_;
} }
const long get_cache_size ( long get_cache_size (
) const ) const
{ {
return cache_size; return cache_size;
......
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