ICU-900 Fixed some compiler warnings.

X-SVN-Rev: 9342
This commit is contained in:
George Rhoten 2002-07-25 18:32:04 +00:00
parent 26bd19e158
commit 343d6e93ba
11 changed files with 25 additions and 27 deletions

View File

@ -443,7 +443,6 @@ static void TestBreakIteratorSafeClone(void)
// of the rules and error checking.
*/
static UBreakIterator * testOpenRules(char *rules) {
UConverter* conv = NULL;
UErrorCode status = U_ZERO_ERROR;
UChar *ruleSourceU = NULL;
void *strCleanUp = NULL;

View File

@ -98,7 +98,7 @@ int main(int argc, const char* const argv[])
/* If no ICU_DATA environment was set, try to fake up one. */
fprintf(stderr, "u_getDataDirectory() = %s\n", u_getDataDirectory());
fprintf(stdout, "u_getDataDirectory() = %s\n", u_getDataDirectory());
#ifdef XP_MAC_CONSOLE
argc = ccommand((char***)&argv);
@ -177,7 +177,7 @@ int main(int argc, const char* const argv[])
return nerrors ? 1 : 0;
}
void ctest_appendToDataDirectory(const char *toAppend)
static void ctest_appendToDataDirectory(const char *toAppend)
{
const char *oldPath ="";
char newBuf [1024];

View File

@ -31,7 +31,7 @@ U_CFUNC void addAllTests(TestNode** root);
/**
* Return the path to the icu/source/data/out directory
*/
U_CFUNC const char* ctest_dataOutDir();
U_CFUNC const char* ctest_dataOutDir(void);
/**
*complete a relative path to a full pathname, and convert to platform-specific syntax.
@ -53,7 +53,7 @@ U_CFUNC void ctest_pathnameInContext(char* fullname, int32_t maxsize, const char
U_CFUNC char *austrdup(const UChar* unichars);
U_CFUNC char *aescstrdup(const UChar* unichars, int32_t length);
U_CFUNC void *ctst_malloc(size_t size);
U_CFUNC void ctst_freeAll();
U_CFUNC void ctst_freeAll(void);
U_CFUNC const char* loadTestData(UErrorCode* err);

View File

@ -1053,16 +1053,15 @@ static void TestNewConvertWithBufferSizes(int32_t outsize, int32_t insize )
}
static void TestCoverageMBCS(){
char* saveDirectory = (char*)uprv_malloc(sizeof(char) *(strlen(u_getDataDirectory())+1));
const char *directory;
char* tdpath = NULL;
UErrorCode status = U_ZERO_ERROR;
int len = 0;
char* index=NULL;
directory = loadTestData(&status);
const char *directory = loadTestData(&status);
#if 0
len = strlen(directory);
char* tdpath = NULL;
char* saveDirectory = (char*)uprv_malloc(sizeof(char) *(strlen(u_getDataDirectory())+1));
int len = strlen(directory);
char* index=NULL;
tdpath = (char*) uprv_malloc(sizeof(char) * (len * 2));
uprv_strcpy(saveDirectory,u_getDataDirectory());
log_verbose("Retrieved data directory %s \n",saveDirectory);

View File

@ -138,7 +138,6 @@ static UBool doTestNames(const char *name, const char *standard, const char **ex
static void TestStandardNames()
{
UErrorCode err = U_ZERO_ERROR;
static const char *asciiIANA[] = {
"ANSI_X3.4-1968",
"US-ASCII",

View File

@ -125,6 +125,8 @@ static void EnumerationTest(void) {
uenum_close(en);
}
void addEnumerationTest(TestNode** root);
void addEnumerationTest(TestNode** root)
{
addTest(root, &EnumerationTest, "tsutil/uenumtst/EnumerationTest");

View File

@ -4,8 +4,8 @@
* Corporation and others. All Rights Reserved.
**********************************************************************
* $Source: /xsrl/Nsvn/icu/icu/source/test/cintltst/usettest.c,v $
* $Date: 2002/06/05 00:01:09 $
* $Revision: 1.2 $
* $Date: 2002/07/25 18:32:03 $
* $Revision: 1.3 $
**********************************************************************
*/
#include "unicode/uset.h"
@ -205,7 +205,7 @@ static void expectItems(const USet* set,
int32_t itemCount = uset_getItemCount(set);
int32_t itemIndex = 0;
UChar32 start = 1, end = 0;
int32_t itemLen;
int32_t itemLen = 0;
ec = U_ZERO_ERROR;
uset_toPattern(set, ustr, sizeof(ustr), TRUE, &ec);

View File

@ -251,7 +251,6 @@ DataDrivenCollatorTest::processTest(TestData *testData, UErrorCode &status) {
testSetting = settings->getString("Rules", intStatus);
if(U_SUCCESS(intStatus)) {
col = new RuleBasedCollator(testSetting, status);
UCollator *ucol = ucol_openRules(testSetting.getBuffer(), testSetting.length(), UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status);
if(U_SUCCESS(status)) {
logln("Testing collator for rules "+testSetting);
} else {

View File

@ -48,8 +48,8 @@ public:
BITestData(UErrorCode &status);
void addDataChunk(const char *data, int32_t tag, int32_t lineNum, UErrorCode status);
void checkResults(char *heading, RBBITest *test);
void err(char *heading, RBBITest *test, int32_t expectedIdx, int32_t actualIdx);
void checkResults(const char *heading, RBBITest *test);
void err(const char *heading, RBBITest *test, int32_t expectedIdx, int32_t actualIdx);
void clearResults();
};
@ -86,7 +86,7 @@ void BITestData::addDataChunk(const char *data, int32_t tag, int32_t lineNum, UE
//
// checkResults. Compare the actual and expected break positions, report any differences.
//
void BITestData::checkResults(char *heading, RBBITest *test) {
void BITestData::checkResults(const char *heading, RBBITest *test) {
int32_t expectedIndex = 0;
int32_t actualIndex = 0;
@ -137,7 +137,7 @@ void BITestData::checkResults(char *heading, RBBITest *test) {
// err - An error was found. Report it, along with information about where the
// incorrectly broken test data appeared in the source file.
//
void BITestData::err(char *heading, RBBITest *test, int32_t expectedIdx, int32_t actualIdx)
void BITestData::err(const char *heading, RBBITest *test, int32_t expectedIdx, int32_t actualIdx)
{
int32_t expected = fExpectedBreakPositions.elementAti(expectedIdx);
int32_t actual = fActualBreakPositions.elementAti(actualIdx);

View File

@ -1099,7 +1099,7 @@ BasicNormalizerTest::TestCompare() {
{ U_COMPARE_CODE_POINT_ORDER|U_COMPARE_IGNORE_CASE|U_FOLD_CASE_EXCLUDE_SPECIAL_I, "code point order & ignore case & special i" }
};
int32_t i, j, k, count=sizeof(strings)/sizeof(strings[0]);
int32_t i, j, k, count=(int32_t)(sizeof(strings)/sizeof(strings[0]));
int32_t result, refResult;
UErrorCode errorCode;
@ -1112,7 +1112,7 @@ BasicNormalizerTest::TestCompare() {
// test them each with each other
for(i=0; i<count; ++i) {
for(j=i; j<count; ++j) {
for(k=0; k<sizeof(opt)/sizeof(opt[0]); ++k) {
for(k=0; k<(int32_t)(sizeof(opt)/sizeof(opt[0])); ++k) {
// test Normalizer::compare
errorCode=U_ZERO_ERROR;
result=_norm_compare(s[i], s[j], opt[k].options, errorCode);

View File

@ -283,13 +283,13 @@ UnicodeStringTest::TestCompare()
{ 0xd84d, 0xdc56, 0 } /* U+23456 */
};
UnicodeString u[20]; // must be at least as long as strings[]
int i;
int32_t i;
for(i=0; i<sizeof(strings)/sizeof(strings[0]); ++i) {
for(i=0; i<(int32_t)(sizeof(strings)/sizeof(strings[0])); ++i) {
u[i]=UnicodeString(TRUE, strings[i], -1);
}
for(i=0; i<(sizeof(strings)/sizeof(strings[0])-1); ++i) {
for(i=0; i<(int32_t)(sizeof(strings)/sizeof(strings[0])-1); ++i) {
if(u[i].compareCodePointOrder(u[i+1])>=0) {
errln("error: UnicodeString::compareCodePointOrder() fails for string %d and the following one\n", i);
}