From cb65962ab641f2cd0dd899244f598d5d5a7afb9b Mon Sep 17 00:00:00 2001 From: Alan Liu Date: Wed, 19 May 2004 17:28:20 +0000 Subject: [PATCH] ICU-3500 fix msvc6 warnings X-SVN-Rev: 15405 --- icu4c/source/common/uloc.c | 2 +- icu4c/source/i18n/calendar.cpp | 1 - icu4c/source/test/cintltst/cintltst.c | 6 ++++-- icu4c/source/test/cintltst/cintltst.h | 6 +++++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/icu4c/source/common/uloc.c b/icu4c/source/common/uloc.c index 2dfdfddbea2..66b8f789268 100644 --- a/icu4c/source/common/uloc.c +++ b/icu4c/source/common/uloc.c @@ -968,7 +968,7 @@ _canonicalize(const char* localeID, } while(fieldCount<2); } posixVariantSize = _getVariantEx(localeID+1, '@', name+i, nameCapacity-i, - variantSize > 0); + (UBool)(variantSize > 0)); if (posixVariantSize > 0) { if (variant == NULL) { variant = name+i; diff --git a/icu4c/source/i18n/calendar.cpp b/icu4c/source/i18n/calendar.cpp index 4f71ee8f9f5..c15952c987d 100644 --- a/icu4c/source/i18n/calendar.cpp +++ b/icu4c/source/i18n/calendar.cpp @@ -234,7 +234,6 @@ class DefaultCalendarFactory : public ICUResourceBundleFactory { // fetch default calendar id const char *defaultCal = NULL; char funcEquiv[256]; - char keywordVal[ULOC_KEYWORD_AND_VALUES_CAPACITY]; ures_getFunctionalEquivalent(funcEquiv, sizeof(funcEquiv)-1, NULL, "calendar", "calendar", loc.getName(), diff --git a/icu4c/source/test/cintltst/cintltst.c b/icu4c/source/test/cintltst/cintltst.c index ed62fbd2e3a..cdc7267baff 100644 --- a/icu4c/source/test/cintltst/cintltst.c +++ b/icu4c/source/test/cintltst/cintltst.c @@ -692,7 +692,9 @@ U_CFUNC UBool assertSuccess(const char* msg, UErrorCode* ec) { return TRUE; } -U_CFUNC UBool assertTrue(const char* msg, UBool condition) { +/* if 'condition' is a UBool, the compiler complains bitterly about + expressions like 'a > 0' which it evaluates as int */ +U_CFUNC UBool assertTrue(const char* msg, int /*not UBool*/ condition) { if (!condition) { log_err("FAIL: assertTrue() failed: %s\n", msg); } @@ -701,7 +703,7 @@ U_CFUNC UBool assertTrue(const char* msg, UBool condition) { log_verbose("Ok: %s\n", msg); } #endif - return condition; + return (UBool)condition; } U_CFUNC UBool assertEquals(const char* message, const char* expected, diff --git a/icu4c/source/test/cintltst/cintltst.h b/icu4c/source/test/cintltst/cintltst.h index 9771a9ce8b9..6f265e193ca 100644 --- a/icu4c/source/test/cintltst/cintltst.h +++ b/icu4c/source/test/cintltst/cintltst.h @@ -91,8 +91,12 @@ U_CFUNC UBool assertSuccess(const char* msg, UErrorCode* ec); /** * Assert that the UBool is TRUE, and return TRUE if it does. + * + * NOTE: Use 'int condition' rather than 'UBool condition' so the + * compiler doesn't complain about integral conversion of expressions + * like 'p != 0'. */ -U_CFUNC UBool assertTrue(const char* msg, UBool condition); +U_CFUNC UBool assertTrue(const char* msg, int condition); /** * Assert that the actualString equals the expectedString, and return