Skip to contentSkip to conversation

compat/win32/pthread.c: Fix a sparse warning

PATCH In review Ramsay Jones 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 2/6 compat/win32/pthread.c: Fix a sparse warning

Sparse issues a 'Using plain integer as NULL pointer' warning when initializing an pthread_t structure with an '{ 0 }' initializer. The first field of the pthread_t structure has type HANDLE (void *), so in order to suppress the warning, we replace the initializer expression with '{ NULL }'.

---
 compat/win32/pthread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
compat/win32/pthread.c +1 -1
index 010e875..e18f5c6 100644
@@ -52,7 +52,7 @@ int win32_pthread_join(pthread_t *thread, void **value_ptr)
 
 pthread_t pthread_self(void)
 {
-	pthread_t t = { 0 };
+	pthread_t t = { NULL };
 	t.tid = GetCurrentThreadId();
 	return t;
 }
Signature · 1 line
1.8.2