Unverified Commit 0aa8b4cb authored by Juha Reunanen's avatar Juha Reunanen Committed by GitHub
Browse files

Treat warnings as errors (#2490)

parent 49314c12
...@@ -367,6 +367,19 @@ namespace ...@@ -367,6 +367,19 @@ namespace
} }
} }
{
const rectangle input(1,1,6,4);
const rectangle output = set_rect_area(input,4*input.area());
DLIB_TEST(output.area() == 4*input.area());
DLIB_TEST(output.width() == 2*input.width());
DLIB_TEST(output.height() == 2*input.height());
const auto input_center = center(input);
const auto output_center = center(output);
DLIB_TEST(std::abs(input_center.x() - output_center.x()) <= 1);
DLIB_TEST(std::abs(input_center.y() - output_center.y()) <= 1);
}
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -411,7 +411,6 @@ public: ...@@ -411,7 +411,6 @@ public:
group1(*this), group1(*this),
group2(*this), group2(*this),
group3(*this), group3(*this),
keyboard_count(1),
keydown(*this), keydown(*this),
keyup(*this), keyup(*this),
l1(*this), l1(*this),
...@@ -759,7 +758,6 @@ private: ...@@ -759,7 +758,6 @@ private:
widget_group group1; widget_group group1;
widget_group group2; widget_group group2;
widget_group group3; widget_group group3;
int keyboard_count;
label keydown; label keydown;
label keyup; label keyup;
label l1; label l1;
......
...@@ -323,6 +323,9 @@ namespace ...@@ -323,6 +323,9 @@ namespace
static_assert(dlib::invoke(multiply_ints, 2, 5) == 10, "this should be constexpr"); static_assert(dlib::invoke(multiply_ints, 2, 5) == 10, "this should be constexpr");
static_assert(dlib::invoke_r<long>(multiply_ints, 2, 5) == 10, "this should be constexpr"); static_assert(dlib::invoke_r<long>(multiply_ints, 2, 5) == 10, "this should be constexpr");
constexpr constexpr_object constexpr_obj; constexpr constexpr_object constexpr_obj;
#if defined (_MSC_VER)
constexpr_obj; // avoid warning C4101: 'constexpr_obj': unreferenced local variable
#endif
static_assert(dlib::invoke(&constexpr_object::multiply_ints, constexpr_obj, 2, 5) == 10, "this should be constexpr"); static_assert(dlib::invoke(&constexpr_object::multiply_ints, constexpr_obj, 2, 5) == 10, "this should be constexpr");
static_assert(dlib::invoke_r<long>(&constexpr_object::multiply_ints, constexpr_obj, 2, 5) == 10, "this should be constexpr"); static_assert(dlib::invoke_r<long>(&constexpr_object::multiply_ints, constexpr_obj, 2, 5) == 10, "this should be constexpr");
} }
......
...@@ -65,6 +65,14 @@ namespace dlib ...@@ -65,6 +65,14 @@ namespace dlib
- #first and #second contain copies of the items a and b. - #first and #second contain copies of the items a and b.
!*/ {} !*/ {}
unordered_pair (
const unordered_pair& p
) = default;
/*!
ensures
- #*this is a copy of p
!*/
template <typename U> template <typename U>
unordered_pair ( unordered_pair (
const unordered_pair <U>& p const unordered_pair <U>& p
......
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
#include <dlib/dir_nav.h> #include <dlib/dir_nav.h>
#include <iterator> #include <iterator>
#include <thread> #include <thread>
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
#include <execution>
#endif // __cplusplus >= 201703L
using namespace std; using namespace std;
using namespace dlib; using namespace dlib;
...@@ -555,14 +552,13 @@ std::vector<std::vector<truth_instance>> load_all_truth_instances(const std::vec ...@@ -555,14 +552,13 @@ std::vector<std::vector<truth_instance>> load_all_truth_instances(const std::vec
{ {
std::vector<std::vector<truth_instance>> truth_instances(listing.size()); std::vector<std::vector<truth_instance>> truth_instances(listing.size());
std::transform( parallel_for(
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) 0,
std::execution::par, listing.size(),
#endif // __cplusplus >= 201703L [&](size_t index)
listing.begin(), {
listing.end(), truth_instances[index] = load_truth_instances(listing[index]);
truth_instances.begin(), }
load_truth_instances
); );
return truth_instances; return truth_instances;
......
...@@ -179,7 +179,7 @@ public: ...@@ -179,7 +179,7 @@ public:
inline friend void serialize ( const very_simple_feature_extractor& item, std::ostream& out) { serialize(item.feat_image, out); } inline friend void serialize ( const very_simple_feature_extractor& item, std::ostream& out) { serialize(item.feat_image, out); }
inline friend void deserialize ( very_simple_feature_extractor& item, std::istream& in ) { deserialize(item.feat_image, in); } inline friend void deserialize ( very_simple_feature_extractor& item, std::istream& in ) { deserialize(item.feat_image, in); }
void copy_configuration ( const very_simple_feature_extractor& item){} void copy_configuration ( const very_simple_feature_extractor&){}
private: private:
array2d<unsigned char> feat_image; array2d<unsigned char> feat_image;
......
...@@ -34,10 +34,10 @@ class serv : public server_iostream ...@@ -34,10 +34,10 @@ class serv : public server_iostream
std::istream& in, std::istream& in,
std::ostream& out, std::ostream& out,
const std::string& foreign_ip, const std::string& foreign_ip,
const std::string& local_ip, const std::string& /*local_ip*/,
unsigned short foreign_port, unsigned short /*foreign_port*/,
unsigned short local_port, unsigned short /*local_port*/,
uint64 connection_id uint64 /*connection_id*/
) )
{ {
// The details of the connection are contained in the last few arguments to // The details of the connection are contained in the last few arguments to
......
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