From ab0e742cd422c7067e290ccb8ad5d1a3be2eb496 Mon Sep 17 00:00:00 2001 From: klmp200 Date: Mon, 11 Jun 2018 02:01:56 +0200 Subject: [PATCH] GCC YOU FAGGOT ! --- Building/Building.c | 8 ++++---- Building/Building.h | 2 +- Resident/Resident.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Building/Building.c b/Building/Building.c index f6445e6..7ac3691 100644 --- a/Building/Building.c +++ b/Building/Building.c @@ -150,18 +150,18 @@ void go_to_floor_Building(THIS(Building), int origin, int destination, Passenger pthread_cond_wait(this->condition_floors[origin], this->mutex_get_inside_elevator); elevator_number = this->get_inside_elevator(this, origin, passenger, type); - if (type == resident) + if (type == RESIDENT) printf("Le résident %s rentre dans l'ascenseur %s depuis l'étage %d\n", passenger.resident->name, this->elevators[elevator_number]->name, origin); - else if (type == visitor) + else if (type == VISITOR) printf("Le visiteur %s rentre dans l'ascenseur %s depuis l'étage %d\n", passenger.visitor->name, this->elevators[elevator_number]->name, origin); pthread_cond_wait(this->condition_floors[destination], this->mutex_get_outside_elevator); - if (type == resident) + if (type == RESIDENT) printf("Le résident %s sors de l'ascenseur %s à l'étage %d\n", passenger.resident->name, this->elevators[elevator_number]->name, destination); - else if (type == visitor) + else if (type == VISITOR) printf("Le visiteur %s sors de l'ascenseur %s à l'étage %d\n", passenger.visitor->name, this->elevators[elevator_number]->name, destination); } diff --git a/Building/Building.h b/Building/Building.h index 4cc4ec2..6e70fb6 100644 --- a/Building/Building.h +++ b/Building/Building.h @@ -15,7 +15,7 @@ #include "../Resident/Resident.h" #include "../Visitor/Visitor.h" -typedef enum {resident, visitor} PASSENGER_TYPE; +typedef enum {RESIDENT, VISITOR} PASSENGER_TYPE; typedef union u_Passenger { Resident * resident; diff --git a/Resident/Resident.c b/Resident/Resident.c index 4408128..bf588c3 100644 --- a/Resident/Resident.c +++ b/Resident/Resident.c @@ -11,7 +11,7 @@ GETTER(Resident, int, apartment_floor); void * runnable_Resident(void * void_this){ Resident * this = (Resident*) void_this; - printf("Je suis le resident %s et je suis a l'etage %d en direction de l'etage %d\n", + printf("Je suis le RESIDENT %s et je suis a l'etage %d en direction de l'etage %d\n", this->name, this->apartment_floor, this->destination); return NULL; } @@ -23,7 +23,7 @@ void _free__Resident(THIS(Resident)){ } Resident *_init_Resident(int id, char* name, int apartment_floor, int destination){ - /* If the destination is the same as the apartment_floor or negative, the resident will not move */ + /* If the destination is the same as the apartment_floor or negative, the RESIDENT will not move */ Resident * new_resident = malloc_or_die(sizeof(Resident)); new_resident->name = strdup(name); new_resident->id = id;