"examples/sampling/vscode:/vscode.git/clone" did not exist on "6178897d3ceb6967de3c03ea04e0d902ebdb3f0a"
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
}
}
{
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:
group1(*this),
group2(*this),
group3(*this),
keyboard_count(1),
keydown(*this),
keyup(*this),
l1(*this),
......@@ -759,7 +758,6 @@ private:
widget_group group1;
widget_group group2;
widget_group group3;
int keyboard_count;
label keydown;
label keyup;
label l1;
......
......@@ -323,6 +323,9 @@ namespace
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");
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_r<long>(&constexpr_object::multiply_ints, constexpr_obj, 2, 5) == 10, "this should be constexpr");
}
......
......@@ -65,6 +65,14 @@ namespace dlib
- #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>
unordered_pair (
const unordered_pair <U>& p
......
......@@ -29,9 +29,6 @@
#include <dlib/dir_nav.h>
#include <iterator>
#include <thread>
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
#include <execution>
#endif // __cplusplus >= 201703L
using namespace std;
using namespace dlib;
......@@ -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::transform(
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
std::execution::par,
#endif // __cplusplus >= 201703L
listing.begin(),
listing.end(),
truth_instances.begin(),
load_truth_instances
parallel_for(
0,
listing.size(),
[&](size_t index)
{
truth_instances[index] = load_truth_instances(listing[index]);
}
);
return truth_instances;
......
......@@ -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 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:
array2d<unsigned char> feat_image;
......
......@@ -34,10 +34,10 @@ class serv : public server_iostream
std::istream& in,
std::ostream& out,
const std::string& foreign_ip,
const std::string& local_ip,
unsigned short foreign_port,
unsigned short local_port,
uint64 connection_id
const std::string& /*local_ip*/,
unsigned short /*foreign_port*/,
unsigned short /*local_port*/,
uint64 /*connection_id*/
)
{
// 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