Skip to content

Commit

Permalink
graphics/gphoto2: fix the port's build against modern Clang 15
Browse files Browse the repository at this point in the history
Cast `unsigned int' type properly when using it as a thread id.

Reported by:	pkg-fallout
  • Loading branch information
Alexey Dokuchaev authored and Alexey Dokuchaev committed Feb 15, 2023
1 parent 43efd6a commit 3508b15
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions graphics/gphoto2/files/patch-gphoto2_main.c
@@ -0,0 +1,19 @@
--- gphoto2/main.c.orig 2020-07-02 06:39:33 UTC
+++ gphoto2/main.c
@@ -1211,14 +1211,14 @@ start_timeout_func (Camera *camera, unsigned int timeo

pthread_create (&tid, NULL, thread_func, td);

- return (tid);
+ return (intptr_t)tid;
}

static void
stop_timeout_func (Camera __unused__ *camera, unsigned int id,
void __unused__ *data)
{
- pthread_t tid = id;
+ pthread_t tid = (pthread_t)(intptr_t)id;

pthread_cancel (tid);
pthread_join (tid, NULL);

0 comments on commit 3508b15

Please sign in to comment.