--- rpl/src/instructions_s1.c 2013/03/20 17:11:45 1.64 +++ rpl/src/instructions_s1.c 2013/03/21 11:30:30 1.65 @@ -147,9 +147,9 @@ instruction_sq(struct_processus *s_etat_ struct_objet *s_objet_argument; struct_objet *s_objet_resultat; - unsigned long i; - unsigned long j; - unsigned long k; + integer8 i; + integer8 j; + integer8 k; void *accumulateur; @@ -310,8 +310,8 @@ instruction_sq(struct_processus *s_etat_ .objet))).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; @@ -323,8 +323,8 @@ instruction_sq(struct_processus *s_etat_ .objet))).nombre_lignes; i++) { if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau[i] = - malloc((*(((struct_matrice *) (*s_objet_resultat) - .objet))).nombre_colonnes * sizeof(integer8))) == NULL) + malloc(((size_t) (*(((struct_matrice *) (*s_objet_resultat) + .objet))).nombre_colonnes) * sizeof(integer8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -366,8 +366,8 @@ instruction_sq(struct_processus *s_etat_ (*s_objet_resultat).type = MRL; (*((struct_matrice *) (*s_objet_resultat).objet)).type = 'R'; - if ((accumulateur = malloc((*(((struct_matrice *) - (*s_objet_argument).objet))).nombre_colonnes * + if ((accumulateur = malloc(((size_t) (*(((struct_matrice *) + (*s_objet_argument).objet))).nombre_colonnes) * sizeof(real8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -381,8 +381,8 @@ instruction_sq(struct_processus *s_etat_ (*s_objet_resultat).objet)).tableau)[i]); if (((*((struct_matrice *) (*s_objet_resultat).objet)) - .tableau[i] = malloc((*(((struct_matrice *) - (*s_objet_resultat).objet))).nombre_colonnes * + .tableau[i] = malloc(((size_t) (*(((struct_matrice *) + (*s_objet_resultat).objet))).nombre_colonnes) * sizeof(real8))) == NULL) { (*s_etat_processus).erreur_systeme = @@ -457,15 +457,15 @@ instruction_sq(struct_processus *s_etat_ .objet))).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; } - if ((accumulateur = malloc((*(((struct_matrice *) - (*s_objet_argument).objet))).nombre_colonnes * sizeof(real8))) + if ((accumulateur = malloc(((size_t) (*(((struct_matrice *) + (*s_objet_argument).objet))).nombre_colonnes) * sizeof(real8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -476,8 +476,8 @@ instruction_sq(struct_processus *s_etat_ .objet))).nombre_lignes; i++) { if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau[i] = - malloc((*(((struct_matrice *) (*s_objet_resultat) - .objet))).nombre_colonnes * sizeof(real8))) == NULL) + malloc(((size_t) (*(((struct_matrice *) (*s_objet_resultat) + .objet))).nombre_colonnes) * sizeof(real8))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -549,15 +549,16 @@ instruction_sq(struct_processus *s_etat_ .objet))).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; } - if ((accumulateur = malloc((*(((struct_matrice *) - (*s_objet_argument).objet))).nombre_colonnes * + if ((accumulateur = malloc(((size_t) (*(((struct_matrice *) + (*s_objet_argument).objet))).nombre_colonnes) * sizeof(complex16))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -568,8 +569,8 @@ instruction_sq(struct_processus *s_etat_ .objet))).nombre_lignes; i++) { if (((*((struct_matrice *) (*s_objet_resultat).objet)).tableau[i] = - malloc((*(((struct_matrice *) (*s_objet_resultat) - .objet))).nombre_colonnes * sizeof(struct_complexe16))) + malloc(((size_t) (*(((struct_matrice *) (*s_objet_resultat) + .objet))).nombre_colonnes) * sizeof(struct_complexe16))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1216,9 +1217,9 @@ instruction_same(struct_processus *s_eta logical1 difference; - unsigned long i; - unsigned long j; - unsigned long nombre_elements; + integer8 i; + integer8 j; + integer8 nombre_elements; (*s_etat_processus).erreur_execution = d_ex; @@ -3088,10 +3089,11 @@ instruction_stof(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 (((*((logical8 *) (*s_objet).objet)) & ((logical8) 1) << indice_drapeau) != 0) @@ -3412,12 +3414,12 @@ instruction_syseval(struct_processus *s_ unsigned char *registre_programme; unsigned char *tampon; - unsigned long longueur_lecture; - unsigned long longueur_tampon; - unsigned long nombre_iterations; - unsigned long nombre_lignes; - unsigned long pointeur; - unsigned long registre_position_courante; + integer8 longueur_lecture; + integer8 longueur_tampon; + integer8 nombre_iterations; + integer8 nombre_lignes; + integer8 pointeur; + integer8 registre_position_courante; (*s_etat_processus).erreur_execution = d_ex; @@ -3633,7 +3635,8 @@ instruction_syseval(struct_processus *s_ (*s_etat_processus).definitions_chainees = registre_programme; (*s_etat_processus).position_courante = registre_position_courante; - if ((arguments = malloc(nombre_arguments * sizeof(char *))) == NULL) + if ((arguments = malloc(((size_t) nombre_arguments) * sizeof(char *))) + == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -3863,7 +3866,7 @@ instruction_syseval(struct_processus *s_ while(write_atomic(s_etat_processus, pipes_entree[1], ligne, - longueur_ecriture) != longueur_ecriture) + (size_t) longueur_ecriture) != longueur_ecriture) { # ifndef SEMAPHORES_NOMMES while(sem_wait(&((*s_etat_processus) @@ -4017,7 +4020,7 @@ instruction_syseval(struct_processus *s_ pointeur = 0; nombre_iterations = 1; - if ((tampon = malloc((longueur_lecture + 1) * + if ((tampon = malloc(((size_t) (longueur_lecture + 1)) * sizeof(unsigned char))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -4036,9 +4039,9 @@ instruction_syseval(struct_processus *s_ return; } - while((ios = read_atomic(s_etat_processus, + while((ios = (int) read_atomic(s_etat_processus, pipes_sortie[0], &(tampon[pointeur]), - longueur_lecture)) > 0) + (size_t) longueur_lecture)) > 0) { # ifndef SEMAPHORES_NOMMES while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) @@ -4055,8 +4058,8 @@ instruction_syseval(struct_processus *s_ nombre_iterations++; if ((tampon = realloc(tampon, - ((nombre_iterations * longueur_lecture) + 1) * - sizeof(unsigned char))) == NULL) + ((size_t) ((nombre_iterations * longueur_lecture) + 1)) + * sizeof(unsigned char))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -4103,7 +4106,7 @@ instruction_syseval(struct_processus *s_ * Transformation de la chaîne en liste */ - longueur_tampon = strlen(tampon); + longueur_tampon = (integer8) strlen(tampon); for(i = 0, ptr = tampon, nombre_lignes = 0; i < (long) longueur_tampon; i++, ptr++) @@ -4152,7 +4155,7 @@ instruction_syseval(struct_processus *s_ if (((*(*l_element_courant).donnee).objet = analyse_flux(s_etat_processus, ptr, - strlen(ptr))) == NULL) + (integer8) strlen(ptr))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -4876,7 +4879,7 @@ instruction_sci(struct_processus *s_etat return; } - (*((logical8 *) (*s_objet).objet)) = + (*((logical8 *) (*s_objet).objet)) = (logical8) (*((integer8 *) (*s_objet_argument).objet)); i43 = test_cfsf(s_etat_processus, 43); @@ -4914,15 +4917,15 @@ instruction_sci(struct_processus *s_etat { if (valeur_binaire[i] == '0') { - cf(s_etat_processus, j++); + cf(s_etat_processus, (unsigned char) j++); } else { - sf(s_etat_processus, j++); + sf(s_etat_processus, (unsigned char) j++); } } - for(; j <= 56; cf(s_etat_processus, j++)); + for(; j <= 56; cf(s_etat_processus, (unsigned char) j++)); cf(s_etat_processus, 49); sf(s_etat_processus, 50);