From a9b718a7ee62d3fa085790ba5f2554bd633005a1 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Mon, 28 Mar 2011 10:06:04 +0200 Subject: [PATCH] =?UTF-8?q?Indentation=20diff=C3=A9rente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- C_Language/TP_SYS/tp_sema/consommateur.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/C_Language/TP_SYS/tp_sema/consommateur.c b/C_Language/TP_SYS/tp_sema/consommateur.c index 8279d88..107b8b8 100644 --- a/C_Language/TP_SYS/tp_sema/consommateur.c +++ b/C_Language/TP_SYS/tp_sema/consommateur.c @@ -122,7 +122,7 @@ int main( int argc, char **argv) P(mutex_data); vartemp = (int) memoireP->tete; - msgtemp = (MSG) memoireP->f[(vartemp -1 + MAX_BUF) % MAX_BUF ]; + msgtemp = (MSG) memoireP->f[( vartemp -1 + MAX_BUF) % MAX_BUF ]; V(mutex_data); if(numTete != vartemp) @@ -136,9 +136,7 @@ int main( int argc, char **argv) } P(mutex_data); - vartemp = (int) memoireP->queue; - vartemp = (vartemp +1) % MAX_BUF; - memoireP->queue = vartemp; + memoireP->queue = (memoireP->tete -1 + MAX_BUF) % MAX_BUF; V(mutex_data); // S'il n'y a plus de producteurs, on quitte @@ -178,10 +176,19 @@ WINDOW *creation_fenetre(int n,int d,char *t) void quitter(int signal) { if(shmctl(shmid, IPC_RMID, 0) < 0) - { perror("shmctl"); exit(EXIT_FAILURE); } + { + perror("shmctl"); + exit(EXIT_FAILURE); + } - if(mutex_data >= 0) { del_sem(sem_key_data); } - if(mutex_tpa >= 0) { del_sem(sem_key_tpa); } + if(mutex_data >= 0) + { + del_sem(sem_key_data); + } + if(mutex_tpa >= 0) + { + del_sem(sem_key_tpa); + } endwin() ; if(signal == PLUSDEPROD)