Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame^] | 1 | From e9e9027d7a324e1ce5e0cb06d4eb51847262a09d Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sun, 28 Aug 2022 12:26:52 -0700 |
| 4 | Subject: [PATCH] mplay: Fix build with musl |
| 5 | |
| 6 | pthread_t is an opaque type, therefore typecast it to avoid warnings on |
| 7 | musl |
| 8 | |
| 9 | Fixes |
| 10 | mplay.c:200:12: error: incompatible integer to pointer conversion initializing 'pthread_t' (aka 'struct __pthread *') with an expression of type 'int' [-Wint-conversion] |
| 11 | | .tid = -1 |
| 12 | | ^~ |
| 13 | |
| 14 | Upstream-Status: Submitted [https://sourceforge.net/p/lirc/git/merge-requests/47/] |
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 16 | --- |
| 17 | plugins/mplay.c | 4 ++-- |
| 18 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 19 | |
| 20 | diff --git a/plugins/mplay.c b/plugins/mplay.c |
| 21 | index d6d9619..5b9eb4b 100644 |
| 22 | --- a/plugins/mplay.c |
| 23 | +++ b/plugins/mplay.c |
| 24 | @@ -197,7 +197,7 @@ static struct { |
| 25 | .latest_button = MPLAY_CODE_ERROR, |
| 26 | .fd = -1, |
| 27 | .pipefd = { -1, -1 }, |
| 28 | - .tid = -1 |
| 29 | + .tid = (pthread_t)-1 |
| 30 | }; |
| 31 | |
| 32 | /** |
| 33 | @@ -788,7 +788,7 @@ int mplayfamily_deinit(void) |
| 34 | return 0; |
| 35 | } |
| 36 | pthread_join(mplayfamily_local_data.tid, NULL); |
| 37 | - mplayfamily_local_data.tid = -1; |
| 38 | + mplayfamily_local_data.tid = (pthread_t)-1; |
| 39 | } |
| 40 | if (mplayfamily_local_data.pipefd[0] != -1) { |
| 41 | close(mplayfamily_local_data.pipefd[0]); |
| 42 | -- |
| 43 | 2.37.2 |
| 44 | |