From b51bdf2a60a9d83ad741b06f2174845ca8dec412 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Thu, 23 Mar 2006 05:53:36 +0000 Subject: [PATCH] ICU-4707 Fix some compiler warnings. X-SVN-Rev: 19417 --- icu4c/source/common/ucnv_u16.c | 14 +++++++------- icu4c/source/test/cintltst/cldrtest.c | 4 ++-- icu4c/source/test/cintltst/cnumtst.c | 8 +++++--- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/icu4c/source/common/ucnv_u16.c b/icu4c/source/common/ucnv_u16.c index 93123b596cb..257fa346cf0 100644 --- a/icu4c/source/common/ucnv_u16.c +++ b/icu4c/source/common/ucnv_u16.c @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (C) 2002-2005, International Business Machines +* Copyright (C) 2002-2006, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * file name: ucnv_u16.c @@ -40,7 +40,7 @@ _UTF16BEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; const UChar *source; - uint8_t *target; + char *target; int32_t *offsets; int32_t targetCapacity, length, sourceIndex; @@ -73,7 +73,7 @@ _UTF16BEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, return; } - target=(uint8_t *)pArgs->target; + target=pArgs->target; offsets=pArgs->offsets; sourceIndex=0; @@ -594,7 +594,7 @@ _UTF16LEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; const UChar *source; - uint8_t *target; + char *target; int32_t *offsets; int32_t targetCapacity, length, sourceIndex; @@ -627,7 +627,7 @@ _UTF16LEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, return; } - target=(uint8_t *)pArgs->target; + target=pArgs->target; offsets=pArgs->offsets; sourceIndex=0; @@ -777,7 +777,7 @@ _UTF16LEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, /* output length bytes with overflow (length>targetCapacity>0) */ ucnv_fromUWriteBytes(cnv, overflow, length, - (char **)&target, pArgs->targetLimit, + &target, pArgs->targetLimit, &offsets, sourceIndex, pErrorCode); targetCapacity=(int32_t)(pArgs->targetLimit-(char *)target); @@ -789,7 +789,7 @@ _UTF16LEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, /* write back the updated pointers */ pArgs->source=source; - pArgs->target=(char *)target; + pArgs->target=target; pArgs->offsets=offsets; } diff --git a/icu4c/source/test/cintltst/cldrtest.c b/icu4c/source/test/cintltst/cldrtest.c index e93a779a4ee..ce8c5206f1b 100644 --- a/icu4c/source/test/cintltst/cldrtest.c +++ b/icu4c/source/test/cintltst/cldrtest.c @@ -1,6 +1,6 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 1997-2005, International Business Machines Corporation and + * Copyright (c) 1997-2006, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ @@ -1170,8 +1170,8 @@ static void TestCoverage(void){ for(i = 0; i < ULOCDATA_DELIMITER_COUNT; i++){ - UErrorCode status = U_ZERO_ERROR; UChar result[32] = {0,}; + status = U_ZERO_ERROR; ulocdata_getDelimiter(uld, types[i], result, 32, &status); if (U_FAILURE(status)){ log_err("ulocdata_getgetDelimiter error with type %d", types[i]); diff --git a/icu4c/source/test/cintltst/cnumtst.c b/icu4c/source/test/cintltst/cnumtst.c index a5b867cc47e..dd510b270f1 100644 --- a/icu4c/source/test/cintltst/cnumtst.c +++ b/icu4c/source/test/cintltst/cnumtst.c @@ -1,6 +1,6 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 1997-2005, International Business Machines Corporation and + * Copyright (c) 1997-2006, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ /******************************************************************************** @@ -44,7 +44,7 @@ void addNumForTest(TestNode** root) TESTCASE(TestNumberFormatPadding); TESTCASE(TestInt64Format); TESTCASE(TestNonExistentCurrency); - /*TESTCASE(TestCurrencyRegression);*/ + TESTCASE(TestCurrencyRegression); TESTCASE(TestRBNFFormat); } @@ -1287,7 +1287,8 @@ static void TestRBNFFormat() { } } -static void TestCurrencyRegression() { +static void TestCurrencyRegression(void) { +#if U_ICU_VERSION_MAJOR_NUM > 3 || U_ICU_VERSION_MINOR_NUM > 5 /* I've found a case where unum_parseDoubleCurrency is not doing what I expect. The value I pass in is $1234567890q123460000.00 and this @@ -1342,6 +1343,7 @@ their data! } unum_close(cur); +#endif } #endif /* #if !UCONFIG_NO_FORMATTING */