"Staticify" some functions to remove some warnings.
[TD_SE.git] / philosophe-famine / philosophe.c
index 69e1fe8e7ca9bb8a648ce01849e88c2bd4dae1c8..bd7ea4e5266a9716d345bfddee377f70a58020a1 100644 (file)
@@ -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) {
@@ -64,7 +64,7 @@ int main()
        int i, NumPhi[N] = { 0, 1, 2, 3, 4 };
        pthread_t th[N];
        sem_init(&mutex, 0, 1);
-       for (int i = 0; i < N; i++) {
+       for (i = 0; i < N; i++) {
                sem_init(&semPhil[i], 0, 1);
        }
        // création des N philosophes