Commit 8d764230 authored by rquk's avatar rquk Committed by Davis E. King

Fixed issue with uninitialised variables in thread_pool_extension. (#386)

* Fixed issue with uninitialised variables. There are 2 places where std::exception_ptr eptr is not initialised.

* running_gradient.h needs to qualify erfc with 'std::' to avoid compilation error. 
Found when compiling dnn_mmod_face_detection_ex.cpp with RadStudio and Clang compiler.
parent 4a95f8bd
...@@ -165,7 +165,7 @@ namespace dlib ...@@ -165,7 +165,7 @@ namespace dlib
return 0.5; return 0.5;
} }
value = (value-mean)/stddev; value = (value-mean)/stddev;
return 0.5 * erfc(-value / std::sqrt(2.0)); return 0.5 * std::erfc(-value / std::sqrt(2.0));
} }
double n; double n;
......
...@@ -189,7 +189,7 @@ namespace dlib ...@@ -189,7 +189,7 @@ namespace dlib
task = tasks[idx]; task = tasks[idx];
} }
std::exception_ptr eptr; std::exception_ptr eptr = nullptr;
try try
{ {
// now do the task // now do the task
......
...@@ -411,7 +411,7 @@ namespace dlib ...@@ -411,7 +411,7 @@ namespace dlib
struct task_state_type struct task_state_type
{ {
task_state_type() : is_being_processed(false), task_id(0), next_task_id(2), arg1(0), arg2(0) {} task_state_type() : is_being_processed(false), task_id(0), next_task_id(2), arg1(0), arg2(0), eptr(nullptr) {}
bool is_ready () const bool is_ready () const
/*! /*!
......
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