--- rpl/src/instructions_f3.c 2012/04/03 21:27:09 1.43 +++ rpl/src/instructions_f3.c 2015/01/05 13:12:35 1.66 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.7 - Copyright (C) 1989-2012 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.19 + Copyright (C) 1989-2015 Dr. BERTRAND Joël This file is part of RPL/2. @@ -72,8 +72,8 @@ instruction_format(struct_processus *s_e } printf(" { \"STANDARD*(*)\" }\n"); - printf(" { \"lambda\" 'SEQUENTIAL' 'NEW' 'WRITEONLY' 'FORMATTED' }" - " OPEN FORMAT\n\n"); + printf(" { { \"NAME\" \"lambda\" } \"SEQUENTIAL\" \"NEW\"" + "\"WRITEONLY\" \"FORMATTED\" } OPEN\n FORMAT\n\n"); if ((*s_etat_processus).langue == 'F') { @@ -96,7 +96,8 @@ instruction_format(struct_processus *s_e printf(" { \"CHARACTER*(*)\" }\n"); printf(" { \"CHARACTER*(%s)\" }\n", d_INT); printf(" { \"BINARY*%s(*)\" }\n", d_INT); - printf(" { \"BINARY*%s(%s)\" }\n\n", d_INT, d_INT); + printf(" { \"BINARY*%s(%s)\" }\n", d_INT, d_INT); + printf(" { \"NATIVE*(*)\" }\n\n"); printf(" UNFORMATTED\n"); printf(" { \"INTEGER*1\", \"INTEGER*2\", \"INTEGER*4\", " @@ -105,11 +106,10 @@ instruction_format(struct_processus *s_e "\"LOGICAL*8\" }\n"); printf(" { \"REAL*4\", \"REAL*8\" }\n"); printf(" { \"COMPLEX*8\", \"COMPLEX*16\" }\n"); - printf(" { \"CHARACTER\" }\n\n"); + printf(" { \"CHARACTER*(*)\", \"CHARACTER*(%s)\" }\n", d_INT); + printf(" { \"NATIVE*(*)\" }\n\n"); printf(" FLOW\n"); - printf(" { \"CHARACTER*(*)\" }\n"); - printf(" { \"CHARACTER*(%s)\" }\n", d_INT); printf(" { \"LENGTH*(*)\" }\n"); printf(" { \"LENGTH*(%s)\" }\n", d_INT); @@ -148,17 +148,6 @@ instruction_format(struct_processus *s_e if (((*s_objet_argument_1).type == FCH) && ((*s_objet_argument_2).type == LST)) { - if ((*((struct_fichier *) (*s_objet_argument_1).objet)).binaire - == 'F') - { - liberation(s_etat_processus, s_objet_argument_1); - liberation(s_etat_processus, s_objet_argument_2); - - (*s_etat_processus).erreur_execution = - d_ex_erreur_format_fichier; - return; - } - if ((s_copie_argument_1 = copie_objet(s_etat_processus, s_objet_argument_1, 'N')) == NULL) { @@ -178,17 +167,6 @@ instruction_format(struct_processus *s_e else if (((*s_objet_argument_1).type == SCK) && ((*s_objet_argument_2).type == LST)) { - if ((*((struct_socket *) (*s_objet_argument_1).objet)).binaire - == 'F') - { - liberation(s_etat_processus, s_objet_argument_1); - liberation(s_etat_processus, s_objet_argument_2); - - (*s_etat_processus).erreur_execution = - d_ex_erreur_format_fichier; - return; - } - if ((s_copie_argument_1 = copie_objet(s_etat_processus, s_objet_argument_1, 'N')) == NULL) { @@ -564,7 +542,7 @@ instruction_fleche_q(struct_processus *s if (y != 0) { - z = fabs(objectif - (r1 / r2)); + z = abs(objectif - (r1 / r2)); x = ((real8) 1) / y; } else @@ -978,7 +956,7 @@ instruction_fleche_row(struct_processus nombre_lignes; if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - malloc(nombre_lignes * sizeof(integer8 *))) == NULL) + malloc(((size_t) nombre_lignes) * sizeof(integer8 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -993,7 +971,7 @@ instruction_fleche_row(struct_processus } if ((((integer8 **) (*((struct_matrice *) (*s_objet_resultat) - .objet)).tableau)[i] = malloc(nombre_colonnes * + .objet)).tableau)[i] = malloc(((size_t) nombre_colonnes) * sizeof(integer8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1024,7 +1002,7 @@ instruction_fleche_row(struct_processus nombre_lignes; if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - malloc(nombre_lignes * sizeof(real8 *))) == NULL) + malloc(((size_t) nombre_lignes) * sizeof(real8 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -1039,7 +1017,7 @@ instruction_fleche_row(struct_processus } if ((((real8 **) (*((struct_matrice *) (*s_objet_resultat) - .objet)).tableau)[i] = malloc(nombre_colonnes * + .objet)).tableau)[i] = malloc(((size_t) nombre_colonnes) * sizeof(real8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1051,7 +1029,7 @@ instruction_fleche_row(struct_processus for(j = 0; j < nombre_colonnes; j++) { ((real8 **) (*((struct_matrice *) (*s_objet_resultat) - .objet)).tableau)[i][j] = ((integer8 **) + .objet)).tableau)[i][j] = (real8) ((integer8 **) (*((struct_matrice *) (*s_objet).objet)) .tableau)[0][j]; } @@ -1084,7 +1062,7 @@ instruction_fleche_row(struct_processus nombre_lignes; if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - malloc(nombre_lignes * sizeof(complex16 *))) == NULL) + malloc(((size_t) nombre_lignes) * sizeof(complex16 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -1099,7 +1077,7 @@ instruction_fleche_row(struct_processus } if ((((complex16 **) (*((struct_matrice *) (*s_objet_resultat) - .objet)).tableau)[i] = malloc(nombre_colonnes * + .objet)).tableau)[i] = malloc(((size_t) nombre_colonnes) * sizeof(complex16))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1111,7 +1089,7 @@ instruction_fleche_row(struct_processus for(j = 0; j < nombre_colonnes; j++) { (((complex16 **) (*((struct_matrice *) (*s_objet_resultat) - .objet)).tableau)[i][j]).partie_reelle = + .objet)).tableau)[i][j]).partie_reelle = (real8) ((integer8 **) (*((struct_matrice *) (*s_objet).objet)).tableau)[0][j]; (((complex16 **) (*((struct_matrice *) (*s_objet_resultat) @@ -1373,7 +1351,7 @@ instruction_fleche_col(struct_processus nombre_lignes; if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - malloc(nombre_lignes * sizeof(integer8 *))) == NULL) + malloc(((size_t) nombre_lignes) * sizeof(integer8 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -1382,7 +1360,7 @@ instruction_fleche_col(struct_processus for(i = 0; i < nombre_lignes; i++) { if ((((integer8 **) (*((struct_matrice *) (*s_objet_resultat) - .objet)).tableau)[i] = malloc(nombre_colonnes * + .objet)).tableau)[i] = malloc(((size_t) nombre_colonnes) * sizeof(integer8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1422,7 +1400,7 @@ instruction_fleche_col(struct_processus nombre_lignes; if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - malloc(nombre_lignes * sizeof(real8 *))) == NULL) + malloc(((size_t) nombre_lignes) * sizeof(real8 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -1431,7 +1409,7 @@ instruction_fleche_col(struct_processus for(i = 0; i < nombre_lignes; i++) { if ((((real8 **) (*((struct_matrice *) (*s_objet_resultat) - .objet)).tableau)[i] = malloc(nombre_colonnes * + .objet)).tableau)[i] = malloc(((size_t) nombre_colonnes) * sizeof(real8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1452,7 +1430,7 @@ instruction_fleche_col(struct_processus for(i = 0; i < nombre_lignes; i++) { ((real8 **) (*((struct_matrice *) (*s_objet_resultat) - .objet)).tableau)[i][j] = ((integer8 **) + .objet)).tableau)[i][j] = (real8) ((integer8 **) (*((struct_matrice *) (*s_objet).objet)) .tableau)[i][0]; } @@ -1485,7 +1463,7 @@ instruction_fleche_col(struct_processus nombre_lignes; if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - malloc(nombre_lignes * sizeof(complex16 *))) == NULL) + malloc(((size_t) nombre_lignes) * sizeof(complex16 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -1494,7 +1472,7 @@ instruction_fleche_col(struct_processus for(i = 0; i < nombre_lignes; i++) { if ((((complex16 **) (*((struct_matrice *) (*s_objet_resultat) - .objet)).tableau)[i] = malloc(nombre_colonnes * + .objet)).tableau)[i] = malloc(((size_t) nombre_colonnes) * sizeof(complex16))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1515,7 +1493,7 @@ instruction_fleche_col(struct_processus for(i = 0; i < nombre_lignes; i++) { (((complex16 **) (*((struct_matrice *) (*s_objet_resultat) - .objet)).tableau)[i][j]).partie_reelle = + .objet)).tableau)[i][j]).partie_reelle = (real8) ((integer8 **) (*((struct_matrice *) (*s_objet).objet)).tableau)[i][0]; (((complex16 **) (*((struct_matrice *) (*s_objet_resultat)