ICU-2699 Fix some compiler warnings.
X-SVN-Rev: 11690
This commit is contained in:
parent
38eff7394d
commit
58d0bbd305
@ -2834,21 +2834,22 @@ UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t
|
|||||||
&status);
|
&status);
|
||||||
} while ( (status == U_BUFFER_OVERFLOW_ERROR) || (U_SUCCESS(status) && (sourceLimit < realSourceEnd)) );
|
} while ( (status == U_BUFFER_OVERFLOW_ERROR) || (U_SUCCESS(status) && (sourceLimit < realSourceEnd)) );
|
||||||
|
|
||||||
|
|
||||||
if(status==U_INVALID_CHAR_FOUND || status == U_ILLEGAL_CHAR_FOUND){
|
if(status==U_INVALID_CHAR_FOUND || status == U_ILLEGAL_CHAR_FOUND){
|
||||||
UChar errChars[50]; /* should be sufficient */
|
UChar errChars[50]; /* should be sufficient */
|
||||||
int8_t len = 50;
|
int8_t errLen = 50;
|
||||||
UErrorCode err = U_ZERO_ERROR;
|
UErrorCode err = U_ZERO_ERROR;
|
||||||
const UChar* limit= NULL;
|
const UChar* limit= NULL;
|
||||||
const UChar* start= NULL;
|
const UChar* start= NULL;
|
||||||
ucnv_getInvalidUChars(conv,errChars, &len, &err);
|
ucnv_getInvalidUChars(conv,errChars, &errLen, &err);
|
||||||
if(U_FAILURE(err)){
|
if(U_FAILURE(err)){
|
||||||
log_err("ucnv_getInvalidUChars failed with error : %s\n",u_errorName(err));
|
log_err("ucnv_getInvalidUChars failed with error : %s\n",u_errorName(err));
|
||||||
}
|
}
|
||||||
/* src points to limit of invalid chars */
|
/* src points to limit of invalid chars */
|
||||||
limit = src;
|
limit = src;
|
||||||
/* length of in invalid chars should be equal to returned length*/
|
/* length of in invalid chars should be equal to returned length*/
|
||||||
start = src - len;
|
start = src - errLen;
|
||||||
if(u_strncmp(errChars,start,len)!=0){
|
if(u_strncmp(errChars,start,errLen)!=0){
|
||||||
log_err("ucnv_getInvalidUChars did not return the correct invalid chars for encoding %s \n", ucnv_getName(conv,&err));
|
log_err("ucnv_getInvalidUChars did not return the correct invalid chars for encoding %s \n", ucnv_getName(conv,&err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2930,6 +2931,7 @@ UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen,
|
UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen,
|
||||||
const char *codepage, UConverterToUCallback callback, const int32_t *expectOffsets,
|
const char *codepage, UConverterToUCallback callback, const int32_t *expectOffsets,
|
||||||
const char *mySubChar, int8_t len)
|
const char *mySubChar, int8_t len)
|
||||||
@ -3033,19 +3035,19 @@ UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *e
|
|||||||
|
|
||||||
if(status==U_INVALID_CHAR_FOUND || status == U_ILLEGAL_CHAR_FOUND){
|
if(status==U_INVALID_CHAR_FOUND || status == U_ILLEGAL_CHAR_FOUND){
|
||||||
char errChars[50]; /* should be sufficient */
|
char errChars[50]; /* should be sufficient */
|
||||||
int8_t len = 50;
|
int8_t errLen = 50;
|
||||||
UErrorCode err = U_ZERO_ERROR;
|
UErrorCode err = U_ZERO_ERROR;
|
||||||
const uint8_t* limit= NULL;
|
const uint8_t* limit= NULL;
|
||||||
const uint8_t* start= NULL;
|
const uint8_t* start= NULL;
|
||||||
ucnv_getInvalidChars(conv,errChars, &len, &err);
|
ucnv_getInvalidChars(conv,errChars, &errLen, &err);
|
||||||
if(U_FAILURE(err)){
|
if(U_FAILURE(err)){
|
||||||
log_err("ucnv_getInvalidChars failed with error : %s\n",u_errorName(err));
|
log_err("ucnv_getInvalidChars failed with error : %s\n",u_errorName(err));
|
||||||
}
|
}
|
||||||
/* src points to limit of invalid chars */
|
/* src points to limit of invalid chars */
|
||||||
limit = src;
|
limit = src;
|
||||||
/* length of in invalid chars should be equal to returned length*/
|
/* length of in invalid chars should be equal to returned length*/
|
||||||
start = src - len;
|
start = src - errLen;
|
||||||
if(uprv_strncmp(errChars,(char*)start,len)!=0){
|
if(uprv_strncmp(errChars,(char*)start,errLen)!=0){
|
||||||
log_err("ucnv_getInvalidChars did not return the correct invalid chars for encoding %s \n", ucnv_getName(conv,&err));
|
log_err("ucnv_getInvalidChars did not return the correct invalid chars for encoding %s \n", ucnv_getName(conv,&err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user