version 1.39, 2012/01/05 10:19:03
|
version 1.69, 2017/01/18 15:44:22
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.5 |
RPL/2 (R) version 4.1.26 |
Copyright (C) 1989-2012 Dr. BERTRAND Joël |
Copyright (C) 1989-2017 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 353 instruction_rnrm(struct_processus *s_eta
|
Line 353 instruction_rnrm(struct_processus *s_eta
|
struct_objet *s_objet_argument; |
struct_objet *s_objet_argument; |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
|
|
unsigned long i; |
integer8 i; |
unsigned long j; |
integer8 j; |
|
|
void *accumulateur; |
void *accumulateur; |
|
|
Line 410 instruction_rnrm(struct_processus *s_eta
|
Line 410 instruction_rnrm(struct_processus *s_eta
|
|
|
if ((*s_objet_argument).type == VIN) |
if ((*s_objet_argument).type == VIN) |
{ |
{ |
if ((s_objet_resultat = allocation(s_etat_processus, INT)) == NULL) |
depassement = d_faux; |
|
|
|
for(i = 0; i < (*((struct_vecteur *) (*s_objet_argument).objet)).taille; |
|
i++) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
if (((integer8 *) (*((struct_vecteur *) (*s_objet_argument) |
return; |
.objet)).tableau)[i] == INT64_MIN) |
|
{ |
|
depassement = d_vrai; |
|
break; |
|
} |
} |
} |
|
|
(*((integer8 *) (*s_objet_resultat).objet)) = abs(((integer8 *) |
if (depassement == d_faux) |
(*((struct_vecteur *) (*s_objet_argument).objet)).tableau)[0]); |
{ |
|
if ((s_objet_resultat = allocation(s_etat_processus, INT)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
for(i = 1; i < (*((struct_vecteur *) (*s_objet_argument).objet)).taille; |
(*((integer8 *) (*s_objet_resultat).objet)) = abs(((integer8 *) |
i++) |
(*((struct_vecteur *) (*s_objet_argument).objet)) |
|
.tableau)[0]); |
|
|
|
for(i = 1; i < (*((struct_vecteur *) (*s_objet_argument).objet)) |
|
.taille; i++) |
|
{ |
|
if (abs(((integer8 *) (*((struct_vecteur *) (*s_objet_argument) |
|
.objet)).tableau)[i]) > (*((integer8 *) |
|
(*s_objet_resultat).objet))) |
|
{ |
|
(*((integer8 *) (*s_objet_resultat).objet)) = |
|
abs(((integer8 *) (*((struct_vecteur *) |
|
(*s_objet_argument).objet)).tableau)[i]); |
|
} |
|
} |
|
} |
|
else |
{ |
{ |
if (abs(((integer8 *) (*((struct_vecteur *) (*s_objet_argument) |
if ((s_objet_resultat = allocation(s_etat_processus, REL)) == NULL) |
.objet)).tableau)[i]) > (*((integer8 *) |
|
(*s_objet_resultat).objet))) |
|
{ |
{ |
(*((integer8 *) (*s_objet_resultat).objet)) = |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
abs(((integer8 *) (*((struct_vecteur *) |
return; |
(*s_objet_argument).objet)).tableau)[i]); |
} |
|
|
|
(*((real8 *) (*s_objet_resultat).objet)) = abs((real8) ((integer8 *) |
|
(*((struct_vecteur *) (*s_objet_argument).objet)) |
|
.tableau)[0]); |
|
|
|
for(i = 1; i < (*((struct_vecteur *) (*s_objet_argument).objet)) |
|
.taille; i++) |
|
{ |
|
if (abs((real8) ((integer8 *) (*((struct_vecteur *) |
|
(*s_objet_argument).objet)).tableau)[i]) > (*((real8 *) |
|
(*s_objet_resultat).objet))) |
|
{ |
|
(*((real8 *) (*s_objet_resultat).objet)) = |
|
abs((real8) ((integer8 *) (*((struct_vecteur *) |
|
(*s_objet_argument).objet)).tableau)[i]); |
|
} |
} |
} |
} |
} |
} |
} |
Line 501 instruction_rnrm(struct_processus *s_eta
|
Line 543 instruction_rnrm(struct_processus *s_eta
|
for(j = 0; j < (*((struct_matrice *) (*s_objet_argument).objet)) |
for(j = 0; j < (*((struct_matrice *) (*s_objet_argument).objet)) |
.nombre_colonnes; j++) |
.nombre_colonnes; j++) |
{ |
{ |
|
if (((integer8 **) (*((struct_matrice *) (*s_objet_argument).objet)) |
|
.tableau)[0][j] == INT64_MIN) |
|
{ |
|
depassement = d_vrai; |
|
break; |
|
} |
|
|
entier_courant = abs(((integer8 **) |
entier_courant = abs(((integer8 **) |
(*((struct_matrice *) (*s_objet_argument).objet)) |
(*((struct_matrice *) (*s_objet_argument).objet)) |
.tableau)[0][j]); |
.tableau)[0][j]); |
Line 525 instruction_rnrm(struct_processus *s_eta
|
Line 574 instruction_rnrm(struct_processus *s_eta
|
for(j = 0; j < (*((struct_matrice *) (*s_objet_argument).objet)) |
for(j = 0; j < (*((struct_matrice *) (*s_objet_argument).objet)) |
.nombre_colonnes; j++) |
.nombre_colonnes; j++) |
{ |
{ |
|
if (((integer8 **) (*((struct_matrice *) |
|
(*s_objet_argument).objet)).tableau)[i][j] |
|
== INT64_MIN) |
|
{ |
|
depassement = d_vrai; |
|
break; |
|
} |
|
|
entier_courant = abs(((integer8 **) (*((struct_matrice *) |
entier_courant = abs(((integer8 **) (*((struct_matrice *) |
(*s_objet_argument).objet)).tableau)[i][j]); |
(*s_objet_argument).objet)).tableau)[i][j]); |
|
|
Line 565 instruction_rnrm(struct_processus *s_eta
|
Line 622 instruction_rnrm(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
if ((accumulateur = malloc((*((struct_matrice *) |
if ((accumulateur = malloc(((size_t) (*((struct_matrice *) |
(*s_objet_argument).objet)).nombre_colonnes * |
(*s_objet_argument).objet)).nombre_colonnes) * |
sizeof(real8))) == NULL) |
sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
Line 614 instruction_rnrm(struct_processus *s_eta
|
Line 671 instruction_rnrm(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
if ((accumulateur = malloc((*((struct_matrice *) |
if ((accumulateur = malloc(((size_t) (*((struct_matrice *) |
(*s_objet_argument).objet)).nombre_colonnes * sizeof(real8))) |
(*s_objet_argument).objet)).nombre_colonnes) * sizeof(real8))) |
== NULL) |
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
Line 661 instruction_rnrm(struct_processus *s_eta
|
Line 718 instruction_rnrm(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
if ((accumulateur = malloc((*((struct_matrice *) |
if ((accumulateur = malloc(((size_t) (*((struct_matrice *) |
(*s_objet_argument).objet)).nombre_colonnes * sizeof(real8))) |
(*s_objet_argument).objet)).nombre_colonnes) * sizeof(real8))) |
== NULL) |
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
Line 967 instruction_recall(struct_processus *s_e
|
Line 1024 instruction_recall(struct_processus *s_e
|
unsigned char *tampon_definitions_chainees; |
unsigned char *tampon_definitions_chainees; |
unsigned char *tampon_instruction_courante; |
unsigned char *tampon_instruction_courante; |
|
|
unsigned long position_courante; |
integer8 position_courante; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
Line 1056 instruction_recall(struct_processus *s_e
|
Line 1113 instruction_recall(struct_processus *s_e
|
d_exec_path, d_exec_path, |
d_exec_path, d_exec_path, |
d_exec_path, ds_preprocesseur, nom_fichier_temporaire); |
d_exec_path, ds_preprocesseur, nom_fichier_temporaire); |
|
|
if (alsprintf(&executable_candidat, "%s/bin/rpliconv", |
if (alsprintf(s_etat_processus, &executable_candidat, |
d_exec_path) < 0) |
"%s/bin/rpliconv", d_exec_path) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 1072 instruction_recall(struct_processus *s_e
|
Line 1129 instruction_recall(struct_processus *s_e
|
|
|
free(executable_candidat); |
free(executable_candidat); |
|
|
if (alsprintf(&executable_candidat, "%s/bin/rplfile", |
if (alsprintf(s_etat_processus, &executable_candidat, |
d_exec_path) < 0) |
"%s/bin/rplfile", d_exec_path) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 1088 instruction_recall(struct_processus *s_e
|
Line 1145 instruction_recall(struct_processus *s_e
|
|
|
free(executable_candidat); |
free(executable_candidat); |
|
|
if (alsprintf(&executable_candidat, "%s/bin/rplpp", |
if (alsprintf(s_etat_processus, &executable_candidat, |
d_exec_path) < 0) |
"%s/bin/rplpp", d_exec_path) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 1104 instruction_recall(struct_processus *s_e
|
Line 1161 instruction_recall(struct_processus *s_e
|
|
|
free(executable_candidat); |
free(executable_candidat); |
|
|
if (alsprintf(&executable_candidat, "%s/bin/rplawk", |
if (alsprintf(s_etat_processus, &executable_candidat, |
d_exec_path) < 0) |
"%s/bin/rplawk", d_exec_path) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 1140 instruction_recall(struct_processus *s_e
|
Line 1197 instruction_recall(struct_processus *s_e
|
(*s_etat_processus).rpl_home, ds_preprocesseur, |
(*s_etat_processus).rpl_home, ds_preprocesseur, |
nom_fichier_temporaire); |
nom_fichier_temporaire); |
|
|
if (alsprintf(&executable_candidat, "%s/bin/rpliconv", |
if (alsprintf(s_etat_processus, &executable_candidat, |
(*s_etat_processus).rpl_home) < 0) |
"%s/bin/rpliconv", (*s_etat_processus).rpl_home) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 1156 instruction_recall(struct_processus *s_e
|
Line 1213 instruction_recall(struct_processus *s_e
|
|
|
free(executable_candidat); |
free(executable_candidat); |
|
|
if (alsprintf(&executable_candidat, "%s/bin/rplfile", |
if (alsprintf(s_etat_processus, &executable_candidat, |
(*s_etat_processus).rpl_home) < 0) |
"%s/bin/rplfile", (*s_etat_processus).rpl_home) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 1172 instruction_recall(struct_processus *s_e
|
Line 1229 instruction_recall(struct_processus *s_e
|
|
|
free(executable_candidat); |
free(executable_candidat); |
|
|
if (alsprintf(&executable_candidat, "%s/bin/rplpp", |
if (alsprintf(s_etat_processus, &executable_candidat, |
(*s_etat_processus).rpl_home) < 0) |
"%s/bin/rplpp", (*s_etat_processus).rpl_home) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 1188 instruction_recall(struct_processus *s_e
|
Line 1245 instruction_recall(struct_processus *s_e
|
|
|
free(executable_candidat); |
free(executable_candidat); |
|
|
if (alsprintf(&executable_candidat, "%s/bin/rplawk", |
if (alsprintf(s_etat_processus, &executable_candidat, |
d_exec_path) < 0) |
"%s/bin/rplawk", d_exec_path) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 1262 instruction_recall(struct_processus *s_e
|
Line 1319 instruction_recall(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
if ((chaine = malloc((nombre_caracteres_source + 1) |
if ((chaine = malloc((((size_t) nombre_caracteres_source) + 1) |
* sizeof(unsigned char))) == NULL) |
* sizeof(unsigned char))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
Line 1303 instruction_recall(struct_processus *s_e
|
Line 1360 instruction_recall(struct_processus *s_e
|
} |
} |
} |
} |
|
|
if ((chaine[i] = caractere) == '\"') |
if ((chaine[i] = (unsigned char) caractere) == '\"') |
{ |
{ |
if (i > 0) |
if (i > 0) |
{ |
{ |
Line 1459 instruction_recall(struct_processus *s_e
|
Line 1516 instruction_recall(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
|
(*s_etat_processus).type_en_cours = NON; |
recherche_type(s_etat_processus); |
recherche_type(s_etat_processus); |
|
|
while((*s_etat_processus).definitions_chainees |
while((*s_etat_processus).definitions_chainees |
Line 1530 instruction_rcws(struct_processus *s_eta
|
Line 1588 instruction_rcws(struct_processus *s_eta
|
{ |
{ |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
|
|
unsigned long i; |
integer8 i; |
unsigned long j; |
integer8 j; |
unsigned long longueur; |
integer8 longueur; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|