aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/args.c7
-rw-r--r--common/common.h6
-rw-r--r--common/io.c4
3 files changed, 10 insertions, 7 deletions
diff --git a/common/args.c b/common/args.c
index 6392f22..e55f004 100644
--- a/common/args.c
+++ b/common/args.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/08 23:12:55 by cacharle #+# #+# */
-/* Updated: 2020/09/30 10:14:24 by cacharle ### ########.fr */
+/* Updated: 2020/10/05 14:26:40 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,7 +15,10 @@
bool parse_args(t_philo_args *args, int argc, char **argv)
{
if (argc != 5 && argc != 6)
- return h_err(false, "Usage: %s philosophers_num death_timeout eat_timeout sleep_timeout [meal_num]", argv[0]);
+ {
+ return (h_err(false, "Usage: %s philosophers_num death_timeout"
+ "eat_timeout sleep_timeout [meal_num]", argv[0]));
+ }
if ((args->philo_num = h_atou_strict(argv[1])) == -1
|| (args->timeout_death = h_atou_strict(argv[2])) == -1
|| (args->timeout_eat = h_atou_strict(argv[3])) == -1
diff --git a/common/common.h b/common/common.h
index f810b6f..2415e73 100644
--- a/common/common.h
+++ b/common/common.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/08 22:58:35 by cacharle #+# #+# */
-/* Updated: 2020/09/30 10:36:03 by cacharle ### ########.fr */
+/* Updated: 2020/10/05 14:30:07 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -22,7 +22,7 @@
typedef long int t_time;
-typedef enum
+typedef enum e_philo_event
{
EVENT_FORK,
EVENT_EAT,
@@ -34,7 +34,7 @@ typedef enum
typedef struct
{
long int philo_num;
- t_time timeout_death;
+ t_time timeout_death;
t_time timeout_eat;
t_time timeout_sleep;
long int meal_num;
diff --git a/common/io.c b/common/io.c
index 7989575..355135a 100644
--- a/common/io.c
+++ b/common/io.c
@@ -6,7 +6,7 @@
/* By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/09/30 10:03:53 by cacharle #+# #+# */
-/* Updated: 2020/09/30 10:32:41 by cacharle ### ########.fr */
+/* Updated: 2020/10/05 14:27:13 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -28,7 +28,7 @@ static char *st_nbrcpy(char *dst, long long int num)
dst = st_nbrcpy(dst, num / 10);
dst[0] = num % 10 + '0';
dst[1] = '\0';
- return dst + 1;
+ return (dst + 1);
}
static void st_strcat(char *dst, char *str)