Skip to content

Commit

Permalink
compat/win32/pthread.c: Fix a sparse warning
Browse files Browse the repository at this point in the history
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 }'.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ramsay Jones authored and Junio C Hamano committed Apr 28, 2013
1 parent ec535cc commit 9c3b051
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compat/win32/pthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9c3b051

Please sign in to comment.