ICU-535 fixed some compiler warnings

X-SVN-Rev: 2282
This commit is contained in:
George Rhoten 2000-08-16 01:28:16 +00:00
parent 88aa431c49
commit 5acb7ee264
8 changed files with 17 additions and 15 deletions

View File

@ -1867,7 +1867,7 @@ void CalendarRegressionTest::TestJ81() {
(sign==PLUS>0 ? DATA[i].after : DATA[i].before);
cal.setTime(date, status);
if (U_FAILURE(status)) {
errln((UnicodeString)"FAIL: setTime returned error code " + status);
errln((UnicodeString)"FAIL: setTime returned error code " + u_errorName(status));
continue;
}
if (action == ADD) {
@ -1878,12 +1878,12 @@ void CalendarRegressionTest::TestJ81() {
if (U_FAILURE(status)) {
errln((UnicodeString)"FAIL: " +
(action==ADD?"add ":"roll ") + FIELD_NAME[DATA[i].field] +
" returned error code " + status);
" returned error code " + u_errorName(status));
continue;
}
UDate result = cal.getTime(status);
if (U_FAILURE(status)) {
errln((UnicodeString)"FAIL: getTime returned error code " + status);
errln((UnicodeString)"FAIL: getTime returned error code " + u_errorName(status));
continue;
}
if (result == expected) {

View File

@ -224,7 +224,7 @@ void ConvertTest::TestConvert()
someConverters[0] = new UnicodeConverter;
someConverters[1] = new UnicodeConverter;
someConverters[2] = new UnicodeConverter("utf8", err);
if (U_FAILURE(err)) errln ((UnicodeString)"FAILURE! " + err);
if (U_FAILURE(err)) errln ((UnicodeString)"FAILURE! " + myErrorName(err));
logln("\n---Testing getName...");

View File

@ -60,7 +60,7 @@ void CollationCurrencyTest::currencyTest(char *par)
};
int32_t i, j;
uint32_t i, j;
UErrorCode status = U_ZERO_ERROR;
Collator::EComparisonResult expectedResult = Collator::EQUAL;
RuleBasedCollator *c = (RuleBasedCollator *)Collator::createInstance(status);

View File

@ -133,7 +133,7 @@ randul()
}
// Assume rand has at least 12 bits of precision
uint32_t l = 0;
for (int32_t i=0; i<sizeof(l); ++i)
for (uint32_t i=0; i<sizeof(l); ++i)
((char*)&l)[i] = (char)((rand() & 0x0FF0) >> 4);
return l;
}

View File

@ -133,7 +133,7 @@ randul()
}
// Assume rand has at least 12 bits of precision
uint32_t l = 0;
for (int32_t i=0; i<sizeof(l); ++i)
for (uint32_t i=0; i<sizeof(l); ++i)
((char*)&l)[i] = (char)((rand() & 0x0FF0) >> 4);
return l;
}
@ -349,7 +349,8 @@ NewResourceBundleTest::TestIteration()
if(U_FAILURE(err)){
errln("Construction failed");
}
int32_t i, count, row=0, col=0;
uint32_t i;
int32_t count, row=0, col=0;
char buf[5];
UnicodeString expected;
UnicodeString element("TE_IN");

View File

@ -18,7 +18,7 @@
// tests have obvious memory leaks!
static UBool chkstatus( UErrorCode &status, char* msg = NULL )
static UBool chkstatus( UErrorCode &status, const char* msg = NULL )
{
UBool ok = U_SUCCESS(status);
if (!ok) it_errln( msg );
@ -494,7 +494,7 @@ static double randDouble()
// Assume 8-bit (or larger) rand values. Also assume
// that the system rand() function is very poor, which it always is.
double d = 0;
int32_t i;
uint32_t i;
char* poke = (char*)&d;
for (i=0; i < sizeof(double); ++i)
{

View File

@ -9,6 +9,7 @@
*/
#include "thcoll.h"
#include "unicode/utypes.h"
#include "unicode/coll.h"
#include "unicode/sortkey.h"
#include "cstring.h"
@ -150,7 +151,7 @@ void CollationThaiTest::TestDictionary(void) {
coll->getCollationKey(lastWord, k1, status);
coll->getCollationKey(word, k2, status);
if (U_FAILURE(status)) {
errln((UnicodeString)"Fail: getCollationKey returned " + status);
errln((UnicodeString)"Fail: getCollationKey returned " + u_errorName(status));
return;
}
msg.append("key1: ").append(prettify(k1, str)).append("\n");
@ -265,7 +266,7 @@ void CollationThaiTest::compareArray(const Collator& c, const char* tests[],
c.getCollationKey(s1, k1, status);
c.getCollationKey(s2, k2, status);
if (U_FAILURE(status)) {
errln((UnicodeString)"Fail: getCollationKey returned " + status);
errln((UnicodeString)"Fail: getCollationKey returned " + u_errorName(status));
return;
}
errln((UnicodeString)" key1: " + prettify(k1, t1) );
@ -278,7 +279,7 @@ void CollationThaiTest::compareArray(const Collator& c, const char* tests[],
c.getCollationKey(s1, k1, status);
c.getCollationKey(s2, k2, status);
if (U_FAILURE(status)) {
errln((UnicodeString)"Fail: getCollationKey returned " + status);
errln((UnicodeString)"Fail: getCollationKey returned " + u_errorName(status));
return;
}

View File

@ -62,7 +62,7 @@ static double randDouble()
// Assume 8-bit (or larger) rand values. Also assume
// that the system rand() function is very poor, which it always is.
double d;
int32_t i;
uint32_t i;
char* poke = (char*)&d;
for (i=0; i < sizeof(double); ++i)
{
@ -79,7 +79,7 @@ static uint32_t randLong()
// Assume 8-bit (or larger) rand values. Also assume
// that the system rand() function is very poor, which it always is.
uint32_t d;
int32_t i;
uint32_t i;
char* poke = (char*)&d;
for (i=0; i < sizeof(uint32_t); ++i)
{