ICU-900 Fixed some compiler warnings.
X-SVN-Rev: 9342
This commit is contained in:
parent
26bd19e158
commit
343d6e93ba
@ -443,7 +443,6 @@ static void TestBreakIteratorSafeClone(void)
|
|||||||
// of the rules and error checking.
|
// of the rules and error checking.
|
||||||
*/
|
*/
|
||||||
static UBreakIterator * testOpenRules(char *rules) {
|
static UBreakIterator * testOpenRules(char *rules) {
|
||||||
UConverter* conv = NULL;
|
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
UChar *ruleSourceU = NULL;
|
UChar *ruleSourceU = NULL;
|
||||||
void *strCleanUp = NULL;
|
void *strCleanUp = NULL;
|
||||||
|
@ -98,7 +98,7 @@ int main(int argc, const char* const argv[])
|
|||||||
|
|
||||||
/* If no ICU_DATA environment was set, try to fake up one. */
|
/* 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
|
#ifdef XP_MAC_CONSOLE
|
||||||
argc = ccommand((char***)&argv);
|
argc = ccommand((char***)&argv);
|
||||||
@ -177,7 +177,7 @@ int main(int argc, const char* const argv[])
|
|||||||
return nerrors ? 1 : 0;
|
return nerrors ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctest_appendToDataDirectory(const char *toAppend)
|
static void ctest_appendToDataDirectory(const char *toAppend)
|
||||||
{
|
{
|
||||||
const char *oldPath ="";
|
const char *oldPath ="";
|
||||||
char newBuf [1024];
|
char newBuf [1024];
|
||||||
|
@ -31,7 +31,7 @@ U_CFUNC void addAllTests(TestNode** root);
|
|||||||
/**
|
/**
|
||||||
* Return the path to the icu/source/data/out directory
|
* 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.
|
*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 *austrdup(const UChar* unichars);
|
||||||
U_CFUNC char *aescstrdup(const UChar* unichars, int32_t length);
|
U_CFUNC char *aescstrdup(const UChar* unichars, int32_t length);
|
||||||
U_CFUNC void *ctst_malloc(size_t size);
|
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);
|
U_CFUNC const char* loadTestData(UErrorCode* err);
|
||||||
|
|
||||||
|
@ -1053,16 +1053,15 @@ static void TestNewConvertWithBufferSizes(int32_t outsize, int32_t insize )
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void TestCoverageMBCS(){
|
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;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
int len = 0;
|
const char *directory = loadTestData(&status);
|
||||||
char* index=NULL;
|
|
||||||
directory = loadTestData(&status);
|
|
||||||
|
|
||||||
#if 0
|
#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));
|
tdpath = (char*) uprv_malloc(sizeof(char) * (len * 2));
|
||||||
uprv_strcpy(saveDirectory,u_getDataDirectory());
|
uprv_strcpy(saveDirectory,u_getDataDirectory());
|
||||||
log_verbose("Retrieved data directory %s \n",saveDirectory);
|
log_verbose("Retrieved data directory %s \n",saveDirectory);
|
||||||
|
@ -138,7 +138,6 @@ static UBool doTestNames(const char *name, const char *standard, const char **ex
|
|||||||
|
|
||||||
static void TestStandardNames()
|
static void TestStandardNames()
|
||||||
{
|
{
|
||||||
UErrorCode err = U_ZERO_ERROR;
|
|
||||||
static const char *asciiIANA[] = {
|
static const char *asciiIANA[] = {
|
||||||
"ANSI_X3.4-1968",
|
"ANSI_X3.4-1968",
|
||||||
"US-ASCII",
|
"US-ASCII",
|
||||||
|
@ -125,6 +125,8 @@ static void EnumerationTest(void) {
|
|||||||
uenum_close(en);
|
uenum_close(en);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void addEnumerationTest(TestNode** root);
|
||||||
|
|
||||||
void addEnumerationTest(TestNode** root)
|
void addEnumerationTest(TestNode** root)
|
||||||
{
|
{
|
||||||
addTest(root, &EnumerationTest, "tsutil/uenumtst/EnumerationTest");
|
addTest(root, &EnumerationTest, "tsutil/uenumtst/EnumerationTest");
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
* Corporation and others. All Rights Reserved.
|
* Corporation and others. All Rights Reserved.
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
* $Source: /xsrl/Nsvn/icu/icu/source/test/cintltst/usettest.c,v $
|
* $Source: /xsrl/Nsvn/icu/icu/source/test/cintltst/usettest.c,v $
|
||||||
* $Date: 2002/06/05 00:01:09 $
|
* $Date: 2002/07/25 18:32:03 $
|
||||||
* $Revision: 1.2 $
|
* $Revision: 1.3 $
|
||||||
**********************************************************************
|
**********************************************************************
|
||||||
*/
|
*/
|
||||||
#include "unicode/uset.h"
|
#include "unicode/uset.h"
|
||||||
@ -205,7 +205,7 @@ static void expectItems(const USet* set,
|
|||||||
int32_t itemCount = uset_getItemCount(set);
|
int32_t itemCount = uset_getItemCount(set);
|
||||||
int32_t itemIndex = 0;
|
int32_t itemIndex = 0;
|
||||||
UChar32 start = 1, end = 0;
|
UChar32 start = 1, end = 0;
|
||||||
int32_t itemLen;
|
int32_t itemLen = 0;
|
||||||
|
|
||||||
ec = U_ZERO_ERROR;
|
ec = U_ZERO_ERROR;
|
||||||
uset_toPattern(set, ustr, sizeof(ustr), TRUE, &ec);
|
uset_toPattern(set, ustr, sizeof(ustr), TRUE, &ec);
|
||||||
|
@ -251,7 +251,6 @@ DataDrivenCollatorTest::processTest(TestData *testData, UErrorCode &status) {
|
|||||||
testSetting = settings->getString("Rules", intStatus);
|
testSetting = settings->getString("Rules", intStatus);
|
||||||
if(U_SUCCESS(intStatus)) {
|
if(U_SUCCESS(intStatus)) {
|
||||||
col = new RuleBasedCollator(testSetting, status);
|
col = new RuleBasedCollator(testSetting, status);
|
||||||
UCollator *ucol = ucol_openRules(testSetting.getBuffer(), testSetting.length(), UCOL_DEFAULT, UCOL_DEFAULT, NULL, &status);
|
|
||||||
if(U_SUCCESS(status)) {
|
if(U_SUCCESS(status)) {
|
||||||
logln("Testing collator for rules "+testSetting);
|
logln("Testing collator for rules "+testSetting);
|
||||||
} else {
|
} else {
|
||||||
|
@ -48,8 +48,8 @@ public:
|
|||||||
|
|
||||||
BITestData(UErrorCode &status);
|
BITestData(UErrorCode &status);
|
||||||
void addDataChunk(const char *data, int32_t tag, int32_t lineNum, UErrorCode status);
|
void addDataChunk(const char *data, int32_t tag, int32_t lineNum, UErrorCode status);
|
||||||
void checkResults(char *heading, RBBITest *test);
|
void checkResults(const char *heading, RBBITest *test);
|
||||||
void err(char *heading, RBBITest *test, int32_t expectedIdx, int32_t actualIdx);
|
void err(const char *heading, RBBITest *test, int32_t expectedIdx, int32_t actualIdx);
|
||||||
void clearResults();
|
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.
|
// 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 expectedIndex = 0;
|
||||||
int32_t actualIndex = 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
|
// err - An error was found. Report it, along with information about where the
|
||||||
// incorrectly broken test data appeared in the source file.
|
// 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 expected = fExpectedBreakPositions.elementAti(expectedIdx);
|
||||||
int32_t actual = fActualBreakPositions.elementAti(actualIdx);
|
int32_t actual = fActualBreakPositions.elementAti(actualIdx);
|
||||||
|
@ -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" }
|
{ 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;
|
int32_t result, refResult;
|
||||||
|
|
||||||
UErrorCode errorCode;
|
UErrorCode errorCode;
|
||||||
@ -1112,7 +1112,7 @@ BasicNormalizerTest::TestCompare() {
|
|||||||
// test them each with each other
|
// test them each with each other
|
||||||
for(i=0; i<count; ++i) {
|
for(i=0; i<count; ++i) {
|
||||||
for(j=i; j<count; ++j) {
|
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
|
// test Normalizer::compare
|
||||||
errorCode=U_ZERO_ERROR;
|
errorCode=U_ZERO_ERROR;
|
||||||
result=_norm_compare(s[i], s[j], opt[k].options, errorCode);
|
result=_norm_compare(s[i], s[j], opt[k].options, errorCode);
|
||||||
|
@ -283,13 +283,13 @@ UnicodeStringTest::TestCompare()
|
|||||||
{ 0xd84d, 0xdc56, 0 } /* U+23456 */
|
{ 0xd84d, 0xdc56, 0 } /* U+23456 */
|
||||||
};
|
};
|
||||||
UnicodeString u[20]; // must be at least as long as strings[]
|
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);
|
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) {
|
if(u[i].compareCodePointOrder(u[i+1])>=0) {
|
||||||
errln("error: UnicodeString::compareCodePointOrder() fails for string %d and the following one\n", i);
|
errln("error: UnicodeString::compareCodePointOrder() fails for string %d and the following one\n", i);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user