--- rpl/src/instructions_r1.c 2013/02/27 17:11:43 1.41 +++ rpl/src/instructions_r1.c 2020/01/10 11:15:47 1.69 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.13 - Copyright (C) 1989-2013 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.32 + Copyright (C) 1989-2020 Dr. BERTRAND Joël This file is part of RPL/2. @@ -89,7 +89,7 @@ instruction_roll(struct_processus *s_eta struct_objet *s_objet; - unsigned long i; + integer8 i; (*s_etat_processus).erreur_execution = d_ex; @@ -110,37 +110,37 @@ instruction_roll(struct_processus *s_eta " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); printf(" ...\n"); printf(" 2: %s, %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); printf(" 1: %s\n", d_INT); printf("-> n: %s, %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); printf(" ...\n"); printf(" 1: %s, %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); return; } @@ -199,7 +199,7 @@ instruction_roll(struct_processus *s_eta { l_liste1 = (*s_etat_processus).l_base_pile; - for(i = 2; i < (unsigned long) (*((integer8 *) (*s_objet).objet)); i++) + for(i = 2; i < (*((integer8 *) (*s_objet).objet)); i++) { l_liste1 = (*l_liste1).suivant; } @@ -236,7 +236,7 @@ instruction_rolld(struct_processus *s_et struct_objet *s_objet; - unsigned long i; + integer8 i; (*s_etat_processus).erreur_execution = d_ex; @@ -257,37 +257,37 @@ instruction_rolld(struct_processus *s_et " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); printf(" ...\n"); printf(" 2: %s, %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); printf(" 1: %s\n", d_INT); printf("-> n: %s, %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); printf(" ...\n"); printf(" 1: %s, %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); return; } @@ -346,7 +346,7 @@ instruction_rolld(struct_processus *s_et { l_liste1 = (*s_etat_processus).l_base_pile; - for(i = 1; i < (unsigned long) (*((integer8 *) (*s_objet).objet)); i++) + for(i = 1; i < (*((integer8 *) (*s_objet).objet)); i++) { l_liste1 = (*l_liste1).suivant; } @@ -401,50 +401,50 @@ instruction_rot(struct_processus *s_etat " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); printf(" 2: %s, %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); printf(" 1: %s, %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); printf("-> 3: %s, %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); printf(" 2: %s, %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); printf(" 1: %s, %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); return; } @@ -504,7 +504,7 @@ instruction_repeat(struct_processus *s_e unsigned char *instruction_majuscule; unsigned char *tampon; - unsigned long niveau; + integer8 niveau; void (*fonction)(); @@ -596,6 +596,7 @@ instruction_repeat(struct_processus *s_e } if ((instruction_majuscule = conversion_majuscule( + s_etat_processus, (*s_etat_processus).instruction_courante)) == NULL) { liberation(s_etat_processus, s_objet); @@ -615,7 +616,8 @@ instruction_repeat(struct_processus *s_e || (strcmp(instruction_majuscule, "ELSEIF") == 0)) { - (*s_etat_processus).position_courante -= (strlen( + (*s_etat_processus).position_courante -= + (integer8) (strlen( instruction_majuscule) + 1); drapeau_fin = d_vrai; } @@ -868,10 +870,10 @@ instruction_rclf(struct_processus *s_eta for(i = 1; i <= 64; i++) { - indice_drapeau = i - 1; + indice_drapeau = (unsigned char) (i - 1); indice_bloc = indice_drapeau / taille_bloc; indice_bit = indice_drapeau % taille_bloc; - masque = ((t_8_bits) 1) << (taille_bloc - indice_bit - 1); + masque = (t_8_bits) (((t_8_bits) 1) << (taille_bloc - indice_bit - 1)); if (((*s_etat_processus).drapeaux_etat[indice_bloc] & masque) != 0) { @@ -928,10 +930,10 @@ instruction_rcl(struct_processus *s_etat " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s, %s,\n" " %s, %s, %s, %s,\n" - " %s, %s\n", + " %s, %s, %s\n", d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, - d_SQL, d_SLB, d_PRC, d_MTX); + d_SQL, d_SLB, d_PRC, d_MTX, d_REC); return; } @@ -1132,7 +1134,7 @@ instruction_rdz(struct_processus *s_etat if ((*s_objet).type == INT) { initialisation_generateur_aleatoire(s_etat_processus, d_faux, - (unsigned long int) (*((integer8 *) (*s_objet).objet))); + (*((integer8 *) (*s_objet).objet))); } else { @@ -1230,6 +1232,7 @@ instruction_rnd(struct_processus *s_etat return; } + (*s_etat_processus).type_en_cours = NON; recherche_type(s_etat_processus); free((*s_etat_processus).instruction_courante); @@ -1279,8 +1282,8 @@ instruction_r_vers_c(struct_processus *s struct_objet *s_objet_argument_2; struct_objet *s_objet_resultat; - unsigned long i; - unsigned long j; + integer8 i; + integer8 j; (*s_etat_processus).erreur_execution = d_ex; @@ -1361,7 +1364,7 @@ instruction_r_vers_c(struct_processus *s if ((*s_objet_argument_1).type == INT) { (*((struct_complexe16 *) (*s_objet_resultat).objet)) - .partie_imaginaire = + .partie_imaginaire = (real8) (*((integer8 *) (*s_objet_argument_1).objet)); } else @@ -1374,7 +1377,7 @@ instruction_r_vers_c(struct_processus *s if ((*s_objet_argument_2).type == INT) { (*((struct_complexe16 *) (*s_objet_resultat).objet)) - .partie_reelle = + .partie_reelle = (real8) (*((integer8 *) (*s_objet_argument_2).objet)); } else @@ -1416,8 +1419,8 @@ instruction_r_vers_c(struct_processus *s (*((struct_vecteur *) (*s_objet_argument_1).objet)).taille; if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau = - malloc((*(((struct_vecteur *) (*s_objet_resultat) - .objet))).taille * sizeof(struct_complexe16))) == NULL) + malloc(((size_t) (*(((struct_vecteur *) (*s_objet_resultat) + .objet))).taille) * sizeof(struct_complexe16))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -1430,7 +1433,7 @@ instruction_r_vers_c(struct_processus *s { ((struct_complexe16 *) (*((struct_vecteur *) (*s_objet_resultat).objet)).tableau)[i] - .partie_imaginaire = ((integer8 *) + .partie_imaginaire = (real8) ((integer8 *) (*((struct_vecteur *) (*s_objet_argument_1).objet)) .tableau)[i]; } @@ -1447,7 +1450,7 @@ instruction_r_vers_c(struct_processus *s { ((struct_complexe16 *) (*((struct_vecteur *) (*s_objet_resultat).objet)).tableau)[i] - .partie_reelle = ((integer8 *) + .partie_reelle = (real8) ((integer8 *) (*((struct_vecteur *) (*s_objet_argument_2).objet)) .tableau)[i]; } @@ -1501,8 +1504,9 @@ instruction_r_vers_c(struct_processus *s .nombre_colonnes; if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - malloc((*(((struct_matrice *) (*s_objet_resultat) - .objet))).nombre_lignes * sizeof(struct_complexe16 *))) == NULL) + malloc(((size_t) (*(((struct_matrice *) (*s_objet_resultat) + .objet))).nombre_lignes) * sizeof(struct_complexe16 *))) + == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -1513,8 +1517,8 @@ instruction_r_vers_c(struct_processus *s { if ((((struct_complexe16 **) (*((struct_matrice *) (*s_objet_resultat).objet)).tableau)[i] = - malloc((*((struct_matrice *) - (*s_objet_resultat).objet)).nombre_colonnes * + malloc(((size_t) (*((struct_matrice *) + (*s_objet_resultat).objet)).nombre_colonnes) * sizeof(struct_complexe16))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1528,7 +1532,7 @@ instruction_r_vers_c(struct_processus *s { ((struct_complexe16 **) (*((struct_matrice *) (*s_objet_resultat).objet)).tableau)[i][j] - .partie_imaginaire = ((integer8 **) + .partie_imaginaire = (real8) ((integer8 **) (*((struct_matrice *) (*s_objet_argument_1).objet)) .tableau)[i][j]; } @@ -1545,7 +1549,7 @@ instruction_r_vers_c(struct_processus *s { ((struct_complexe16 **) (*((struct_matrice *) (*s_objet_resultat).objet)).tableau)[i][j] - .partie_reelle = ((integer8 **) + .partie_reelle = (real8) ((integer8 **) (*((struct_matrice *) (*s_objet_argument_2).objet)) .tableau)[i][j]; } @@ -1611,8 +1615,8 @@ instruction_re(struct_processus *s_etat_ struct_objet *s_objet_argument; struct_objet *s_objet_resultat; - unsigned long i; - unsigned long j; + integer8 i; + integer8 j; (*s_etat_processus).erreur_execution = d_ex; @@ -1729,8 +1733,8 @@ instruction_re(struct_processus *s_etat_ } if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau = - malloc((*(((struct_vecteur *) (*s_objet_argument) - .objet))).taille * sizeof(real8))) == NULL) + malloc(((size_t) (*(((struct_vecteur *) (*s_objet_argument) + .objet))).taille) * sizeof(real8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -1769,8 +1773,8 @@ instruction_re(struct_processus *s_etat_ } if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - malloc((*(((struct_matrice *) (*s_objet_argument) - .objet))).nombre_lignes * sizeof(real8 *))) == NULL) + malloc(((size_t) (*(((struct_matrice *) (*s_objet_argument) + .objet))).nombre_lignes) * sizeof(real8 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -1786,9 +1790,9 @@ instruction_re(struct_processus *s_etat_ .nombre_lignes; i++) { if ((((real8 **) (*((struct_matrice *) (*s_objet_resultat) - .objet)).tableau)[i] = malloc( + .objet)).tableau)[i] = malloc(((size_t) (*(((struct_matrice *) (*s_objet_argument).objet))) - .nombre_colonnes * sizeof(real8))) == NULL) + .nombre_colonnes) * sizeof(real8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -2101,7 +2105,7 @@ instruction_r_vers_p(struct_processus *s if ((*s_objet_argument).type == INT) { (*((struct_complexe16 *) (*s_objet_resultat).objet)).partie_reelle - = (*((integer8 *) (*s_objet_argument).objet)); + = (real8) (*((integer8 *) (*s_objet_argument).objet)); } else {