mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 09:21:03 +00:00
ICU-4707 Fix some compiler warnings
X-SVN-Rev: 19383
This commit is contained in:
parent
2dd590c668
commit
35c4c75f13
5 changed files with 20 additions and 25 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 1999-2005, International Business Machines
|
||||
* Copyright (C) 1999-2006, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
* Date Name Description
|
||||
|
@ -339,24 +339,27 @@ int32_t UnicodeSet::findCodePoint(UChar32 c) const {
|
|||
|
||||
// Return the smallest i such that c < list[i]. Assume
|
||||
// list[len - 1] == HIGH and that c is legal (0..HIGH-1).
|
||||
if (c < list[0]) return 0;
|
||||
if (c < list[0])
|
||||
return 0;
|
||||
// High runner test. c is often after the last range, so an
|
||||
// initial check for this condition pays off.
|
||||
if (len >= 2 && c >= list[len-2]) return len-1;
|
||||
if (len >= 2 && c >= list[len-2])
|
||||
return len-1;
|
||||
int32_t lo = 0;
|
||||
int32_t hi = len - 1;
|
||||
// invariant: c >= list[lo]
|
||||
// invariant: c < list[hi]
|
||||
for (;;) {
|
||||
int32_t i = (lo + hi) >> 1;
|
||||
if (i == lo) return hi;
|
||||
if (c < list[i]) {
|
||||
if (i == lo) {
|
||||
break; // Found!
|
||||
} else if (c < list[i]) {
|
||||
hi = i;
|
||||
} else {
|
||||
lo = i;
|
||||
}
|
||||
}
|
||||
return 0; // To make compiler happy; never reached
|
||||
return hi;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -106,10 +106,10 @@ isPerlOpen(const UnicodeString &pattern, int32_t pos) {
|
|||
return pattern.charAt(pos)==BACKSLASH && ((c=pattern.charAt(pos+1))==LOWER_P || c==UPPER_P);
|
||||
}
|
||||
|
||||
static inline UBool
|
||||
/*static inline UBool
|
||||
isPerlClose(const UnicodeString &pattern, int32_t pos) {
|
||||
return pattern.charAt(pos)==CLOSE_BRACE;
|
||||
}
|
||||
}*/
|
||||
|
||||
static inline UBool
|
||||
isNameOpen(const UnicodeString &pattern, int32_t pos) {
|
||||
|
@ -121,10 +121,10 @@ isPOSIXOpen(const UnicodeString &pattern, int32_t pos) {
|
|||
return pattern.charAt(pos)==SET_OPEN && pattern.charAt(pos+1)==COLON;
|
||||
}
|
||||
|
||||
static inline UBool
|
||||
/*static inline UBool
|
||||
isPOSIXClose(const UnicodeString &pattern, int32_t pos) {
|
||||
return pattern.charAt(pos)==COLON && pattern.charAt(pos+1)==SET_CLOSE;
|
||||
}
|
||||
}*/
|
||||
|
||||
// TODO memory debugging provided inside uniset.cpp
|
||||
// could be made available here but probably obsolete with use of modern
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
* Copyright (c) 1996-2005, International Business Machines
|
||||
* Copyright (c) 1996-2006, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
******************************************************************************
|
||||
* File unorm.cpp
|
||||
|
@ -148,10 +148,10 @@ isNorm32HangulOrJamo(uint32_t norm32) {
|
|||
* Given isNorm32HangulOrJamo(),
|
||||
* is this a Hangul syllable or a Jamo?
|
||||
*/
|
||||
static inline UBool
|
||||
/*static inline UBool
|
||||
isHangulJamoNorm32HangulOrJamoL(uint32_t norm32) {
|
||||
return norm32<_NORM_MIN_JAMO_V;
|
||||
}
|
||||
}*/
|
||||
|
||||
/*
|
||||
* Given norm32 for Jamo V or T,
|
||||
|
@ -191,7 +191,7 @@ U_CDECL_END
|
|||
/* unorm_props_data.c is machine-generated by gennorm --csource */
|
||||
#include "unorm_props_data.c"
|
||||
|
||||
static const UBool formatVersion_2_1=TRUE, formatVersion_2_2=TRUE;
|
||||
static const UBool formatVersion_2_2=TRUE;
|
||||
|
||||
#else
|
||||
|
||||
|
|
|
@ -1120,7 +1120,6 @@ U_CAPI const UChar* U_EXPORT2 ures_getNextString(UResourceBundle *resB, int32_t*
|
|||
case URES_INT_VECTOR:
|
||||
default:
|
||||
return NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1616,13 +1615,10 @@ ures_getLocaleByType(const UResourceBundle* resourceBundle,
|
|||
switch(type) {
|
||||
case ULOC_ACTUAL_LOCALE:
|
||||
return resourceBundle->fData->fName;
|
||||
break;
|
||||
case ULOC_VALID_LOCALE:
|
||||
return resourceBundle->fTopLevelData->fName;
|
||||
break;
|
||||
case ULOC_REQUESTED_LOCALE:
|
||||
return NULL;
|
||||
break;
|
||||
default:
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
|
|
|
@ -2442,7 +2442,6 @@ TestAdditionalProperties() {
|
|||
UChar32 c;
|
||||
int32_t i, result, uVersion;
|
||||
UProperty which;
|
||||
int32_t n = 0xdeadbeef;
|
||||
|
||||
/* what is our Unicode version? */
|
||||
u_getUnicodeVersion(version);
|
||||
|
@ -2474,15 +2473,13 @@ TestAdditionalProperties() {
|
|||
) {
|
||||
log_err("error: u_getIntPropertyMinValue() wrong\n");
|
||||
}
|
||||
n=0xdeadbeef;
|
||||
if( (n= u_getIntPropertyMaxValue(UCHAR_DASH))!=1) {
|
||||
if( u_getIntPropertyMaxValue(UCHAR_DASH)!=1) {
|
||||
log_err("error: u_getIntPropertyMaxValue(UCHAR_DASH) wrong\n");
|
||||
}
|
||||
if( u_getIntPropertyMaxValue(UCHAR_ID_CONTINUE)!=1) {
|
||||
log_err("error: u_getIntPropertyMaxValue(UCHAR_ID_CONTINUE) wrong\n");
|
||||
}
|
||||
n=0xdeadbeef;
|
||||
if( (n=u_getIntPropertyMaxValue(UCHAR_BINARY_LIMIT-1))!=1) {
|
||||
if( u_getIntPropertyMaxValue(UCHAR_BINARY_LIMIT-1)!=1) {
|
||||
log_err("error: u_getIntPropertyMaxValue(UCHAR_BINARY_LIMIT-1) wrong\n");
|
||||
}
|
||||
if( u_getIntPropertyMaxValue(UCHAR_BIDI_CLASS)!=(int32_t)U_CHAR_DIRECTION_COUNT-1 ) {
|
||||
|
@ -2500,8 +2497,7 @@ TestAdditionalProperties() {
|
|||
}
|
||||
*/
|
||||
/*JB#2410*/
|
||||
n=0xdeadbeef;
|
||||
if( (n=u_getIntPropertyMaxValue(0x2345))!=-1) {
|
||||
if( u_getIntPropertyMaxValue(0x2345)!=-1) {
|
||||
log_err("error: u_getIntPropertyMaxValue(0x2345) wrong\n");
|
||||
}
|
||||
if( u_getIntPropertyMaxValue(UCHAR_DECOMPOSITION_TYPE) != (int32_t) (U_DT_COUNT - 1)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue