You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ar...@locus.apache.org on 2000/09/12 19:06:50 UTC

cvs commit: xml-xerces/c/src/util/Transcoders/Iconv400 Iconv400TransService.cpp iconv_cnv.c

aruna1      00/09/12 10:06:50

  Modified:    c/src/util/Transcoders/Iconv400 Iconv400TransService.cpp
                        iconv_cnv.c
  Log:
  Replaced INDEX_OUTOFBOUNDS error to BUFFER_OVERFLOW error for toUnicode and from_Unicode functions for compatibility with icu 1.6
  
  Revision  Changes    Path
  1.3       +4 -1      xml-xerces/c/src/util/Transcoders/Iconv400/Iconv400TransService.cpp
  
  Index: Iconv400TransService.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/Transcoders/Iconv400/Iconv400TransService.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Iconv400TransService.cpp	2000/02/11 03:06:58	1.2
  +++ Iconv400TransService.cpp	2000/09/12 17:06:48	1.3
  @@ -56,6 +56,9 @@
   
   /**
    * $Log: Iconv400TransService.cpp,v $
  + * Revision 1.3  2000/09/12 17:06:48  aruna1
  + * Replaced INDEX_OUTOFBOUNDS error to BUFFER_OVERFLOW error for toUnicode and from_Unicode functions for compatibility with icu 1.6
  + *
    * Revision 1.2  2000/02/11 03:06:58  rahulj
    * Cosmetic changes. Replaced tabs with appropriate number of spaces.
    *
  @@ -375,7 +378,7 @@
           , &err
       );
   
  -    if ((err != U_ZERO_ERROR) && (err != U_INDEX_OUTOFBOUNDS_ERROR))
  +    if ((err != U_ZERO_ERROR) && (err != U_BUFFER_OVERFLOW_ERROR))
           ThrowXML(TranscodingException, XML4CExcepts::Trans_CouldNotXCodeXMLData);
   
       // Calculate the bytes eaten and store in caller's param
  
  
  
  1.2       +17 -14    xml-xerces/c/src/util/Transcoders/Iconv400/iconv_cnv.c
  
  Index: iconv_cnv.c
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/Transcoders/Iconv400/iconv_cnv.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- iconv_cnv.c	2000/02/10 18:08:28	1.1
  +++ iconv_cnv.c	2000/09/12 17:06:49	1.2
  @@ -56,6 +56,9 @@
   
   /**
    * $Log: iconv_cnv.c,v $
  + * Revision 1.2  2000/09/12 17:06:49  aruna1
  + * Replaced INDEX_OUTOFBOUNDS error to BUFFER_OVERFLOW error for toUnicode and from_Unicode functions for compatibility with icu 1.6
  + *
    * Revision 1.1  2000/02/10 18:08:28  abagchi
    * Initial checkin
    *
  @@ -294,13 +297,13 @@
   
     if (targetSize == 0)
       {
  -      *err = U_INDEX_OUTOFBOUNDS_ERROR;
  +      *err = U_BUFFER_OVERFLOW_ERROR;
       }
   
     /* If the output buffer is exhausted, we need to stop writing
      * to it but continue the conversion in order to store in targetSize
      * the number of bytes that was required*/
  -  if (*err == U_INDEX_OUTOFBOUNDS_ERROR)
  +  if (*err == U_BUFFER_OVERFLOW_ERROR)
       {
         char target2[CHUNK_SIZE];
         char *target2_alias = target2;
  @@ -310,7 +313,7 @@
          *(in case the output is greater than CHUNK_SIZE)
          */
   
  -      while (*err == U_INDEX_OUTOFBOUNDS_ERROR)
  +      while (*err == U_BUFFER_OVERFLOW_ERROR)
   	{
   	  *err = U_ZERO_ERROR;
   	  target2_alias = target2;
  @@ -401,14 +404,14 @@
     targetCapacity += myTarget - target;
     if (targetSize == 0)
       {
  -      *err = U_INDEX_OUTOFBOUNDS_ERROR;
  +      *err = U_BUFFER_OVERFLOW_ERROR;
       }
     /* If the output buffer is exhausted, we need to stop writing
      * to it but if the input buffer is not exhausted,
      * we need to continue the conversion in order to store in targetSize
      * the number of bytes that was required
      */
  -  if (*err == U_INDEX_OUTOFBOUNDS_ERROR)
  +  if (*err == U_BUFFER_OVERFLOW_ERROR)
       {
         UChar target2[CHUNK_SIZE];
         UChar *target2_alias = target2;
  @@ -417,7 +420,7 @@
         /*We use a stack allocated buffer around which we loop
            (in case the output is greater than CHUNK_SIZE) */
   
  -      while (*err == U_INDEX_OUTOFBOUNDS_ERROR)
  +      while (*err == U_BUFFER_OVERFLOW_ERROR)
   	{
   	  *err = U_ZERO_ERROR;
   	  target2_alias = target2;
  @@ -504,11 +507,11 @@
   		      flush,
   		      err);
   
  -      /*INDEX_OUTOFBOUNDS_ERROR means that the output "CHUNK" is full
  +      /*BUFFER_OVERFLOW_ERROR means that the output "CHUNK" is full
          *we will require at least another loop (it's a recoverable error)
          */
   
  -      if (U_SUCCESS (*err) || (*err == U_INDEX_OUTOFBOUNDS_ERROR))
  +      if (U_SUCCESS (*err) || (*err == U_BUFFER_OVERFLOW_ERROR))
   	{
   	  *err = U_ZERO_ERROR;
   	  out_chunk_alias2 = out_chunk;
  @@ -596,13 +599,13 @@
     targetCapacity = myTarget - target;
     if (targetSize == 0)
       {
  -      *err = U_INDEX_OUTOFBOUNDS_ERROR;
  +      *err = U_BUFFER_OVERFLOW_ERROR;
       }
   
     /* If the output buffer is exhausted, we need to stop writing
      * to it but continue the conversion in order to store in targetSize
      * the number of bytes that was required*/
  -  if (*err == U_INDEX_OUTOFBOUNDS_ERROR)
  +  if (*err == U_BUFFER_OVERFLOW_ERROR)
       {
         char target2[CHUNK_SIZE];
         char *target2_alias = target2;
  @@ -612,7 +615,7 @@
          *(in case the output is greater than CHUNK_SIZE)
          */
   
  -      while (*err == U_INDEX_OUTOFBOUNDS_ERROR)
  +      while (*err == U_BUFFER_OVERFLOW_ERROR)
   	{
   	  *err = U_ZERO_ERROR;
   	  target2_alias = target2;
  @@ -665,7 +668,7 @@
     if (errno!=0)
       if (errno == E2BIG)
         {
  -	  *err = U_INDEX_OUTOFBOUNDS_ERROR;
  +	  *err = U_BUFFER_OVERFLOW_ERROR;
             return; 
         }
       else
  @@ -712,7 +715,7 @@
     {
       if (errno == E2BIG)
         {
  -	  *err = U_INDEX_OUTOFBOUNDS_ERROR;
  +	  *err = U_BUFFER_OVERFLOW_ERROR;
             return; 
         }
       else