Diff for /rpl/src/transliteration.c between versions 1.63 and 1.73

version 1.63, 2013/02/26 19:56:18 version 1.73, 2013/12/03 09:36:16
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.1.12    RPL/2 (R) version 4.1.17
   Copyright (C) 1989-2013 Dr. BERTRAND Joël    Copyright (C) 1989-2013 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
Line 135  reencodage(struct_processus *s_etat_proc Line 135  reencodage(struct_processus *s_etat_proc
                 &longueur_entree, (char **) &pointeur, &longueur_sortie))                  &longueur_entree, (char **) &pointeur, &longueur_sortie))
                 == (size_t) -1)                  == (size_t) -1)
         {          {
             // On autorise les erreurs EINVAL et EILSEQ              // On autorise les erreurs EINVAL si le caractère suivant est non
             if (errno == EILSEQ)              // nul : la séquence d'entrée est continue sur le bloc suivant.
   
               if (errno == EINVAL)
               {
                   if ((*(buffer_entree + 1)) == d_code_fin_chaine)
                   {
                       free(buffer_sortie);
                       free(chaine_sortie);
   
                       // On affiche une erreur ici car la fonction d'affichage
                       // de l'erreur utilise la macro printf() donc une
                       // opération de translitération qui échouera elle aussi.
                       // Le positionnement de l'erreur permet de sortir du
                       // programme.
   
                       if ((*s_etat_processus).langue == 'F')
                       {
                           fprintf(stderr, "+++Erreur : Erreur de transcodage\n");
                       }
                       else
                       {
                           fprintf(stderr, "+++Error : Transcodage error\n");
                       }
   
                       (*s_etat_processus).erreur_execution =
                               d_ex_erreur_transcodage;
                       return(NULL);
                   }
               }
   
               // Si la séquence d'entrée est invalide, on reçoit une erreur
               // EILSEQ.
               else if (errno == EILSEQ)
             {              {
                 free(buffer_sortie);                  free(buffer_sortie);
                 free(chaine_sortie);                  free(chaine_sortie);
Line 204  localisation_courante(struct_processus * Line 236  localisation_courante(struct_processus *
     int                         pipes_sortie[2];      int                         pipes_sortie[2];
     int                         status;      int                         status;
   
     long                        i;      integer8                    i;
     long                        nombre_arguments;      integer8                    longueur_lecture;
       integer8                    nombre_arguments;
       integer8                    nombre_iterations;
       integer8                    pointeur;
   
   
     pid_t                       pid;      pid_t                       pid;
   
     unsigned char               *tampon;      unsigned char               *tampon;
   
     unsigned long               longueur_lecture;  
     unsigned long               nombre_iterations;  
     unsigned long               pointeur;  
   
     if ((arguments = malloc(3 * sizeof(char **))) == NULL)      if ((arguments = malloc(3 * sizeof(char **))) == NULL)
     {      {
         (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;          (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
Line 469  localisation_courante(struct_processus * Line 501  localisation_courante(struct_processus *
         pointeur = 0;          pointeur = 0;
         nombre_iterations = 1;          nombre_iterations = 1;
   
         if ((tampon = malloc((longueur_lecture + 1) *          if ((tampon = malloc(((size_t) (longueur_lecture + 1)) *
                 sizeof(unsigned char))) == NULL)                  sizeof(unsigned char))) == NULL)
         {          {
             (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;              (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
Line 488  localisation_courante(struct_processus * Line 520  localisation_courante(struct_processus *
             return;              return;
         }          }
   
         while((ios = read_atomic(s_etat_processus,          while((ios = (int) read_atomic(s_etat_processus,
                 pipes_sortie[0], &(tampon[pointeur]),                  pipes_sortie[0], &(tampon[pointeur]),
                 longueur_lecture)) > 0)                  (size_t) longueur_lecture)) > 0)
         {          {
 #           ifndef SEMAPHORES_NOMMES  #           ifndef SEMAPHORES_NOMMES
                 while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0)                  while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0)
Line 510  localisation_courante(struct_processus * Line 542  localisation_courante(struct_processus *
             nombre_iterations++;              nombre_iterations++;
   
             if ((tampon = realloc(tampon,              if ((tampon = realloc(tampon,
                     ((nombre_iterations * longueur_lecture) + 1) *                      ((size_t) ((nombre_iterations * longueur_lecture) + 1)) *
                     sizeof(unsigned char))) == NULL)                      sizeof(unsigned char))) == NULL)
             {              {
                 (*s_etat_processus).erreur_systeme =                  (*s_etat_processus).erreur_systeme =

Removed from v.1.63  
changed lines
  Added in v.1.73


CVSweb interface <joel.bertrand@systella.fr>