Skip to content

Commit 5eefc84

Browse files
author
Javier Gil Avilés
authored
Uncrustify to all ipp files (#5891)
Signed-off-by: Javier Gil Aviles <javiergil@eprosima.com>
1 parent 7f4ce7d commit 5eefc84

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

src/cpp/utils/thread_impl/thread_impl_win32.ipp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,29 @@ thread::native_handle_type thread::start_thread_impl(
2424
thread::start_routine_type start,
2525
void* arg)
2626
{
27-
// Set the requested stack size, if given.
28-
unsigned stack_attr = 0;
29-
if (stack_size > 0)
27+
// Set the requested stack size, if given.
28+
unsigned stack_attr = 0;
29+
if (stack_size > 0)
30+
{
31+
if (sizeof(unsigned) <= sizeof(int32_t) &&
32+
stack_size > static_cast<int32_t>(std::numeric_limits<unsigned>::max() / 2))
3033
{
31-
if (sizeof(unsigned) <= sizeof(int32_t) &&
32-
stack_size > static_cast<int32_t>(std::numeric_limits<unsigned>::max() / 2))
33-
{
34-
throw std::invalid_argument("Cannot cast stack_size into unsigned");
35-
}
36-
37-
stack_attr = static_cast<unsigned>(stack_size);
34+
throw std::invalid_argument("Cannot cast stack_size into unsigned");
3835
}
3936

40-
// Construct and execute the thread.
41-
HANDLE hnd = (HANDLE) ::_beginthreadex(NULL, stack_attr, start, arg, 0, NULL);
42-
if(!hnd)
43-
{
44-
throw std::system_error(std::make_error_code(std::errc::resource_unavailable_try_again));
45-
}
37+
stack_attr = static_cast<unsigned>(stack_size);
38+
}
4639

47-
return hnd;
40+
// Construct and execute the thread.
41+
HANDLE hnd = (HANDLE) ::_beginthreadex(NULL, stack_attr, start, arg, 0, NULL);
42+
if (!hnd)
43+
{
44+
throw std::system_error(std::make_error_code(std::errc::resource_unavailable_try_again));
4845
}
4946

47+
return hnd;
48+
}
49+
5050
thread::id thread::get_thread_id_impl(
5151
thread::native_handle_type hnd)
5252
{

src/cpp/utils/threading/threading_pthread.ipp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
#include <sys/syscall.h>
3434
#ifndef SYS_gettid
3535
#error "SYS_gettid unavailable on this system"
36-
#endif
36+
#endif // ifndef SYS_gettid
3737
#define gettid() ((pid_t)syscall(SYS_gettid))
38-
#endif
38+
#endif // if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ <= 30)))
3939

4040
namespace eprosima {
4141

@@ -100,10 +100,10 @@ static void configure_current_thread_scheduler(
100100

101101
if ((sched_class == SCHED_OTHER)
102102
#if !defined(__QNX__)
103-
|| (sched_class == SCHED_BATCH)
104-
|| (sched_class == SCHED_IDLE)
103+
|| (sched_class == SCHED_BATCH)
104+
|| (sched_class == SCHED_IDLE)
105105
#endif // !defined(__QNX__)
106-
)
106+
)
107107
{
108108
//
109109
// BATCH and IDLE do not have explicit priority values.

0 commit comments

Comments
 (0)