ICU-535 Removed warnings

X-SVN-Rev: 2221
This commit is contained in:
Madhu K 2000-08-14 17:13:09 +00:00
parent 3537b00807
commit ec02ab0d69
13 changed files with 51 additions and 51 deletions

View File

@ -329,17 +329,17 @@ void TestConvert()
int32_t targetLimit=0, sourceLimit=0, i=0, targetCapacity=0;
const uint8_t source[]={ 0x00, 0x04, 0x05, 0x06, 0xa2, 0xb4, 0x00};
const uint8_t expectedTarget[]={ 0x00, 0x37, 0x2d, 0x2e, 0x0e, 0x49, 0x62, 0x0f, 0x00};
char *target;
char *target=0;
sourceLimit=sizeof(source)/sizeof(source[0]);
err=U_ZERO_ERROR;
targetLimit=0;
targetCapacity=ucnv_convert("ibm-1364", "ibm-1363", NULL, targetLimit , source, sourceLimit, &err);
targetCapacity=ucnv_convert("ibm-1364", "ibm-1363", NULL, targetLimit , (const char*)source, sourceLimit, &err);
if(err == U_BUFFER_OVERFLOW_ERROR){
err=U_ZERO_ERROR;
targetLimit=targetCapacity+1;
target=(char*)malloc(sizeof(char) * targetLimit);
targetCapacity=ucnv_convert("ibm-1364", "ibm-1363", target, targetLimit , source, sourceLimit, &err);
targetCapacity=ucnv_convert("ibm-1364", "ibm-1363", target, targetLimit , (const char*)source, sourceLimit, &err);
}
if(U_FAILURE(err)){
log_err("FAILURE! ucnv_convert(ibm-1363->ibm-1364) failed. %s\n", myErrorName(err));
@ -351,23 +351,23 @@ void TestConvert()
}
}
/*Test error conditions*/
i=ucnv_convert("ibm-1364", "ibm-1363", target, targetLimit , source, 0, &err);
i=ucnv_convert("ibm-1364", "ibm-1363", target, targetLimit , (const char*)source, 0, &err);
if(i !=0){
log_err("FAILURE! ucnv_convert() with sourceLimit=0 is expected to return 0\n");
}
ucnv_convert("ibm-1364", "ibm-1363", target, targetLimit , source, -1, &err);
ucnv_convert("ibm-1364", "ibm-1363", target, targetLimit , (const char*)source, -1, &err);
if(!(U_FAILURE(err) && err==U_ILLEGAL_ARGUMENT_ERROR)){
log_err("FAILURE! ucnv_convert() with sourceLimit=-1 is expected to fail\n");
}
sourceLimit=sizeof(source)/sizeof(source[0]);
i=ucnv_convert("ibm-1364", "ibm-1363", target, targetLimit , source, sourceLimit, &err);
i=ucnv_convert("ibm-1364", "ibm-1363", target, targetLimit , (const char*)source, sourceLimit, &err);
if(i !=0 ){
log_err("FAILURE! ucnv_convert() with err=U_ILLEGAL_ARGUMENT_ERROR is expected to return 0\n");
}
err=U_ZERO_ERROR;
sourceLimit=sizeof(source)/sizeof(source[0]);
targetLimit=0;
i=ucnv_convert("ibm-1364", "ibm-1363", target, targetLimit , source, sourceLimit, &err);
i=ucnv_convert("ibm-1364", "ibm-1363", target, targetLimit , (const char*)source, sourceLimit, &err);
if(!(U_FAILURE(err) && err==U_BUFFER_OVERFLOW_ERROR)){
log_err("FAILURE! ucnv_convert() with targetLimit=0 is expected to throw U_BUFFER_OVERFLOW_ERROR\n");
}
@ -410,7 +410,7 @@ void TestConvert()
ucnv_close(someConverters[2]);
ucnv_close(someConverters[3]);
if (j=(flushCount=ucnv_flushCache())==2)
if ((flushCount=ucnv_flushCache())==2)
log_verbose("Flush cache ok\n"); /*because first, second and third are same */
else
log_err("Flush Cache failed line %d, got %d expected 2 or there is an error in ucnv_close()\n",

View File

@ -51,8 +51,8 @@ void TestDateFormat()
UFieldPosition pos;
UDate d = 837039928046.0;
double num = -10456.37;
const char* str="yyyy.MM.dd G 'at' hh:mm:ss z";
const char t[]="2/3/76 2:50 AM";
/*const char* str="yyyy.MM.dd G 'at' hh:mm:ss z";
const char t[]="2/3/76 2:50 AM";*/
/*Testing udat_open() to open a dateformat */
log_verbose("\nTesting udat_open() with various parameters\n");
fr = udat_open(UDAT_FULL, UDAT_DEFAULT, "fr_FR", NULL,0, &status);
@ -311,7 +311,7 @@ void TestSymbols()
{
UDateFormat *def, *fr;
UErrorCode status = U_ZERO_ERROR;
UChar *value;
UChar *value=NULL;
UChar *result = NULL;
int32_t resultlength;
int32_t resultlengthout;
@ -524,9 +524,9 @@ free(pattern);
/*INTERNAL FUNCTIONS USED*/
void VerifygetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t index, const char* expected)
{
UChar *pattern;
UChar *pattern=NULL;
UErrorCode status = U_ZERO_ERROR;
UChar *result;
UChar *result=NULL;
int32_t resultlength, resultlengthout;
@ -559,8 +559,8 @@ void VerifygetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t i
void VerifysetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t index, const char* expected)
{
UChar *result;
UChar *value;
UChar *result=NULL;
UChar *value=NULL;
int32_t resultlength, resultlengthout;
UErrorCode status = U_ZERO_ERROR;
@ -601,8 +601,8 @@ void VerifysetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t i
void VerifygetsetSymbols(UDateFormat* from, UDateFormat* to, UDateFormatSymbolType type, int32_t index)
{
UChar *result;
UChar *value;
UChar *result=NULL;
UChar *value=NULL;
int32_t resultlength, resultlengthout;
UErrorCode status = U_ZERO_ERROR;
@ -656,7 +656,7 @@ void VerifygetsetSymbols(UDateFormat* from, UDateFormat* to, UDateFormatSymbolTy
UChar* myNumformat(const UNumberFormat* numfor, double d)
{
UChar *result2;
UChar *result2=NULL;
int32_t resultlength, resultlengthneeded;
UFieldPosition pos;
UErrorCode status = U_ZERO_ERROR;

View File

@ -171,7 +171,7 @@ void tryPat994(UDateFormat* format, const char* pattern, const char* s, UDate ex
void TestRunTogetherPattern985()
{
int32_t pos;
UChar *pattern, *now, *then;
UChar *pattern=NULL, *now=NULL, *then=NULL;
UDateFormat *format;
UDate date1, date2;
UErrorCode status = U_ZERO_ERROR;
@ -203,7 +203,7 @@ void TestRunTogetherPattern985()
void TestCzechMonths459()
{
int32_t lneed, pos;
UChar *pattern, *tzID;
UChar *pattern=NULL, *tzID=NULL;
UChar *juneStr, *julyStr;
UDateFormat *fmt;
UCalendar *cal;

View File

@ -229,8 +229,8 @@ void aux917( UDateFormat *fmt, UChar* str)
{
int32_t resultlength, resultlengthneeded;
UErrorCode status = U_ZERO_ERROR;
UChar* formatted;
UChar *pat;
UChar* formatted=NULL;
UChar *pat=NULL;
UDate d1=1000000000.0;
resultlength=0;
@ -452,7 +452,7 @@ void Test4162071()
UChar* myFormatit(UDateFormat* datdef, UDate d1)
{
UChar *result1;
UChar *result1=NULL;
int32_t resultlength, resultlengthneeded;
UFieldPosition pos;
UErrorCode status = U_ZERO_ERROR;

View File

@ -74,7 +74,7 @@ void addFormatTest(TestNode** root)
UChar* myDateFormat(UDateFormat* dat, UDate d1)
{
UChar *result1;
UChar *result1=NULL;
int32_t resultlength, resultlengthneeded;
UFieldPosition pos;
UErrorCode status = U_ZERO_ERROR;

View File

@ -49,8 +49,8 @@ void TestPatterns(void)
UChar upat[5];
UChar unewpat[5];
UChar unum[5];
UChar *unewp;
UChar *str;
UChar *unewp=NULL;
UChar *str=NULL;
UErrorCode status = U_ZERO_ERROR;
const char* pat[] = { "#.#", "#.", ".#", "#" };
const char* newpat[] = { "#0.#", "#0.", "#.0", "#" };
@ -110,7 +110,7 @@ void TestQuotes(void)
UFieldPosition pos;
UChar pat[15];
UChar res[15];
UChar *str;
UChar *str=NULL;
UNumberFormat *fmt;
status=U_ZERO_ERROR;
log_verbose("\nTestting the handling of quotes in number format\n");
@ -178,7 +178,7 @@ void TestExponential(void)
int32_t ppos;
UChar *upat;
UChar pattern[20];
UChar *str;
UChar *str=NULL;
UChar uvalfor[20], ulvalfor[20];
double a;
UErrorCode status = U_ZERO_ERROR;
@ -322,10 +322,10 @@ void TestCurrencySign(void)
{
int32_t lneed;
UNumberFormat *fmt;
UChar *pattern;
UChar *str;
UChar *pat;
UChar *res;
UChar *pattern=NULL;
UChar *str=NULL;
UChar *pat=NULL;
UChar *res=NULL;
UFieldPosition pos;
UErrorCode status = U_ZERO_ERROR;
pattern=(UChar*)malloc(sizeof(UChar) * (strlen("*#,##0.00;-*#,##0.00") + 1) );
@ -387,7 +387,7 @@ void TestCurrencySign(void)
void TestCurrency(void)
{
UNumberFormat *currencyFmt;
UChar *str, *res;
UChar *str=NULL, *res=NULL;
int32_t lneed, i;
UFieldPosition pos;
UErrorCode status = U_ZERO_ERROR;

View File

@ -98,7 +98,7 @@ void TestDecomp()
{
UErrorCode status = U_ZERO_ERROR;
int32_t x, neededLen, resLen;
UChar *source, *result;
UChar *source=NULL, *result=NULL;
status = U_ZERO_ERROR;
myCollation = ucol_open("en_US", &status);
if(U_FAILURE(status)){
@ -129,7 +129,7 @@ void TestCompatDecomp()
{
UErrorCode status = U_ZERO_ERROR;
int32_t x, neededLen, resLen;
UChar *source, *result;
UChar *source=NULL, *result=NULL;
status = U_ZERO_ERROR;
myCollation = ucol_open("en_US", &status);
if(U_FAILURE(status)){
@ -160,7 +160,7 @@ void TestCanonDecompCompose()
{
UErrorCode status = U_ZERO_ERROR;
int32_t x, neededLen, resLen;
UChar *source, *result;
UChar *source=NULL, *result=NULL;
status = U_ZERO_ERROR;
myCollation = ucol_open("en_US", &status);
if(U_FAILURE(status)){
@ -191,7 +191,7 @@ void TestCompatDecompCompose()
{
UErrorCode status = U_ZERO_ERROR;
int32_t x, neededLen, resLen;
UChar *source, *result;
UChar *source=NULL, *result=NULL;
status = U_ZERO_ERROR;
myCollation = ucol_open("en_US", &status);
if(U_FAILURE(status)){

View File

@ -37,8 +37,8 @@ void addNumForTest(TestNode** root)
/* test Number Format API */
void TestNumberFormat()
{
UChar *result;
UChar *temp1;
UChar *result=NULL;
UChar *temp1=NULL;
UChar temp[5];

View File

@ -1409,7 +1409,7 @@ void doBackwardSelectionTest(UBreakIterator* iterator, UChar* testText, Vector*
void doFirstSelectionTest(UBreakIterator* iterator, UChar* testText, Vector* result)
{
int32_t selectionStart, selectionEnd;
UChar* expectedFirstSelection;
UChar* expectedFirstSelection=NULL;
UChar* tempFirst = NULL;
UBool success = TRUE;
@ -1450,7 +1450,7 @@ void doFirstSelectionTest(UBreakIterator* iterator, UChar* testText, Vector* res
void doLastSelectionTest(UBreakIterator* iterator, UChar* testText, Vector* result)
{
int32_t selectionEnd, selectionStart;
UChar *expectedLastSelection;
UChar *expectedLastSelection=NULL;
UChar *tempLast = NULL;
UBool success = TRUE;

View File

@ -39,7 +39,7 @@
static uint32_t
randul()
{
uint32_t l;
uint32_t l=0;
int32_t i;
static UBool initialized = FALSE;
if (!initialized)

View File

@ -107,7 +107,7 @@ UBool isEuroAware(const UConverter* myConv)
UChar euroBack[2];
int32_t targetSize, euroBackSize;
UErrorCode err = U_ZERO_ERROR;
const char* myName = ucnv_getName(myConv, &err);
/*const char* myName = ucnv_getName(myConv, &err);*/
targetSize = ucnv_fromUChars(myConv,
target,

View File

@ -449,7 +449,7 @@ void TestStop(int32_t inputsize, int32_t outputsize)
if(!testConvertToUnicode(sampleTxt_euc_tw, sizeof(sampleTxt_euc_tw),
euc_twtoUnicode, sizeof(euc_twtoUnicode)/sizeof(euc_twtoUnicode[0]),"euc-tw",
(UConverterToUCallback)UCNV_TO_U_CALLBACK_STOP, from_euc_jpOffs, NULL, 0 ))
(UConverterToUCallback)UCNV_TO_U_CALLBACK_STOP, from_euc_twOffs, NULL, 0 ))
log_err("euc-tw->u with stop did not match.\n");
}
log_verbose("Testing fromUnicode for UTF-8 with UCNV_TO_U_CALLBACK_STOP \n");
@ -887,7 +887,7 @@ void TestEBCDIC_STATEFUL_Sub(int32_t inputsize, int32_t outputsize)
if(!testConvertFromUnicode(ebcdic_inputTest, sizeof(ebcdic_inputTest)/sizeof(ebcdic_inputTest[0]),
toIBM930_maxbuffer, sizeof(toIBM930_maxbuffer), "ibm-930",
(UConverterFromUCallback)UCNV_FROM_U_CALLBACK_SUBSTITUTE, offset_930, NULL, 0 ))
(UConverterFromUCallback)UCNV_FROM_U_CALLBACK_SUBSTITUTE, offset_930_maxbuffer, NULL, 0 ))
log_err("u-> ibm-930(EBCDIC_STATEFUL) with subst did not match.\n");
if(!testConvertFromUnicode(ebcdic_inputTest, sizeof(ebcdic_inputTest)/sizeof(ebcdic_inputTest[0]),

View File

@ -336,14 +336,14 @@ void TestToUnicodeErrorBehaviour()
uint8_t sampleText[] = { 0xa2, 0xFF};
const UChar expected[] = { 0x00c2 };
uint8_t sampleText2[] = { 0xa2, 0x70 };
const UChar expected2[] = { 0x0073 };
/* uint8_t sampleText2[] = { 0xa2, 0x70 };
const UChar expected2[] = { 0x0073 };*/
if(!convertToU(sampleText, sizeof(sampleText),
expected, sizeof(expected)/sizeof(expected[0]), "ibm-1051", 0, TRUE, U_ZERO_ERROR ))
(const char*)expected, sizeof(expected)/sizeof(expected[0]), "ibm-1051", 0, TRUE, U_ZERO_ERROR ))
log_err("SBCS (ibm-1051)->Unicode did not match.\n");
if(!convertToU(sampleText, sizeof(sampleText),
expected, sizeof(expected)/sizeof(expected[0]), "ibm-1051", 0, FALSE, U_ZERO_ERROR ))
(const char*)expected, sizeof(expected)/sizeof(expected[0]), "ibm-1051", 0, FALSE, U_ZERO_ERROR ))
log_err("SBCS (ibm-1051)->Unicode with flush = false did not match.\n");
}
@ -552,8 +552,8 @@ void TestWithBufferSize(int32_t insize, int32_t outsize){
{ 0x31, 0x32, 0x33, 0x00, 0xe4, 0xb8, 0x80, 0xe4, 0xba, 0x8c, 0xe4, 0xb8, 0x89, 0x2E };
int32_t toUTF8Offs[] =
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x07};
int32_t fmUTF8Offs[] =
{ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0007, 0x000a, 0x000d };
/* int32_t fmUTF8Offs[] =
{ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0007, 0x000a, 0x000d };*/
/*UTF-8*/
if(!testConvertFromU(sampleText, sizeof(sampleText)/sizeof(sampleText[0]),