From 183fac3f491bcd7426269ca1b9c6f8daf9595794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20LAVERGNE?= Date: Tue, 7 Nov 2023 10:29:19 +0100 Subject: [PATCH] =?UTF-8?q?Modification=20de=20la=20fonction=20de=20d?= =?UTF-8?q?=C3=A9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/debug.c | 39 ++++++++++++++++++--------------------- src/main.c | 2 +- src/main.h | 5 +++++ 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/debug.c b/src/debug.c index 9bfc9f6..15bd1d6 100644 --- a/src/debug.c +++ b/src/debug.c @@ -5,7 +5,7 @@ #include "main.h" -void displayItemList(int reference[], float weight[], float volume[], float unitPrice[], int log) +void displayItemListDEBUG(int reference[], float weight[], float volume[], float unitPrice[], int log) { int i; printf("DEBUG - Affichage des articles: \n"); @@ -15,7 +15,7 @@ void displayItemList(int reference[], float weight[], float volume[], float unit } } -void displayClientList(int clientID[], float cagnotte[], int suspended[], int isAdmin[], int log) +void displayClientListDEBUG(int clientID[], float cagnotte[], int suspended[], int isAdmin[], int log) { int i; printf("DEBUG - Affichage des clients: \n"); @@ -27,25 +27,22 @@ void displayClientList(int clientID[], float cagnotte[], int suspended[], int is void debugMenu(int tabReference[], float tabWeight[], float tabVolume[], float unitPrice[], int clientID[], float cagnotte[], int suspended[], int isAdmin[], int tlogArticle, int tlogClient) { - int choice = -1; - while (choice != 0) - { - printf("DEBUG - Menu de debug: \n"); - printf("1 - Afficher les articles\n"); - printf("2 - Afficher les clients\n"); - printf("Votre choix: "); - scanf("%d%*c", &choice); + int choice; + printf("DEBUG - Menu de debug: \n"); + printf("1 - Afficher les articles\n"); + printf("2 - Afficher les clients\n"); + printf("Votre choix: "); + scanf("%d%*c", &choice); - switch (choice) - { - case 1: - displayItemList(tabReference, tabWeight, tabVolume, unitPrice, tlogArticle); - break; - case 2: - displayClientList(clientID, cagnotte, suspended, isAdmin, tlogClient); - break; - default: - break; - } + switch (choice) + { + case 1: + displayItemListDEBUG(tabReference, tabWeight, tabVolume, unitPrice, tlogArticle); + break; + case 2: + displayClientListDEBUG(clientID, cagnotte, suspended, isAdmin, tlogClient); + break; + default: + break; } } \ No newline at end of file diff --git a/src/main.c b/src/main.c index 090b119..70d4f03 100644 --- a/src/main.c +++ b/src/main.c @@ -102,7 +102,7 @@ void global(void) case 4: return; case 9: - printf("Temp"); + debugMenu(reference, weight, volume, unitPrice, clientID, cagnotte, suspended, isAdmin, tLogArticle, tLogClient); break; default: printf("Erreur, veuillez entrer un choix valide.\n"); diff --git a/src/main.h b/src/main.h index 2bc662a..2ecbdeb 100644 --- a/src/main.h +++ b/src/main.h @@ -15,6 +15,11 @@ void errorHandling(int error); void debugHandling(int code); +//! DEBUG +void displayItemListDEBUG(int reference[], float weight[], float volume[], float unitPrice[], int log); +void displayClientListDEBUG(int clientID[], float cagnotte[], int suspended[], int isAdmin[], int log); +void debugMenu(int tabReference[], float tabWeight[], float tabVolume[], float unitPrice[], int clientID[], float cagnotte[], int suspended[], int isAdmin[], int tlogArticle, int tlogClient); + //! TRAITEMENT DES FICHIERS void chargeDonnees(int *tLogArticle, int *tLogClient,int reference[], float weight[], float volume[], float unitPrice[], int clientID[], float cagnotte[], int suspended[], int isAdmin[]); int chargeArticles(int reference[], float weight[], float volume[], float unitPrice[]);