From: Arnaud Giersch Date: Thu, 23 Feb 2023 16:14:51 +0000 (+0100) Subject: Useless casts to (void*). X-Git-Tag: v3.34~463 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c54a912eeb802838cbf3e1e632925d0fe2aa5bef Useless casts to (void*). --- diff --git a/examples/sthread/pthread-mutex-simple.c b/examples/sthread/pthread-mutex-simple.c index d97bfe8ca1..1d391418ba 100644 --- a/examples/sthread/pthread-mutex-simple.c +++ b/examples/sthread/pthread-mutex-simple.c @@ -21,8 +21,8 @@ int main(int argc, char* argv[]) int id[2] = {0, 1}; pthread_t thread1; pthread_t thread2; - pthread_create(&thread1, NULL, thread_fun, (void*)&id[0]); - pthread_create(&thread2, NULL, thread_fun, (void*)&id[1]); + pthread_create(&thread1, NULL, thread_fun, &id[0]); + pthread_create(&thread2, NULL, thread_fun, &id[1]); fprintf(stderr, "All threads are started.\n"); pthread_join(thread1, NULL); pthread_join(thread2, NULL); diff --git a/examples/sthread/pthread-mutex-simpledeadlock.c b/examples/sthread/pthread-mutex-simpledeadlock.c index 433852af05..09be6c11ea 100644 --- a/examples/sthread/pthread-mutex-simpledeadlock.c +++ b/examples/sthread/pthread-mutex-simpledeadlock.c @@ -39,8 +39,8 @@ int main(int argc, char* argv[]) int id[2] = {0, 1}; pthread_t thread1; pthread_t thread2; - pthread_create(&thread1, NULL, thread_fun1, (void*)&id[0]); - pthread_create(&thread2, NULL, thread_fun2, (void*)&id[1]); + pthread_create(&thread1, NULL, thread_fun1, &id[0]); + pthread_create(&thread2, NULL, thread_fun2, &id[1]); fprintf(stderr, "All threads are started.\n"); pthread_join(thread1, NULL); pthread_join(thread2, NULL); diff --git a/examples/sthread/pthread-producer-consumer.c b/examples/sthread/pthread-producer-consumer.c index 78deb2b018..8fd1a0b16b 100644 --- a/examples/sthread/pthread-producer-consumer.c +++ b/examples/sthread/pthread-producer-consumer.c @@ -67,9 +67,9 @@ int main(int argc, char** argv) int ids[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; // The identity of each thread (for debug messages) for (int i = 0; i < ProducerCount; i++) - pthread_create(&pro[i], NULL, (void*)&producer, (void*)&ids[i]); + pthread_create(&pro[i], NULL, producer, &ids[i]); for (int i = 0; i < ConsumerCount; i++) - pthread_create(&con[i], NULL, (void*)&consumer, (void*)&ids[i]); + pthread_create(&con[i], NULL, consumer, &ids[i]); for (int i = 0; i < ProducerCount; i++) pthread_join(pro[i], NULL); diff --git a/examples/sthread/sthread-mutex-simple.c b/examples/sthread/sthread-mutex-simple.c index 76fa009c94..dccec547f7 100644 --- a/examples/sthread/sthread-mutex-simple.c +++ b/examples/sthread/sthread-mutex-simple.c @@ -21,8 +21,8 @@ int main(int argc, char* argv[]) int id[2] = {0, 1}; sthread_t thread1; sthread_t thread2; - sthread_create(&thread1, NULL, thread_fun, (void*)&id[0]); - sthread_create(&thread2, NULL, thread_fun, (void*)&id[1]); + sthread_create(&thread1, NULL, thread_fun, &id[0]); + sthread_create(&thread2, NULL, thread_fun, &id[1]); fprintf(stderr, "All threads are started.\n"); sthread_join(thread1, NULL); sthread_join(thread2, NULL);