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