Warnings enlevés et changement du Makefile

This commit is contained in:
Yohan Boujon 2022-11-27 20:08:06 +01:00
parent 3d4af565bf
commit 2d6c53d2d6
2 changed files with 4 additions and 2 deletions

View file

@ -4,7 +4,7 @@ SRC=src/
EXEC=main EXEC=main
CLEAN=clean CLEAN=clean
all: $(EXEC) exec all: clean $(EXEC) exec
main: liste.o coureur.o readfile.o main: liste.o coureur.o readfile.o
$(CC) $(CFLAGS) -o $@ $^ $(CC) $(CFLAGS) -o $@ $^

View file

@ -4,7 +4,7 @@
int main(void) int main(void)
{ {
int size, stepsNb, teamsNb, listeTaille, dopageCount=0; int size, stepsNb, teamsNb, listeTaille, dopageCount=0;
srand(NULL); srand(time(NULL));
FILE * f=fopen ("fichier_coureurs.txt","r"); FILE * f=fopen ("fichier_coureurs.txt","r");
char * fileString = (char *)(malloc(getFileSize(f)*sizeof(char))); char * fileString = (char *)(malloc(getFileSize(f)*sizeof(char)));
int fileLines = getNbLines(f); int fileLines = getNbLines(f);
@ -15,6 +15,7 @@ int main(void)
liste dopageList = initListe(); liste dopageList = initListe();
listeTaille = tailleListe(l); listeTaille = tailleListe(l);
printf("Nombre d'etapes : %d\t Nombre d'equipes :%d\n",stepsNb,teamsNb);
for(int i=0; i<stepsNb ; i++) for(int i=0; i<stepsNb ; i++)
{ {
for(int j=0; j<listeTaille ; j++) for(int j=0; j<listeTaille ; j++)
@ -379,6 +380,7 @@ int test(void)
triListe(&l1,tailleListe(l1)); triListe(&l1,tailleListe(l1));
printlist(l1); printlist(l1);
printf(" -- SUPPRIME UN COUREUR N'EXISTANT PAS -- \n"); printf(" -- SUPPRIME UN COUREUR N'EXISTANT PAS -- \n");
effacerCoureur(&l1,c7);
effacerCoureur(&l1,c3); effacerCoureur(&l1,c3);
effacerCoureur(&l1,c4); effacerCoureur(&l1,c4);
printf("Does c3 exists : %d\tand c4 ? : %d\n",doesCoureurExist(&l1,c3),doesCoureurExist(&l1,c4)); printf("Does c3 exists : %d\tand c4 ? : %d\n",doesCoureurExist(&l1,c3),doesCoureurExist(&l1,c4));