ICU-900 Fixed some compiler warnings.

X-SVN-Rev: 7608
This commit is contained in:
George Rhoten 2002-02-08 04:53:41 +00:00
parent 08288af44b
commit b269dce12c
7 changed files with 84 additions and 89 deletions

View file

@ -985,7 +985,7 @@ struct teststruct {
uint8_t key[256];
} ;
int compare_teststruct(const void *string1, const void *string2) {
static int compare_teststruct(const void *string1, const void *string2) {
return(strcmp(((struct teststruct *)string1)->key, ((struct teststruct *)string2)->key));
}
@ -1072,7 +1072,6 @@ void TestBounds() {
int32_t i = 0, j = 0, k = 0, buffSize = 0, skSize = 0, lowerSize = 0, upperSize = 0;
int32_t lowerRND = 0, upperRND = 0;
int32_t arraySize = sizeof(tests)/sizeof(tests[0]);
for(i = 0; i<arraySize; i++) {
@ -1138,4 +1137,5 @@ void TestBounds() {
}
}
ucol_close(coll);
}
}

View file

@ -576,11 +576,11 @@ unicodeDataLineFn(void *context,
static UBool U_CALLCONV
enumTypeRange(const void *context, UChar32 start, UChar32 limit, UCharCategory type) {
static UChar32 test[][2]={
0x41, U_UPPERCASE_LETTER,
0x308, U_NON_SPACING_MARK,
0xfffe, U_GENERAL_OTHER_TYPES,
0xe0041, U_FORMAT_CHAR,
0xeffff, U_UNASSIGNED
{0x41, U_UPPERCASE_LETTER},
{0x308, U_NON_SPACING_MARK},
{0xfffe, U_GENERAL_OTHER_TYPES},
{0xe0041, U_FORMAT_CHAR},
{0xeffff, U_UNASSIGNED}
};
int i, count;

View file

@ -30,7 +30,7 @@ static void TestJitterbug1293(void);
static void TestNewConvertWithBufferSizes(int32_t osize, int32_t isize) ;
static void TestConverterTypesAndStarters(void);
static void TestAmbiguous(void);
static void TestSignatureDetection();
static void TestSignatureDetection(void);
static void TestUTF7(void);
static void TestUTF8(void);
static void TestUTF16BE(void);
@ -67,7 +67,7 @@ static void TestConv(const uint16_t in[],
char byteArr[],
int byteArrLen);
static void TestCoverageMBCS();
static void TestCoverageMBCS(void);
void addTestNewConvert(TestNode** root);
@ -1357,7 +1357,7 @@ static void
TestSignatureDetection(){
/* with null terminated strings */
{
char* data[] = {
static const char* data[] = {
"\xFE\xFF\x00\x00", /* UTF-16BE */
"\xFF\xFE\x00\x00", /* UTF-16LE */
"\xEF\xBB\xBF\x00", /* UTF-8 */
@ -1374,7 +1374,7 @@ TestSignatureDetection(){
"\x0E\xFE\xFF\x41", /* SCSU */
};
char* expected[] = {
static const char* expected[] = {
"UTF-16BE",
"UTF-16LE",
"UTF-8",
@ -1391,7 +1391,7 @@ TestSignatureDetection(){
"SCSU",
};
int32_t expectedLength[] ={
static const int32_t expectedLength[] ={
2,
2,
3,
@ -1411,7 +1411,7 @@ TestSignatureDetection(){
int i=0;
UErrorCode err;
int32_t signatureLength = -1;
char* source = NULL;
const char* source = NULL;
const char* enc = NULL;
for( ; i<sizeof(data)/sizeof(char*); i++){
err = U_ZERO_ERROR;
@ -1431,7 +1431,7 @@ TestSignatureDetection(){
}
}
{
char* data[] = {
static const char* data[] = {
"\xFE\xFF\x00", /* UTF-16BE */
"\xFF\xFE\x00", /* UTF-16LE */
"\xEF\xBB\xBF\x00", /* UTF-8 */
@ -1452,7 +1452,7 @@ TestSignatureDetection(){
"\xFF\xFE\x00\x00\x42", /* UTF-32LE */
"\xFF\x41\x42" /* NULL */
};
int len[] = {
static const int len[] = {
3,
3,
4,
@ -1474,7 +1474,7 @@ TestSignatureDetection(){
3
};
char* expected[] = {
static const char* expected[] = {
"UTF-16BE",
"UTF-16LE",
"UTF-8",
@ -1495,7 +1495,7 @@ TestSignatureDetection(){
"UTF-32LE",
NULL
};
int32_t expectedLength[] ={
static const int32_t expectedLength[] ={
2,
2,
3,
@ -1520,7 +1520,7 @@ TestSignatureDetection(){
UErrorCode err;
int32_t signatureLength = -1;
int32_t sourceLength=-1;
char* source = NULL;
const char* source = NULL;
const char* enc = NULL;
for( ; i<sizeof(data)/sizeof(char*); i++){
err = U_ZERO_ERROR;

View file

@ -480,89 +480,89 @@ testTrieRanges4(const char *testName,
/* set consecutive ranges, even with value 0 */
static const SetRange
setRanges1[]={
0, 0x20, 0, FALSE,
0x20, 0xa7, 0x1234, FALSE,
0xa7, 0x3400, 0, FALSE,
0x3400, 0x9fa6, 0x6162, FALSE,
0x9fa6, 0xdada, 0x3132, FALSE,
0xdada, 0xeeee, 0x27, FALSE,
0xeeee, 0x11111, 1, FALSE,
0x11111, 0x44444, 0x6162, FALSE,
0x44444, 0xf0003, 0, FALSE,
0xf0003, 0xf0004, 0xf, FALSE,
0xf0004, 0xf0006, 0x10, FALSE,
0xf0006, 0xf0007, 0x11, FALSE,
0xf0007, 0xf0020, 0x12, FALSE,
0xf0020, 0x110000, 0, FALSE
{0, 0x20, 0, FALSE},
{0x20, 0xa7, 0x1234, FALSE},
{0xa7, 0x3400, 0, FALSE},
{0x3400, 0x9fa6, 0x6162, FALSE},
{0x9fa6, 0xdada, 0x3132, FALSE},
{0xdada, 0xeeee, 0x27, FALSE},
{0xeeee, 0x11111, 1, FALSE},
{0x11111, 0x44444, 0x6162, FALSE},
{0x44444, 0xf0003, 0, FALSE},
{0xf0003, 0xf0004, 0xf, FALSE},
{0xf0004, 0xf0006, 0x10, FALSE},
{0xf0006, 0xf0007, 0x11, FALSE},
{0xf0007, 0xf0020, 0x12, FALSE},
{0xf0020, 0x110000, 0, FALSE}
};
static const CheckRange
checkRanges1[]={
0, 0, /* dummy start range to make _testEnumRange() simpler */
0x20, 0,
0xa7, 0x1234,
0x3400, 0,
0x9fa6, 0x6162,
0xdada, 0x3132,
0xeeee, 0x27,
0x11111,1,
0x44444,0x6162,
0xf0003,0,
0xf0004,0xf,
0xf0006,0x10,
0xf0007,0x11,
0xf0020,0x12,
0x110000, 0
{0, 0}, /* dummy start range to make _testEnumRange() simpler */
{0x20, 0},
{0xa7, 0x1234},
{0x3400, 0},
{0x9fa6, 0x6162},
{0xdada, 0x3132},
{0xeeee, 0x27},
{0x11111,1},
{0x44444,0x6162},
{0xf0003,0},
{0xf0004,0xf},
{0xf0006,0x10},
{0xf0007,0x11},
{0xf0020,0x12},
{0x110000, 0}
};
/* set some interesting overlapping ranges */
static const SetRange
setRanges2[]={
0x21, 0x7f, 0x5555, TRUE,
0x2f800,0x2fedc, 0x7a, TRUE,
0x72, 0xdd, 3, TRUE,
0xdd, 0xde, 4, FALSE,
0x2f987,0x2fa98, 5, TRUE,
0x2f777,0x2f833, 0, TRUE,
0x2f900,0x2ffee, 1, FALSE,
0x2ffee,0x2ffef, 2, TRUE
{0x21, 0x7f, 0x5555, TRUE},
{0x2f800,0x2fedc, 0x7a, TRUE},
{0x72, 0xdd, 3, TRUE},
{0xdd, 0xde, 4, FALSE},
{0x2f987,0x2fa98, 5, TRUE},
{0x2f777,0x2f833, 0, TRUE},
{0x2f900,0x2ffee, 1, FALSE},
{0x2ffee,0x2ffef, 2, TRUE}
};
static const CheckRange
checkRanges2[]={
0, 0, /* dummy start range to make _testEnumRange() simpler */
0x21, 0,
0x72, 0x5555,
0xdd, 3,
0xde, 4,
0x2f833,0,
0x2f987,0x7a,
0x2fa98,5,
0x2fedc,0x7a,
0x2ffee,1,
0x2ffef,2,
0x110000, 0
{0, 0}, /* dummy start range to make _testEnumRange() simpler */
{0x21, 0},
{0x72, 0x5555},
{0xdd, 3},
{0xde, 4},
{0x2f833,0},
{0x2f987,0x7a},
{0x2fa98,5},
{0x2fedc,0x7a},
{0x2ffee,1},
{0x2ffef,2},
{0x110000, 0}
};
/* use a non-zero initial value */
static const SetRange
setRanges3[]={
0x31, 0xa4, 1, FALSE,
0x3400, 0x6789, 2, FALSE,
0x30000,0x34567,9, TRUE,
0x45678,0x56789,3, TRUE
{0x31, 0xa4, 1, FALSE},
{0x3400, 0x6789, 2, FALSE},
{0x30000,0x34567,9, TRUE},
{0x45678,0x56789,3, TRUE}
};
static const CheckRange
checkRanges3[]={
0, 9, /* dummy start range, also carries the initial value */
0x31, 9,
0xa4, 1,
0x3400, 9,
0x6789, 2,
0x45678,9,
0x56789,3,
0x110000,9
{0, 9}, /* dummy start range, also carries the initial value */
{0x31, 9},
{0xa4, 1},
{0x3400, 9},
{0x6789, 2},
{0x45678,9},
{0x56789,3},
{0x110000,9}
};
static void

View file

@ -147,7 +147,7 @@ utm_allocN(UToolMemory *mem, int32_t n) {
typedef void EnumTrieFn(void *context, uint32_t code, Norm *norm);
static UNewTrie normTrie={ 0 }, fcdTrie={ 0 };
static UNewTrie normTrie={ {0},0,0,0,0,0,0,0,0,{0} }, fcdTrie={ {0},0,0,0,0,0,0,0,0,{0} };
static UToolMemory *normMem, *utf32Mem, *extraMem, *combiningTriplesMem;

View file

@ -779,7 +779,7 @@ generateData(const char *dataDir) {
trieSize=utrie_serialize(pTrie, trieBlock, sizeof(trieBlock), getFoldedPropsValue, TRUE, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(stderr, "error: utrie_serialize failed: %s (length %ld)\n", u_errorName(errorCode), trieSize);
fprintf(stderr, "error: utrie_serialize failed: %s (length %ld)\n", u_errorName(errorCode), (long)trieSize);
exit(errorCode);
}

View file

@ -652,15 +652,10 @@ struct {
}
#if 0
#endif
int32_t surrogateCount = 0;
int32_t surrogateCount = 0;
while(!feof(data)) {
if(U_FAILURE(*status)) {
fprintf(stderr, "Something returned an error %i (%s) while processing line %i of $s. Exiting...\n",
fprintf(stderr, "Something returned an error %i (%s) while processing line %i of %s. Exiting...\n",
*status, u_errorName(*status), line, filename);
exit(*status);
}