version 1.73, 2019/11/11 13:16:25
|
version 1.81, 2025/04/15 10:17:58
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.32 |
RPL/2 (R) version 4.1.36 |
Copyright (C) 1989-2019 Dr. BERTRAND Joël |
Copyright (C) 1989-2025 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 141 transcription_arbre(struct_processus *s_
|
Line 141 transcription_arbre(struct_processus *s_
|
|
|
// Ajout des fonctions |
// Ajout des fonctions |
|
|
|
if ((*s_arbre).nombre_branches != 0) |
|
{ |
|
free((*s_arbre).branches); |
|
} |
|
|
l_liste = (*s_arbre).feuille; |
l_liste = (*s_arbre).feuille; |
uprintf("avant free %p\n", s_arbre->branches); |
|
free((*s_arbre).branches); |
|
uprintf("après free %p\n", s_arbre->branches); |
|
free(s_arbre); |
free(s_arbre); |
|
|
// Chaînage des arguments |
// Chaînage des arguments |
Line 225 ordonnancement_branches(const void *a1,
|
Line 227 ordonnancement_branches(const void *a1,
|
} |
} |
|
|
|
|
|
static int |
|
ordonnancement_instructions_neg(const void *a1, const void *a2) |
|
{ |
|
struct_arbre **_a1; |
|
|
|
_a1 = (struct_arbre **) a1; |
|
|
|
if ((**_a1).feuille != NULL) |
|
{ |
|
// On rejette NEG à la fin de l'arbre. |
|
|
|
if ((*(*(**_a1).feuille).donnee).type == FCT) |
|
{ |
|
if (strcmp((*((struct_fonction *) (*(*(**_a1).feuille).donnee) |
|
.objet)).nom_fonction, "NEG") == 0) |
|
{ |
|
return(1); |
|
} |
|
else |
|
{ |
|
return(-1); |
|
} |
|
} |
|
else |
|
{ |
|
return(0); |
|
} |
|
} |
|
|
|
return(0); |
|
} |
|
|
|
|
static void |
static void |
simplification_arbre(struct_processus *s_etat_processus, |
simplification_arbre(struct_processus *s_etat_processus, |
struct_arbre *s_arbre) |
struct_arbre *s_arbre) |
Line 335 simplification_arbre(struct_processus *s
|
Line 370 simplification_arbre(struct_processus *s
|
if (strcmp((*((struct_fonction *) (*(*(*s_arbre).feuille).donnee).objet)) |
if (strcmp((*((struct_fonction *) (*(*(*s_arbre).feuille).donnee).objet)) |
.nom_fonction, "+") == 0) |
.nom_fonction, "+") == 0) |
{ |
{ |
|
qsort((*s_arbre).branches, (size_t) (*s_arbre) |
|
.nombre_branches, sizeof(struct_arbre *), |
|
ordonnancement_instructions_neg); |
|
|
for(i = 0; i < (*s_arbre).nombre_branches; i++) |
for(i = 0; i < (*s_arbre).nombre_branches; i++) |
{ |
{ |
s_objet = (*((*((*s_arbre).branches[i])).feuille)).donnee; |
s_objet = (*((*((*s_arbre).branches[i])).feuille)).donnee; |