|
|
|
@ -121,13 +121,13 @@ Precedence *loadPrec(int *tmax, int *tlog)
|
|
|
|
|
prec=fopen("files/precedences.txt", "r");
|
|
|
|
|
(*tmax)=5;
|
|
|
|
|
(*tlog)=0;
|
|
|
|
|
if (prec == NULL)
|
|
|
|
|
if (!prec)
|
|
|
|
|
{
|
|
|
|
|
printf("\033[0;31mErreur: \033[0mouverture de 'precedence.txt'\n");
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
tabP = (Precedence *)malloc((*tmax) * sizeof(Precedence));
|
|
|
|
|
if (tabP == NULL)
|
|
|
|
|
if (!tabP)
|
|
|
|
|
{
|
|
|
|
|
printf("\033[0;31mErreur: \033[0mmalloc loadPrec\n");
|
|
|
|
|
exit(1);
|
|
|
|
@ -140,7 +140,7 @@ Precedence *loadPrec(int *tmax, int *tlog)
|
|
|
|
|
{
|
|
|
|
|
(*tmax)+=5;
|
|
|
|
|
s = (Precedence *)realloc(tabP, (*tmax) * sizeof(Precedence));
|
|
|
|
|
if (s==NULL)
|
|
|
|
|
if (!s)
|
|
|
|
|
{
|
|
|
|
|
printf("\033[0;31mErreur: \033[0mreallocation pour fichier précédence\n");
|
|
|
|
|
exit(1);
|
|
|
|
@ -169,8 +169,9 @@ Tache **loadTaches(Offre *tabTravaux[])
|
|
|
|
|
Precedence *prec;
|
|
|
|
|
int i, tmaxPrec, tlogPrec;
|
|
|
|
|
Tache *t, **tabTache;
|
|
|
|
|
tabTache = (Tache **)malloc(8*sizeof(Tache *));
|
|
|
|
|
if (tabTache == NULL)
|
|
|
|
|
|
|
|
|
|
tabTache = (Tache **)malloc(TMAXTRAV*sizeof(Tache *));
|
|
|
|
|
if (!tabTache)
|
|
|
|
|
{
|
|
|
|
|
printf("\033[0;31mErreur: \033[0mmalloc tableau tache\n");
|
|
|
|
|
exit(1);
|
|
|
|
@ -178,7 +179,7 @@ Tache **loadTaches(Offre *tabTravaux[])
|
|
|
|
|
for (i=0; i<TMAXTRAV; i++)
|
|
|
|
|
{
|
|
|
|
|
t=(Tache *)malloc(sizeof(Tache));
|
|
|
|
|
if (t==NULL)
|
|
|
|
|
if (!t)
|
|
|
|
|
{
|
|
|
|
|
printf("\033[0;31mErreur: \033[0mmalloc tache\n");
|
|
|
|
|
exit(1);
|
|
|
|
|