From cde85f3f450f7c3f12e1f7c4a70cb374e4756319 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 28 Jun 2022 22:57:52 -0400 Subject: Remove redundant `struct` keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because this is C++ code, GCC 12 says things like: Socket.hpp:166:24: error: redundant class-key ‘struct’ in reference to ‘struct sockaddr_un’ [-Werror=redundant-tags] --- include/raul/Semaphore.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/raul/Semaphore.hpp') diff --git a/include/raul/Semaphore.hpp b/include/raul/Semaphore.hpp index f4dc447..a30737b 100644 --- a/include/raul/Semaphore.hpp +++ b/include/raul/Semaphore.hpp @@ -256,7 +256,7 @@ Semaphore::timed_wait(const std::chrono::duration& wait) namespace chr = std::chrono; // Use clock_gettime to ensure sem_timedwait uses the same clock - struct timespec time {}; + timespec time{}; clock_gettime(CLOCK_REALTIME, &time); const auto now(chr::seconds(time.tv_sec) + chr::nanoseconds(time.tv_nsec)); @@ -265,8 +265,8 @@ Semaphore::timed_wait(const std::chrono::duration& wait) const chr::seconds end_sec(chr::duration_cast(end)); const chr::nanoseconds end_nsec(end - end_sec); - const struct timespec ts_end = {static_cast(end_sec.count()), - static_cast(end_nsec.count())}; + const timespec ts_end = {static_cast(end_sec.count()), + static_cast(end_nsec.count())}; return (sem_timedwait(&_sem, &ts_end) == 0); } -- cgit v1.2.1