summaryrefslogtreecommitdiff
path: root/win32_threads.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-07-11 00:15:49 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-07-11 00:15:49 +0300
commit36082bee6cdb1a2b2751f027cb7ce3c40b06a14a (patch)
treef19ebb92797d1641ade04a282e880e8e82ae55bb /win32_threads.c
parent3e886de065ceba31494aaf5665942c8610a2100e (diff)
downloadbdwgc-36082bee6cdb1a2b2751f027cb7ce3c40b06a14a.tar.gz
Eliminate 'scope of var can be reduced' cppcheck warning in pthread_join
* win32_threads.c [GC_PTHREADS && GC_WIN32_PTHREADS] (GC_pthread_join): Declare t local variable in the block where the variable is used.
Diffstat (limited to 'win32_threads.c')
-rw-r--r--win32_threads.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/win32_threads.c b/win32_threads.c
index 6434497b..a16aa9e2 100644
--- a/win32_threads.c
+++ b/win32_threads.c
@@ -2546,7 +2546,9 @@ GC_INNER void GC_thr_init(void)
GC_API int GC_pthread_join(pthread_t pthread_id, void **retval)
{
int result;
- GC_thread t;
+# ifndef GC_WIN32_PTHREADS
+ GC_thread t;
+# endif
DCL_LOCK_STATE;
GC_ASSERT(!GC_win32_dll_threads);
@@ -2569,7 +2571,7 @@ GC_INNER void GC_thr_init(void)
if (0 == result) {
# ifdef GC_WIN32_PTHREADS
/* pthreads-win32 and winpthreads id are unique (not recycled). */
- t = GC_lookup_pthread(pthread_id);
+ GC_thread t = GC_lookup_pthread(pthread_id);
if (NULL == t) ABORT("Thread not registered");
# endif