Skip to content

Commit f20640e

Browse files
authored
Merge pull request #5419 from jhlegarreta/FixPtrConstantWarning
COMP: Use value initialization to zero-initialize thread id variable
2 parents b4baa24 + fa1a33e commit f20640e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Modules/Core/Common/include/itkThreadSupport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ using FastMutexType = pthread_mutex_t;
4242
using ThreadFunctionType = void * (*)(void *);
4343
using ThreadProcessIdType = pthread_t;
4444
# if !defined(ITK_FUTURE_LEGACY_REMOVE)
45-
constexpr ThreadProcessIdType ITK_DEFAULT_THREAD_ID = 0;
45+
constexpr ThreadProcessIdType ITK_DEFAULT_THREAD_ID = {};
4646
# endif
4747
using ITK_THREAD_RETURN_TYPE = void *;
4848
/** @ITKEndGrouping */

Modules/Core/Common/src/itkPlatformMultiThreaderPosix.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ ThreadProcessIdType
169169
PlatformMultiThreader::SpawnDispatchSingleMethodThread(PlatformMultiThreader::WorkUnitInfo * threadInfo)
170170
{
171171
// Using POSIX threads
172-
pthread_t threadHandle = 0;
172+
pthread_t threadHandle = {};
173173
const int threadError = pthread_create(&threadHandle,
174174
nullptr,
175175
reinterpret_cast<c_void_cast>(this->SingleMethodProxy),

0 commit comments

Comments
 (0)