diff --git a/icu4c/source/extra/ustdio/ustdio.c b/icu4c/source/extra/ustdio/ustdio.c index a30ff237b9..73911a1a82 100644 --- a/icu4c/source/extra/ustdio/ustdio.c +++ b/icu4c/source/extra/ustdio/ustdio.c @@ -93,7 +93,7 @@ u_file_write( const UChar *chars, written += (myTarget - f->fCharBuffer); myTarget = f->fCharBuffer; } - while(status == U_INDEX_OUTOFBOUNDS_ERROR); + while(status == U_BUFFER_OVERFLOW_ERROR); /* return # of chars written */ return written; diff --git a/icu4c/source/samples/XMLConverter/XMLConverter.cpp b/icu4c/source/samples/XMLConverter/XMLConverter.cpp index d4ad4a59e4..9a34483629 100644 --- a/icu4c/source/samples/XMLConverter/XMLConverter.cpp +++ b/icu4c/source/samples/XMLConverter/XMLConverter.cpp @@ -921,8 +921,6 @@ int32_t XMLUConvert( UConverter* inConverter, flush, err); - if (*err == U_INDEX_OUTOFBOUNDS_ERROR) *err = U_BUFFER_OVERFLOW_ERROR; - // *inBufSize = inBufferAlias; return outBufferAlias - outBuffer; } @@ -969,11 +967,11 @@ void XMLU_fromCodepageToCodepage( UConverter* outConverter, flush, err); - /*U_INDEX_OUTOFBOUNDS_ERROR means that the output "CHUNK" is full + /*U_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; @@ -1024,11 +1022,11 @@ void XMLU_fromCodepageToCodepage( UConverter* outConverter, flush, err); - /*U_INDEX_OUTOFBOUNDS_ERROR means that the output "CHUNK" is full + /*U_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; diff --git a/icu4c/source/samples/cal/uprint.c b/icu4c/source/samples/cal/uprint.c index e468ab9092..67fa17a0aa 100644 --- a/icu4c/source/samples/cal/uprint.c +++ b/icu4c/source/samples/cal/uprint.c @@ -66,7 +66,7 @@ uprint(const UChar *s, myTarget = buf; arraySize = BUF_SIZE; } - while(*status == U_INDEX_OUTOFBOUNDS_ERROR); + while(*status == U_BUFFER_OVERFLOW_ERROR); finish: diff --git a/icu4c/source/samples/date/uprint.c b/icu4c/source/samples/date/uprint.c index 54a715c9a4..f43e1721d7 100644 --- a/icu4c/source/samples/date/uprint.c +++ b/icu4c/source/samples/date/uprint.c @@ -67,7 +67,7 @@ uprint(const UChar *s, myTarget = buf; arraySize = BUF_SIZE; } - while(*status == U_INDEX_OUTOFBOUNDS_ERROR); + while(*status == U_BUFFER_OVERFLOW_ERROR); finish: diff --git a/icu4c/source/samples/scsu/compsamp.cpp b/icu4c/source/samples/scsu/compsamp.cpp index 6bbb0b1fe5..d7497d8e3f 100644 --- a/icu4c/source/samples/scsu/compsamp.cpp +++ b/icu4c/source/samples/scsu/compsamp.cpp @@ -242,7 +242,7 @@ UErrorCode compsample_02() scsu_compress(&comp, &target, output+SAMPLE2BUFFERSIZE, &source, input+sourceLen, &status); - if( (status == U_ZERO_ERROR) || (status == U_INDEX_OUTOFBOUNDS_ERROR)) { + if( (status == U_ZERO_ERROR) || (status == U_BUFFER_OVERFLOW_ERROR)) { /* got all of it */ // printBytes("out", output, target-output); // Uncomment for very verbose output.. diff --git a/icu4c/source/samples/ucnv/convsamp.cpp b/icu4c/source/samples/ucnv/convsamp.cpp index bd5352a618..937625c474 100644 --- a/icu4c/source/samples/ucnv/convsamp.cpp +++ b/icu4c/source/samples/ucnv/convsamp.cpp @@ -325,7 +325,7 @@ UErrorCode convsample_03() size of input and output buffer can be used, as long as the program handles the following cases: If the input buffer is empty, the source pointer will be equal to sourceLimit. If the output - buffer is empty, U_INDEX_OUTOFBOUNDS_ERROR will be returned. + buffer has overflowed, U_BUFFER_OVERFLOW_ERROR will be returned. */ UErrorCode convsample_05() @@ -383,7 +383,7 @@ UErrorCode convsample_05() /* is true (when no more data will come) */ &status); - if(status != U_INDEX_OUTOFBOUNDS_ERROR) + if(status == U_BUFFER_OVERFLOW_ERROR) { // simply ran out of space - we'll reset the target ptr the next // time through the loop. diff --git a/icu4c/source/test/cintltst/nccbtst.c b/icu4c/source/test/cintltst/nccbtst.c index f037b907d7..1b14e2519e 100644 --- a/icu4c/source/test/cintltst/nccbtst.c +++ b/icu4c/source/test/cintltst/nccbtst.c @@ -1041,7 +1041,7 @@ UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t } } - } while ( (status == U_INDEX_OUTOFBOUNDS_ERROR) || (U_SUCCESS(status) && (sourceLimit < realSourceEnd)) ); + } while ( (status == U_BUFFER_OVERFLOW_ERROR) || (U_SUCCESS(status) && (sourceLimit < realSourceEnd)) ); if(U_FAILURE(status)) { @@ -1246,7 +1246,7 @@ UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *e } } - } while ( (status == U_INDEX_OUTOFBOUNDS_ERROR) || (U_SUCCESS(status) && (srcLimit < realSourceEnd)) ); /* while we just need another buffer */ + } while ( (status == U_BUFFER_OVERFLOW_ERROR) || (U_SUCCESS(status) && (srcLimit < realSourceEnd)) ); /* while we just need another buffer */ if(U_FAILURE(status)) diff --git a/icu4c/source/test/cintltst/ncnvfbts.c b/icu4c/source/test/cintltst/ncnvfbts.c index 5caa1e908d..b3bbe7d209 100644 --- a/icu4c/source/test/cintltst/ncnvfbts.c +++ b/icu4c/source/test/cintltst/ncnvfbts.c @@ -196,7 +196,7 @@ UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t doFlush, /* flush if we're at the end of the input data */ &status); - } while ( (status == U_INDEX_OUTOFBOUNDS_ERROR) || (sourceLimit < realSourceEnd) ); + } while ( (status == U_BUFFER_OVERFLOW_ERROR) || (sourceLimit < realSourceEnd) ); if(U_FAILURE(status)) { @@ -358,7 +358,7 @@ UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *e checkOffsets ? offs : NULL, (UBool)(srcLimit == realSourceEnd), /* flush if we're at the end of hte source data */ &status); - } while ( (status == U_INDEX_OUTOFBOUNDS_ERROR) || (srcLimit < realSourceEnd) ); /* while we just need another buffer */ + } while ( (status == U_BUFFER_OVERFLOW_ERROR) || (srcLimit < realSourceEnd) ); /* while we just need another buffer */ if(U_FAILURE(status)) diff --git a/icu4c/source/tools/rbdump/uprint.c b/icu4c/source/tools/rbdump/uprint.c index d4aebf209a..a8946707ad 100644 --- a/icu4c/source/tools/rbdump/uprint.c +++ b/icu4c/source/tools/rbdump/uprint.c @@ -77,7 +77,7 @@ uprint(const UChar *s, myTarget = buf; arraySize = BUF_SIZE; } - while(*status == U_INDEX_OUTOFBOUNDS_ERROR); + while(*status == U_BUFFER_OVERFLOW_ERROR); finish: