Skip to content

Commit

Permalink
Add missing std:: (#1976)
Browse files Browse the repository at this point in the history
* Add missing std::

Signed-off-by: Elviss Strazdins <elviss@elviss.lv>

* Refs 11591. Uncrustify.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

Co-authored-by: Miguel Company <MiguelCompany@eprosima.com>
(cherry picked from commit 46ad378)

Co-authored-by: Elviss Strazdins <elviss@elviss.lv>
  • Loading branch information
mergify[bot] and elnormous authored May 20, 2021
1 parent 10aa9cf commit de05594
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions include/fastrtps/utils/TimedMutex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extern int clock_gettime(
#include <mutex>
#else
#include <pthread.h>
#endif
#endif // if defined(_WIN32)

namespace eprosima {
namespace fastrtps {
Expand Down Expand Up @@ -70,7 +70,7 @@ class TimedMutex
bool try_lock_for(
const std::chrono::duration<Rep, Period>& rel_time)
{
return try_lock_until(chrono::steady_clock::now() + rel_time);
return try_lock_until(std::chrono::steady_clock::now() + rel_time);
}

template <class Clock, class Duration>
Expand All @@ -81,7 +81,9 @@ class TimedMutex

if (0 < nsecs.count())
{
struct timespec max_wait = { 0, 0 };
struct timespec max_wait = {
0, 0
};
clock_gettime(1, &max_wait);
nsecs = nsecs + std::chrono::nanoseconds(max_wait.tv_nsec);
auto secs = std::chrono::duration_cast<std::chrono::seconds>(nsecs);
Expand Down Expand Up @@ -139,7 +141,7 @@ class RecursiveTimedMutex
bool try_lock_for(
const std::chrono::duration<Rep, Period>& rel_time)
{
return try_lock_until(chrono::steady_clock::now() + rel_time);
return try_lock_until(std::chrono::steady_clock::now() + rel_time);
}

template <class Clock, class Duration>
Expand All @@ -149,7 +151,9 @@ class RecursiveTimedMutex
std::chrono::nanoseconds nsecs = abs_time - std::chrono::steady_clock::now();
if (0 < nsecs.count())
{
struct timespec max_wait = { 0, 0 };
struct timespec max_wait = {
0, 0
};
clock_gettime(1, &max_wait);
nsecs = nsecs + std::chrono::nanoseconds(max_wait.tv_nsec);
auto secs = std::chrono::duration_cast<std::chrono::seconds>(nsecs);
Expand Down Expand Up @@ -218,7 +222,9 @@ class TimedMutex
const std::chrono::time_point<Clock, Duration>& abs_time)
{
std::chrono::nanoseconds nsecs = abs_time - std::chrono::steady_clock::now();
struct timespec max_wait = { 0, 0 };
struct timespec max_wait = {
0, 0
};
clock_gettime(CLOCK_REALTIME, &max_wait);
nsecs = nsecs + std::chrono::nanoseconds(max_wait.tv_nsec);
auto secs = std::chrono::duration_cast<std::chrono::seconds>(nsecs);
Expand Down Expand Up @@ -282,7 +288,9 @@ class RecursiveTimedMutex
const std::chrono::time_point<Clock, Duration>& abs_time)
{
std::chrono::nanoseconds nsecs = abs_time - std::chrono::steady_clock::now();
struct timespec max_wait = { 0, 0 };
struct timespec max_wait = {
0, 0
};
clock_gettime(CLOCK_REALTIME, &max_wait);
nsecs = nsecs + std::chrono::nanoseconds(max_wait.tv_nsec);
auto secs = std::chrono::duration_cast<std::chrono::seconds>(nsecs);
Expand Down

0 comments on commit de05594

Please sign in to comment.