ICU-3905 Fix some compiler warnings
X-SVN-Rev: 16756
This commit is contained in:
parent
526617139e
commit
bcead7df44
@ -326,7 +326,7 @@ void TestQuotePattern161()
|
||||
u_uastrcpy(exp, expStr);
|
||||
|
||||
log_verbose("%s\n", austrdup(dateString) );
|
||||
if(u_strncmp(dateString, exp, strlen(expStr)) !=0)
|
||||
if(u_strncmp(dateString, exp, (int32_t)strlen(expStr)) !=0)
|
||||
log_err("Error in formatting a pattern with single quotes\n");
|
||||
|
||||
udat_close(format);
|
||||
|
@ -753,6 +753,7 @@ findSetMatch( UScriptCode *scriptCodes, int32_t scriptsLen,
|
||||
const char *locale){
|
||||
USet *scripts[10]= {0};
|
||||
char pattern[256] = { '[', ':', 0x000 };
|
||||
int32_t patternLen;
|
||||
UChar uPattern[256] = {0};
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
int32_t i;
|
||||
@ -761,8 +762,9 @@ findSetMatch( UScriptCode *scriptCodes, int32_t scriptsLen,
|
||||
for(i = 0; i<scriptsLen; i++){
|
||||
strcat(pattern, uscript_getShortName(scriptCodes[i]));
|
||||
strcat(pattern, ":]");
|
||||
u_charsToUChars(pattern, uPattern, strlen(pattern));
|
||||
scripts[i] = uset_openPattern(uPattern, strlen(pattern), &status);
|
||||
patternLen = (int32_t)strlen(pattern);
|
||||
u_charsToUChars(pattern, uPattern, patternLen);
|
||||
scripts[i] = uset_openPattern(uPattern, patternLen, &status);
|
||||
if(U_FAILURE(status)){
|
||||
log_err("Could not create set for patter %s. Error: %s\n", pattern, u_errorName(status));
|
||||
break;
|
||||
|
@ -432,7 +432,7 @@ static void TestCurrency(void)
|
||||
if(U_FAILURE(status)) {
|
||||
log_err("Error in formatting using unum_formatDouble(.....): %s\n", myErrorName(status) );
|
||||
}
|
||||
u_charsToUChars(result[i], res, strlen(result[i])+1);
|
||||
u_charsToUChars(result[i], res, (int32_t)strlen(result[i])+1);
|
||||
if (u_strcmp(str, res) != 0){
|
||||
log_err("FAIL: Expected %s Got: %s for locale: %s\n", result[i], aescstrdup(str, -1), locale[i]);
|
||||
}
|
||||
|
@ -208,6 +208,7 @@ static void TestPUtilAPI(void){
|
||||
|
||||
{
|
||||
const char* dataDirectory;
|
||||
int32_t dataDirectoryLen;
|
||||
UChar *udataDir=0;
|
||||
UChar temp[100];
|
||||
char *charvalue=0;
|
||||
@ -218,8 +219,9 @@ static void TestPUtilAPI(void){
|
||||
/*dataDirectory=u_getDataDirectory();*/
|
||||
|
||||
dataDirectory="directory1"; /*no backslashes*/
|
||||
udataDir=(UChar*)malloc(sizeof(UChar) * (strlen(dataDirectory) + 1));
|
||||
u_charsToUChars(dataDirectory, udataDir, (strlen(dataDirectory)+1));
|
||||
dataDirectoryLen=(int32_t)strlen(dataDirectory);
|
||||
udataDir=(UChar*)malloc(sizeof(UChar) * (dataDirectoryLen + 1));
|
||||
u_charsToUChars(dataDirectory, udataDir, (dataDirectoryLen + 1));
|
||||
u_uastrcpy(temp, dataDirectory);
|
||||
|
||||
if(u_strcmp(temp, udataDir) != 0){
|
||||
|
@ -141,20 +141,7 @@ static char *toCharString(const UChar* unichars)
|
||||
*temp ++ = (char)ch;
|
||||
}
|
||||
else {
|
||||
char digit[5];
|
||||
int zerosize;
|
||||
*temp = 0;
|
||||
strcat(temp, "\\u");
|
||||
temp = temp + 2;
|
||||
sprintf(digit, "%x", ch);
|
||||
zerosize = 4 - strlen(digit);
|
||||
while (zerosize != 0) {
|
||||
*temp ++ = '0';
|
||||
zerosize --;
|
||||
}
|
||||
*temp = 0;
|
||||
strcat(temp, digit);
|
||||
temp = temp + strlen(digit);
|
||||
sprintf(temp, "\\u%04x", ch);
|
||||
}
|
||||
}
|
||||
*temp = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user