--- rpl/src/instructions_r1.c 2013/02/27 17:11:43 1.41 +++ rpl/src/instructions_r1.c 2013/03/20 22:24:37 1.42 @@ -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; @@ -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; @@ -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; } @@ -504,7 +504,7 @@ instruction_repeat(struct_processus *s_e unsigned char *instruction_majuscule; unsigned char *tampon; - unsigned long niveau; + integer8 niveau; void (*fonction)(); @@ -615,7 +615,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 +869,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) { @@ -1132,7 +1133,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 { @@ -1279,8 +1280,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 +1362,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 +1375,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 +1417,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 +1431,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 +1448,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 +1502,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 +1515,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 +1530,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 +1547,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 +1613,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 +1731,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 +1771,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 +1788,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 +2103,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 {