ICU-535 fixed some compiler warnings

X-SVN-Rev: 2182
This commit is contained in:
George Rhoten 2000-08-11 02:08:59 +00:00
parent c094c8a0eb
commit ebd5136aac
11 changed files with 59 additions and 59 deletions

View File

@ -96,7 +96,7 @@ void ComposedCharIter::getDecomposition(UnicodeString& result) const
result.truncate(0);
uint16_t offset = ucmp16_getu(DecompData::offsets, curChar);
uint16_t index = offset & DecompData::DECOMP_MASK;
uint16_t index = (uint16_t)(offset & DecompData::DECOMP_MASK);
if (index > minDecomp) {
if ((offset & DecompData::DECOMP_RECURSE) != 0) {
// Let Normalizer::decompose() handle recursive decomp

View File

@ -909,7 +909,7 @@ U_CFUNC UChar32 T_UConverter_getNextUChar_UTF16_BE(UConverterToUnicodeArgs* args
}
/*Gets the corresponding codepoint*/
first = ((uint16_t)(*(args->source)) << 8) |((uint8_t)*((args->source)+1));
first = (uint16_t)(((uint16_t)(*(args->source)) << 8) |((uint8_t)*((args->source)+1)));
myUChar = first;
args->source += 2;
@ -922,7 +922,7 @@ U_CFUNC UChar32 T_UConverter_getNextUChar_UTF16_BE(UConverterToUnicodeArgs* args
}
/* get the second surrogate and assemble the code point */
second = ((uint16_t)(*(args->source)) << 8) |((uint8_t)*(args->source+1));
second = (uint16_t)(((uint16_t)(*(args->source)) << 8) |((uint8_t)*(args->source+1)));
/* ignore unmatched surrogates and just deliver the first one in such a case */
if(UTF_IS_SECOND_SURROGATE(second)) {
@ -1093,7 +1093,7 @@ U_CFUNC UChar32 T_UConverter_getNextUChar_UTF16_LE(UConverterToUnicodeArgs* args
}
/*Gets the corresponding codepoint*/
first = ((uint16_t)*((args->source)+1) << 8) | ((uint8_t)(*(args->source)));
first = (uint16_t)(((uint16_t)*((args->source)+1) << 8) | ((uint8_t)(*(args->source))));
myUChar=first;
/*updates the source*/
args->source += 2;
@ -1109,7 +1109,7 @@ U_CFUNC UChar32 T_UConverter_getNextUChar_UTF16_LE(UConverterToUnicodeArgs* args
}
/* get the second surrogate and assemble the code point */
second = ((uint16_t)*(args->source+1) << 8) |((uint8_t)(*(args->source)));
second = (uint16_t)(((uint16_t)*(args->source+1) << 8) |((uint8_t)(*(args->source))));
/* ignore unmatched surrogates and just deliver the first one in such a case */
if(UTF_IS_SECOND_SURROGATE(second))

View File

@ -306,7 +306,7 @@ DictionaryBasedBreakIterator::divideUpDictionaryRange(int32_t startPos, int32_t
// initialize (we always exit the loop with a break statement)
c = text->current();
while (TRUE) {
for (;;) {
// if we can transition to state "-1" from our current state, we're
// on the last character of a legal word. Push that position onto

View File

@ -1999,7 +1999,7 @@ GregorianCalendar::inDaylightTime(UErrorCode& status) const
// Force an update of the state of the Calendar.
((GregorianCalendar*)this)->complete(status); // cast away const
return U_SUCCESS(status) ? (internalGet(DST_OFFSET) != 0) : FALSE;
return (UBool)(U_SUCCESS(status) ? (internalGet(DST_OFFSET) != 0) : FALSE);
}
// -------------------------------------

View File

@ -104,7 +104,7 @@ public:
* The reference must be in the range 1..9.
*/
UChar getSegmentStandin(int32_t ref) const {
return segmentBase + ref - 1;
return (UChar)(segmentBase + ref - 1);
}
};

View File

@ -175,7 +175,7 @@ int16_t TransliterationRule::getIndexValue(const TransliterationRuleData& data)
return -1;
}
UChar c = pattern.charAt(anteContextLength);
return data.lookupSet(c) == NULL ? (c & 0xFF) : -1;
return (int16_t)(data.lookupSet(c) == NULL ? (c & 0xFF) : -1);
}
/**

View File

@ -294,7 +294,7 @@ void testIEEEremainder()
double pinf = uprv_getInfinity();
double ninf = -uprv_getInfinity();
double nan = uprv_getNaN();
double pzero = 0.0;
/* double pzero = 0.0;*/
double nzero = 0.0;
nzero *= -1;

View File

@ -44,10 +44,10 @@ static void dotestname(const char *name, const char *standard, const char *expec
void TestStandardNames()
{
#if 0
int i, count;
UErrorCode err;
#if 0
/* Iterate over all standards. */
for (i = 0, count = ucnv_countStandards(); i < count; ++i) {

View File

@ -188,9 +188,9 @@ void TestUCMP8API(){
CompactByteArray* ucmp8Array1=NULL;
CompactByteArray* ucmp8Array2=NULL;
int32_t i=0;
int8_t *values;
int8_t *valuesSet;
int8_t const TEST_DEFAULT_VALUE = (int8_t)0xFF;
uint8_t *values;
uint8_t *valuesSet;
uint8_t const TEST_DEFAULT_VALUE = (uint8_t)0xFF;
/*ucmp8_open*/
@ -228,7 +228,7 @@ void TestUCMP8API(){
if(ucmp8_getkBlockCount() != 128 ){
log_err("Error in ucmp8_getkBlockCount()\n");
}
values=(int8_t*)ucmp8_getArray(ucmp8Array1);
values=(uint8_t*)ucmp8_getArray(ucmp8Array1);
if(values[0] !=TEST_DEFAULT_VALUE){
log_err("Error: getArray() or init failed\n");
}
@ -243,8 +243,8 @@ void TestUCMP8API(){
}
/*ucmp8_set*/
ucmp8_set(ucmp8Array1, 0, (char)0xFE);
valuesSet=(int8_t*)ucmp8_getArray(ucmp8Array1);
if(valuesSet[0] != (int8_t)0xFE ){
valuesSet=(uint8_t*)ucmp8_getArray(ucmp8Array1);
if(valuesSet[0] != (uint8_t)0xFE ){
log_err("ERROR: ucmp8_set() failed\n");
}
if(ucmp8Array1->fCompact == TRUE){
@ -254,8 +254,8 @@ void TestUCMP8API(){
/*ucmp8_set*/
ucmp8_compact(ucmp8Array1, 1);
ucmp8_set(ucmp8Array1, 0, (char)0xFD);
valuesSet=(int8_t*)ucmp8_getArray(ucmp8Array1);
if(valuesSet[0] != (int8_t)0xFD ){
valuesSet=(uint8_t*)ucmp8_getArray(ucmp8Array1);
if(valuesSet[0] != (uint8_t)0xFD ){
log_err("ERROR: ucmp8_set() failed\n");
}
if(ucmp8Array1->fCompact == TRUE){
@ -264,9 +264,9 @@ void TestUCMP8API(){
/*ucmp8_setRange*/
ucmp8_compact(ucmp8Array1, 1);
ucmp8_setRange(ucmp8Array1, 0, 10, (char)0xFD);
valuesSet=(int8_t*)ucmp8_getArray(ucmp8Array1);
valuesSet=(uint8_t*)ucmp8_getArray(ucmp8Array1);
for(i =0 ; i< 10; i++ ){
if(valuesSet[0] != (int8_t)0xFD ){
if(valuesSet[0] != (uint8_t)0xFD ){
log_err("ERROR: ucmp8_set() failed\n");
break;
}

View File

@ -88,14 +88,14 @@ void TestCharLength()
int16_t i;
UBool multiple;
for(i=0; i<sizeof(codepoint)/sizeof(codepoint[0]); i=i+2){
for(i=0; i<sizeof(codepoint)/sizeof(codepoint[0]); i=(int16_t)(i+2)){
UChar32 c=codepoint[i+1];
if(UTF16_CHAR_LENGTH(c) != (uint16_t)codepoint[i]){
log_err("The no: of code units for %lx:- Expected: %d Got: %d\n", c, codepoint[i], UTF16_CHAR_LENGTH(c));
}else{
log_verbose("The no: of code units for %lx is %d\n",c, UTF16_CHAR_LENGTH(c) );
}
multiple=codepoint[i] == 1 ? FALSE : TRUE;
multiple=(UBool)(codepoint[i] == 1 ? FALSE : TRUE);
if(UTF16_NEED_MULTIPLE_UCHAR(c) != multiple){
log_err("ERROR: UTF16_NEED_MULTIPLE_UCHAR failed for %lx\n", c);
}
@ -155,7 +155,7 @@ void TestGetChar()
if(c != result[i+2]){
log_err("ERROR: UTF16_GET_CHAR_SAFE(strict) failed for offset=%ld. Expected:%lx Got:%lx\n", offset, result[i+2], c);
}
i=i+3;
i=(uint16_t)(i+3);
}
}
@ -225,7 +225,7 @@ void TestNextPrevChar(){
if(c != result[i+2]){
log_err("ERROR: UTF16_NEXT_CHAR_SAFE(strict) failed for input=%ld. Expected:%lx Got:%lx\n", offset, result[i+2], c);
}
i=i+6;
i=(uint16_t)(i+6);
}
i=0;
for(offset=(uint16_t)sizeof(input)/U_SIZEOF_UCHAR; offset > 0; --offset){
@ -256,7 +256,7 @@ void TestNextPrevChar(){
if(c != result[i+5]){
log_err("ERROR: UTF16_PREV_CHAR_SAFE(strict) failed for input=%ld. Expected:%lx Got:%lx\n", offset, result[i+5], c);
}
i=i+6;
i=(uint16_t)(i+6);
}
}
@ -431,7 +431,7 @@ void TestAppendChar(){
uint16_t i, count=0;
UChar *str=malloc(sizeof(UChar) * (u_strlen(s)+1));
uint16_t offset;
for(i=0; i<sizeof(test)/sizeof(test[0]); i=i+2){
for(i=0; i<sizeof(test)/sizeof(test[0]); i=(uint16_t)(i+2)){
if(count<5){
u_strcpy(str, s);
offset=(uint16_t)test[i];

View File

@ -64,7 +64,7 @@ static int INDENT_LEVEL = 0;
/*-------------------------------------------*/
/* strncmp that also makes sure there's a \0 at s2[0] */
int strncmp_nullcheck( const char* s1,
static int strncmp_nullcheck( const char* s1,
const char* s2,
int n )
{
@ -72,7 +72,7 @@ int strncmp_nullcheck( const char* s1,
else return strncmp ( s1, s2, n );
}
void getNextLevel( const char* name,
static void getNextLevel( const char* name,
int* nameLen,
const char** nextName )
{
@ -91,7 +91,7 @@ void getNextLevel( const char* name,
else *nameLen = strlen(name);
}
TestNode *createTestNode( )
static TestNode *createTestNode( )
{
TestNode *newNode;
@ -208,7 +208,7 @@ TestNode *addTestNode ( TestNode *root, const char *name )
}
}
void iterateTestsWithLevel ( const TestNode* root,
static void iterateTestsWithLevel ( const TestNode* root,
int len,
const TestNode** list,
TestMode mode)
@ -511,7 +511,7 @@ int processArgs(const TestNode* root,
* Display program invocation arguments
*/
void help ( const char *argv0 )
static void help ( const char *argv0 )
{
printf("Usage: %s [ -l ] [ -v ] [ -verbose] [-a] [ -all] [-n] \n [ -no_err_msg] [ -h ] [ /path/to/test ]\n",
argv0);