From: Jérôme Benoit Date: Wed, 28 Feb 2018 11:37:31 +0000 (+0100) Subject: "Staticify" some functions to remove some warnings. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=4ed359e8f4a3ded5357fd63f276dafec2642cb57;p=TD_SE.git "Staticify" some functions to remove some warnings. Signed-off-by: Jérôme Benoit --- diff --git a/TD3/exo4/exo4.c b/TD3/exo4/exo4.c index 717a9d7..40337f6 100644 --- a/TD3/exo4/exo4.c +++ b/TD3/exo4/exo4.c @@ -4,25 +4,25 @@ #include #include -void sigintP() +static void sigintP() { printf("pid=%d\n", getpid()); signal(SIGINT, sigintP); } -void sigalrm() +static void sigalrm() { exit(1); } -void sigintF() +static void sigintF() { signal(SIGINT, SIG_IGN); signal(SIGALRM, sigalrm); alarm(5); } -void sigchld() +static void sigchld() { int status; wait(&status); diff --git a/philosophe-famine/philosophe.c b/philosophe-famine/philosophe.c index 95384c9..bd7ea4e 100644 --- a/philosophe-famine/philosophe.c +++ b/philosophe-famine/philosophe.c @@ -19,7 +19,7 @@ static int phiState[N] = { penser }; sem_t mutex; sem_t semPhil[N]; -void test(int i) +static void test(int i) { if (phiState[i] == faim && phiState[G] != manger && phiState[D] != manger) { @@ -28,7 +28,7 @@ void test(int i) } } -void *philosophe(void *num) +static void *philosophe(void *num) { int i = *(int *)num, nb = 2; while (nb) { diff --git a/philosophe/philosophe.c b/philosophe/philosophe.c index ebd4ac8..e317951 100644 --- a/philosophe/philosophe.c +++ b/philosophe/philosophe.c @@ -16,7 +16,7 @@ static int fourch[N] = { libre, libre, libre, libre, libre }; sem_t mutex; -void *philosophe(void *num) +static void *philosophe(void *num) { int i = *(int *)num, nb = 2; while (nb) {