From f1927d349bd8d5cbf8708b7074fa203bf2a307f2 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Thu, 25 May 2023 14:57:43 +0200 Subject: [PATCH] fix: add stdbool remove useless memset --- philo/data.c | 12 +++--------- philo/data.h | 3 ++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/philo/data.c b/philo/data.c index 48ac929..22bfa2d 100644 --- a/philo/data.c +++ b/philo/data.c @@ -6,20 +6,15 @@ /* By: cchauvet -#include -#include -#include -#include -#include #include "./data.h" #include "philo.h" #include "philos.h" -#include +#include +#include bool data_init(t_data *data) { @@ -29,7 +24,6 @@ bool data_init(t_data *data) data->forks = malloc(sizeof(pthread_mutex_t) * data->nb_philos); if (data->forks == NULL) return (1); - memset(data->forks, 1, data->nb_philos); data->philos = malloc(sizeof(t_philo) * data->nb_philos); if (data->philos == NULL) free(data->forks); diff --git a/philo/data.h b/philo/data.h index b255b08..95b2f85 100644 --- a/philo/data.h +++ b/philo/data.h @@ -6,7 +6,7 @@ /* By: cchauvet # include +# include typedef struct s_data {