--- rpl/src/instructions_d1.c 2013/02/27 17:11:41 1.42 +++ rpl/src/instructions_d1.c 2013/03/20 17:11:44 1.43 @@ -527,7 +527,7 @@ instruction_dropn(struct_processus *s_et signed long nombre_suppressions; - unsigned long i; + integer8 i; (*s_etat_processus).erreur_execution = d_ex; @@ -624,14 +624,13 @@ instruction_dropn(struct_processus *s_et return; } - if ((unsigned long) nombre_suppressions > - (*s_etat_processus).hauteur_pile_operationnelle) + if (nombre_suppressions > (*s_etat_processus).hauteur_pile_operationnelle) { (*s_etat_processus).erreur_execution = d_ex_manque_argument; return; } - for(i = 0; i < (unsigned long) nombre_suppressions; i++) + for(i = 0; i < nombre_suppressions; i++) { if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile), &s_objet) == d_erreur) @@ -762,7 +761,7 @@ instruction_dup2(struct_processus *s_eta { struct_objet *s_objet; - unsigned long i; + integer8 i; (*s_etat_processus).erreur_execution = d_ex; @@ -879,8 +878,8 @@ instruction_dupn(struct_processus *s_eta struct_objet *s_objet; struct_objet *s_nouvel_objet; - signed long nombre_duplications; - unsigned long i; + integer8 nombre_duplications; + integer8 i; (*s_etat_processus).erreur_execution = d_ex; @@ -979,7 +978,7 @@ instruction_dupn(struct_processus *s_eta l_element_courant = (*s_etat_processus).l_base_pile; - for(i = 0; i < (unsigned long) nombre_duplications; i++) + for(i = 0; i < nombre_duplications; i++) { if (l_element_courant == NULL) { @@ -1005,7 +1004,7 @@ instruction_dupn(struct_processus *s_eta l_element_courant = (*l_element_courant).suivant; } - for(i = 0; i < (unsigned long) nombre_duplications; i++) + for(i = 0; i < nombre_duplications; i++) { if (depilement(s_etat_processus, &l_base_pile, &s_objet) == d_erreur) { @@ -1057,10 +1056,10 @@ instruction_division(struct_processus *s struct_objet *s_objet_argument_2; struct_objet *s_objet_resultat; - unsigned long i; - unsigned long j; - unsigned long k; - unsigned long nombre_elements; + integer8 i; + integer8 j; + integer8 k; + integer8 nombre_elements; (*s_etat_processus).erreur_execution = d_ex; @@ -2054,8 +2053,8 @@ instruction_division(struct_processus *s (*((struct_vecteur *) (*s_objet_argument_2).objet)).taille; if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau = - malloc((*(((struct_vecteur *) (*s_objet_resultat) - .objet))).taille * sizeof(integer8))) == NULL) + malloc(((size_t) (*(((struct_vecteur *) (*s_objet_resultat) + .objet))).taille) * sizeof(integer8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -2084,8 +2083,8 @@ instruction_division(struct_processus *s (*((struct_vecteur *) (*s_objet_argument_2).objet)).taille; if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau = - malloc((*(((struct_vecteur *) (*s_objet_resultat) - .objet))).taille * sizeof(real8))) == NULL) + malloc(((size_t) (*(((struct_vecteur *) (*s_objet_resultat) + .objet))).taille) * sizeof(real8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -2151,8 +2150,8 @@ instruction_division(struct_processus *s (*((struct_vecteur *) (*s_objet_argument_2).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; @@ -2212,8 +2211,8 @@ instruction_division(struct_processus *s (*((struct_vecteur *) (*s_objet_argument_2).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; @@ -2280,8 +2279,8 @@ instruction_division(struct_processus *s (*((struct_vecteur *) (*s_objet_argument_2).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; @@ -2373,8 +2372,8 @@ instruction_division(struct_processus *s .nombre_colonnes; if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - malloc((*(((struct_matrice *) (*s_objet_resultat) - .objet))).nombre_lignes * sizeof(integer8 *))) == NULL) + malloc(((size_t) (*(((struct_matrice *) (*s_objet_resultat) + .objet))).nombre_lignes) * sizeof(integer8 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -2384,8 +2383,9 @@ instruction_division(struct_processus *s .objet))).nombre_lignes; i++) { if ((((integer8 **) (*((struct_matrice *) (*s_objet_resultat) - .objet)).tableau)[i] = malloc((*(((struct_matrice *) - (*s_objet_resultat).objet))).nombre_colonnes * + .objet)).tableau)[i] = malloc(((size_t) + (*(((struct_matrice *) + (*s_objet_resultat).objet))).nombre_colonnes) * sizeof(integer8))) == NULL) { (*s_etat_processus).erreur_systeme = @@ -2421,8 +2421,8 @@ instruction_division(struct_processus *s .nombre_colonnes; if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - malloc((*(((struct_matrice *) (*s_objet_resultat) - .objet))).nombre_lignes * sizeof(real8 *))) == NULL) + malloc(((size_t) (*(((struct_matrice *) (*s_objet_resultat) + .objet))).nombre_lignes) * sizeof(real8 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -2453,8 +2453,9 @@ instruction_division(struct_processus *s .objet))).nombre_lignes; i++) { if ((((real8 **) (*((struct_matrice *) (*s_objet_resultat) - .objet)).tableau)[i] = malloc((*(((struct_matrice *) - (*s_objet_resultat).objet))).nombre_colonnes * + .objet)).tableau)[i] = malloc(((size_t) + (*(((struct_matrice *) + (*s_objet_resultat).objet))).nombre_colonnes) * sizeof(real8))) == NULL) { (*s_etat_processus).erreur_systeme = @@ -2506,8 +2507,9 @@ instruction_division(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; @@ -2530,8 +2532,8 @@ instruction_division(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; @@ -2585,8 +2587,9 @@ instruction_division(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; @@ -2617,8 +2620,8 @@ instruction_division(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; @@ -2671,8 +2674,9 @@ instruction_division(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; @@ -2695,8 +2699,8 @@ instruction_division(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; @@ -2757,8 +2761,8 @@ instruction_division(struct_processus *s .objet))).taille; if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau = - malloc((*((struct_vecteur *) - (*s_objet_resultat).objet)).taille * sizeof(real8))) == NULL) + malloc(((size_t) (*((struct_vecteur *) + (*s_objet_resultat).objet)).taille) * sizeof(real8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -2808,7 +2812,7 @@ instruction_division(struct_processus *s (*s_objet_resultat).objet)) .tableau)[i] += ((real8 **) (*((struct_matrice *) (*s_objet_argument_1).objet)).tableau)[i][j] * - ((integer8 *) (*((struct_vecteur *) + (real8) ((integer8 *) (*((struct_vecteur *) (*s_objet_argument_2).objet)).tableau)[j]; } else @@ -2855,9 +2859,9 @@ instruction_division(struct_processus *s .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; @@ -2968,9 +2972,9 @@ instruction_division(struct_processus *s .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; @@ -3068,9 +3072,9 @@ instruction_division(struct_processus *s .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; @@ -3172,8 +3176,8 @@ instruction_division(struct_processus *s .objet))).nombre_colonnes; if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - malloc((*((struct_matrice *) - (*s_objet_resultat).objet)).nombre_lignes * sizeof(real8 *))) + malloc(((size_t) (*((struct_matrice *) + (*s_objet_resultat).objet)).nombre_lignes) * sizeof(real8 *))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -3214,8 +3218,8 @@ instruction_division(struct_processus *s (*s_objet_resultat).objet)).nombre_lignes; i++) { if ((((*((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(real8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -3238,7 +3242,7 @@ instruction_division(struct_processus *s .tableau)[i][j] += ((real8 **) (*((struct_matrice *) (*s_objet_argument_1).objet)).tableau)[i][k] * - ((integer8 **) (*((struct_matrice *) + (real8) ((integer8 **) (*((struct_matrice *) (*s_objet_argument_2).objet)).tableau)[k][j]; } else @@ -3289,8 +3293,8 @@ instruction_division(struct_processus *s .objet))).nombre_colonnes; if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - malloc((*((struct_matrice *) - (*s_objet_resultat).objet)).nombre_lignes * + malloc(((size_t) (*((struct_matrice *) + (*s_objet_resultat).objet)).nombre_lignes) * sizeof(struct_complexe16))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -3330,8 +3334,8 @@ instruction_division(struct_processus *s (*s_objet_resultat).objet)).nombre_lignes; i++) { if ((((*((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; @@ -3416,8 +3420,8 @@ instruction_division(struct_processus *s .objet))).nombre_colonnes; if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - malloc((*((struct_matrice *) - (*s_objet_resultat).objet)).nombre_lignes * + malloc(((size_t) (*((struct_matrice *) + (*s_objet_resultat).objet)).nombre_lignes) * sizeof(struct_complexe16))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -3457,8 +3461,8 @@ instruction_division(struct_processus *s (*s_objet_resultat).objet)).nombre_lignes; i++) { if ((((*((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; @@ -3533,8 +3537,8 @@ instruction_division(struct_processus *s .objet))).nombre_colonnes; if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau = - 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; @@ -3574,8 +3578,8 @@ instruction_division(struct_processus *s (*s_objet_resultat).objet)).nombre_lignes; i++) { if ((((*((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; @@ -3670,15 +3674,16 @@ instruction_division(struct_processus *s if ((*s_objet_argument_1).type == BIN) { - (*((logical8 *) (*s_objet_resultat).objet)) = - (*((integer8 *) (*s_objet_argument_2).objet)) - / (*((logical8 *) (*s_objet_argument_1).objet)); + (*((logical8 *) (*s_objet_resultat).objet)) = (logical8) + ((*((integer8 *) (*s_objet_argument_2).objet)) + / ((integer8) (*((logical8 *) + (*s_objet_argument_1).objet)))); } else { - (*((logical8 *) (*s_objet_resultat).objet)) = - (*((logical8 *) (*s_objet_argument_2).objet)) - / (*((integer8 *) (*s_objet_argument_1).objet)); + (*((logical8 *) (*s_objet_resultat).objet)) = (logical8) + (((integer8) (*((logical8 *) (*s_objet_argument_2).objet))) + / (*((integer8 *) (*s_objet_argument_1).objet))); } } @@ -3817,7 +3822,7 @@ instruction_default(struct_processus *s_ unsigned char *instruction_majuscule; unsigned char *tampon; - unsigned long niveau; + integer8 niveau; (*s_etat_processus).erreur_execution = d_ex; @@ -3942,7 +3947,8 @@ instruction_default(struct_processus *s_ { if ((*s_etat_processus).mode_execution_programme == 'Y') { - (*s_etat_processus).position_courante -= (strlen( + (*s_etat_processus).position_courante -= + (integer8) (strlen( instruction_majuscule) + 1); } else