ICU-8687 warnings fix (clang)
X-SVN-Rev: 30285
This commit is contained in:
parent
d71f5096b1
commit
b209c07620
@ -270,7 +270,7 @@ public:
|
||||
capacity=otherCapacity;
|
||||
needToRelease=FALSE;
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Deletes the array (if owned) and allocates a new one, copying length T items.
|
||||
* Returns the new array pointer.
|
||||
@ -304,11 +304,11 @@ private:
|
||||
}
|
||||
}
|
||||
/* No comparison operators with other MaybeStackArray's. */
|
||||
bool operator==(const MaybeStackArray & /*other*/) {return FALSE;};
|
||||
bool operator!=(const MaybeStackArray & /*other*/) {return TRUE;};
|
||||
bool operator==(const MaybeStackArray & /*other*/) {return FALSE;}
|
||||
bool operator!=(const MaybeStackArray & /*other*/) {return TRUE;}
|
||||
/* No ownership transfer: No copy constructor, no assignment operator. */
|
||||
MaybeStackArray(const MaybeStackArray & /*other*/) {};
|
||||
void operator=(const MaybeStackArray & /*other*/) {};
|
||||
MaybeStackArray(const MaybeStackArray & /*other*/) {}
|
||||
void operator=(const MaybeStackArray & /*other*/) {}
|
||||
|
||||
// No heap allocation. Use only on the stack.
|
||||
// (Declaring these functions private triggers a cascade of problems:
|
||||
@ -441,7 +441,7 @@ public:
|
||||
capacity=otherCapacity;
|
||||
needToRelease=FALSE;
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Deletes the memory block (if owned) and allocates a new one,
|
||||
* copying the header and length T array items.
|
||||
@ -478,11 +478,11 @@ private:
|
||||
}
|
||||
}
|
||||
/* No comparison operators with other MaybeStackHeaderAndArray's. */
|
||||
bool operator==(const MaybeStackHeaderAndArray & /*other*/) {return FALSE;};
|
||||
bool operator!=(const MaybeStackHeaderAndArray & /*other*/) {return TRUE;};
|
||||
bool operator==(const MaybeStackHeaderAndArray & /*other*/) {return FALSE;}
|
||||
bool operator!=(const MaybeStackHeaderAndArray & /*other*/) {return TRUE;}
|
||||
/* No ownership transfer: No copy constructor, no assignment operator. */
|
||||
MaybeStackHeaderAndArray(const MaybeStackHeaderAndArray & /*other*/) {};
|
||||
void operator=(const MaybeStackHeaderAndArray & /*other*/) {};
|
||||
MaybeStackHeaderAndArray(const MaybeStackHeaderAndArray & /*other*/) {}
|
||||
void operator=(const MaybeStackHeaderAndArray & /*other*/) {}
|
||||
|
||||
// No heap allocation. Use only on the stack.
|
||||
// (Declaring these functions private triggers a cascade of problems;
|
||||
|
@ -652,7 +652,7 @@ int32_t RuleBasedBreakIterator::previous(void) {
|
||||
|
||||
int32_t start = current();
|
||||
|
||||
UTEXT_PREVIOUS32(fText);
|
||||
(void)UTEXT_PREVIOUS32(fText);
|
||||
int32_t lastResult = handlePrevious(fData->fReverseTable);
|
||||
if (lastResult == UBRK_DONE) {
|
||||
lastResult = 0;
|
||||
@ -748,7 +748,7 @@ int32_t RuleBasedBreakIterator::following(int32_t offset) {
|
||||
// move forward one codepoint to prepare for moving back to a
|
||||
// safe point.
|
||||
// this handles offset being between a supplementary character
|
||||
UTEXT_NEXT32(fText);
|
||||
(void)UTEXT_NEXT32(fText);
|
||||
// handlePrevious will move most of the time to < 1 boundary away
|
||||
handlePrevious(fData->fSafeRevTable);
|
||||
int32_t result = next();
|
||||
@ -760,7 +760,7 @@ int32_t RuleBasedBreakIterator::following(int32_t offset) {
|
||||
if (fData->fSafeFwdTable != NULL) {
|
||||
// backup plan if forward safe table is not available
|
||||
utext_setNativeIndex(fText, offset);
|
||||
UTEXT_PREVIOUS32(fText);
|
||||
(void)UTEXT_PREVIOUS32(fText);
|
||||
// handle next will give result >= offset
|
||||
handleNext(fData->fSafeFwdTable);
|
||||
// previous will give result 0 or 1 boundary away from offset,
|
||||
@ -860,7 +860,7 @@ int32_t RuleBasedBreakIterator::preceding(int32_t offset) {
|
||||
// indices to the containing code point.
|
||||
// For breakitereator::preceding only, these non-code-point indices need to be moved
|
||||
// up to refer to the following codepoint.
|
||||
UTEXT_NEXT32(fText);
|
||||
(void)UTEXT_NEXT32(fText);
|
||||
offset = (int32_t)UTEXT_GETNATIVEINDEX(fText);
|
||||
}
|
||||
|
||||
@ -869,7 +869,7 @@ int32_t RuleBasedBreakIterator::preceding(int32_t offset) {
|
||||
// (Change would interact with safe rules.)
|
||||
// TODO: change RBBI behavior for off-boundary indices to match that of UText?
|
||||
// affects only preceding(), seems cleaner, but is slightly different.
|
||||
UTEXT_PREVIOUS32(fText);
|
||||
(void)UTEXT_PREVIOUS32(fText);
|
||||
handleNext(fData->fSafeFwdTable);
|
||||
int32_t result = (int32_t)UTEXT_GETNATIVEINDEX(fText);
|
||||
while (result >= offset) {
|
||||
@ -884,7 +884,7 @@ int32_t RuleBasedBreakIterator::preceding(int32_t offset) {
|
||||
// if they use safe tables at all. We have certainly never described
|
||||
// to anyone how to work with just one safe table.
|
||||
utext_setNativeIndex(fText, offset);
|
||||
UTEXT_NEXT32(fText);
|
||||
(void)UTEXT_NEXT32(fText);
|
||||
|
||||
// handle previous will give result <= offset
|
||||
handlePrevious(fData->fSafeRevTable);
|
||||
@ -1264,7 +1264,7 @@ int32_t RuleBasedBreakIterator::handlePrevious(const RBBIStateTable *statetable)
|
||||
// Ran off start, no match found.
|
||||
// move one index one (towards the start, since we are doing a previous())
|
||||
UTEXT_SETNATIVEINDEX(fText, initialPosition);
|
||||
UTEXT_PREVIOUS32(fText); // TODO: shouldn't be necessary. We're already at beginning. Check.
|
||||
(void)UTEXT_PREVIOUS32(fText); // TODO: shouldn't be necessary. We're already at beginning. Check.
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1733,7 +1733,6 @@ DecimalFormat::parseForCurrency(const UnicodeString& text,
|
||||
int32_t pos = -1;
|
||||
const UHashElement* element = NULL;
|
||||
while ( (element = fAffixPatternsForCurrency->nextElement(pos)) != NULL ) {
|
||||
const UHashTok keyTok = element->key;
|
||||
const UHashTok valueTok = element->value;
|
||||
const AffixPatternsForCurrency* affixPtn = (AffixPatternsForCurrency*)valueTok.pointer;
|
||||
UBool tmpStatus[fgStatusLength];
|
||||
@ -4730,7 +4729,6 @@ DecimalFormat::deleteHashForAffix(Hashtable*& table)
|
||||
int32_t pos = -1;
|
||||
const UHashElement* element = NULL;
|
||||
while ( (element = table->nextElement(pos)) != NULL ) {
|
||||
const UHashTok keyTok = element->key;
|
||||
const UHashTok valueTok = element->value;
|
||||
const AffixesForCurrency* value = (AffixesForCurrency*)valueTok.pointer;
|
||||
delete value;
|
||||
@ -4750,7 +4748,6 @@ DecimalFormat::deleteHashForAffixPattern()
|
||||
int32_t pos = -1;
|
||||
const UHashElement* element = NULL;
|
||||
while ( (element = fAffixPatternsForCurrency->nextElement(pos)) != NULL ) {
|
||||
const UHashTok keyTok = element->key;
|
||||
const UHashTok valueTok = element->value;
|
||||
const AffixPatternsForCurrency* value = (AffixPatternsForCurrency*)valueTok.pointer;
|
||||
delete value;
|
||||
|
@ -148,7 +148,7 @@ public:
|
||||
int32_t compare(const DigitList& other);
|
||||
|
||||
|
||||
inline UBool operator!=(const DigitList& other) const { return !operator==(other); };
|
||||
inline UBool operator!=(const DigitList& other) const { return !operator==(other); }
|
||||
|
||||
/**
|
||||
* Clears out the digits.
|
||||
@ -279,9 +279,9 @@ public:
|
||||
/** Test for a Nan
|
||||
* @return TRUE if the number is a NaN
|
||||
*/
|
||||
UBool isNaN(void) const {return decNumberIsNaN(fDecNumber);};
|
||||
UBool isNaN(void) const {return decNumberIsNaN(fDecNumber);}
|
||||
|
||||
UBool isInfinite() const {return decNumberIsInfinite(fDecNumber);};
|
||||
UBool isInfinite() const {return decNumberIsInfinite(fDecNumber);}
|
||||
|
||||
/** Reduce, or normalize. Removes trailing zeroes, adjusts exponent appropriately. */
|
||||
void reduce();
|
||||
@ -290,10 +290,10 @@ public:
|
||||
void trim();
|
||||
|
||||
/** Set to zero */
|
||||
void setToZero() {uprv_decNumberZero(fDecNumber);};
|
||||
void setToZero() {uprv_decNumberZero(fDecNumber);}
|
||||
|
||||
/** get the number of digits in the decimal number */
|
||||
int32_t digits() const {return fDecNumber->digits;};
|
||||
int32_t digits() const {return fDecNumber->digits;}
|
||||
|
||||
/**
|
||||
* Round the number to the given number of digits.
|
||||
@ -310,7 +310,7 @@ public:
|
||||
*/
|
||||
void ensureCapacity(int32_t requestedSize, UErrorCode &status);
|
||||
|
||||
UBool isPositive(void) const { return decNumberIsNegative(fDecNumber) == 0;};
|
||||
UBool isPositive(void) const { return decNumberIsNegative(fDecNumber) == 0;}
|
||||
void setPositive(UBool s);
|
||||
|
||||
void setDecimalAt(int32_t d);
|
||||
|
@ -571,7 +571,6 @@ DateIntervalInfo::deleteHash(Hashtable* hTable)
|
||||
int32_t pos = -1;
|
||||
const UHashElement* element = NULL;
|
||||
while ( (element = hTable->nextElement(pos)) != NULL ) {
|
||||
const UHashTok keyTok = element->key;
|
||||
const UHashTok valueTok = element->value;
|
||||
const UnicodeString* value = (UnicodeString*)valueTok.pointer;
|
||||
delete[] value;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2007-2009, International Business Machines Corporation and
|
||||
* Copyright (C) 2007-2011, International Business Machines Corporation and
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*
|
||||
@ -143,7 +143,7 @@ public:
|
||||
void set(const UnicodeString& patternString);
|
||||
UBool isQuoteLiteral(const UnicodeString& s) const;
|
||||
void getQuoteLiteral(UnicodeString& quote, int32_t *itemIndex);
|
||||
int32_t getCanonicalIndex(const UnicodeString& s) { return getCanonicalIndex(s, TRUE); };
|
||||
int32_t getCanonicalIndex(const UnicodeString& s) { return getCanonicalIndex(s, TRUE); }
|
||||
int32_t getCanonicalIndex(const UnicodeString& s, UBool strict);
|
||||
UBool isPatternSeparator(UnicodeString& field);
|
||||
void setFilter(UErrorCode &status);
|
||||
@ -165,12 +165,12 @@ public:
|
||||
int32_t missingFieldMask;
|
||||
int32_t extraFieldMask;
|
||||
|
||||
DistanceInfo() {};
|
||||
virtual ~DistanceInfo() {};
|
||||
void clear() { missingFieldMask = extraFieldMask = 0; };
|
||||
DistanceInfo() {}
|
||||
virtual ~DistanceInfo() {}
|
||||
void clear() { missingFieldMask = extraFieldMask = 0; }
|
||||
void setTo(DistanceInfo& other);
|
||||
void addMissing(int32_t field) { missingFieldMask |= (1<<field); };
|
||||
void addExtra(int32_t field) { extraFieldMask |= (1<<field); };
|
||||
void addMissing(int32_t field) { missingFieldMask |= (1<<field); }
|
||||
void addExtra(int32_t field) { extraFieldMask |= (1<<field); }
|
||||
};
|
||||
|
||||
class DateTimeMatcher: public UMemory {
|
||||
@ -188,7 +188,7 @@ public:
|
||||
int32_t getDistance(const DateTimeMatcher& other, int32_t includeMask, DistanceInfo& distanceInfo);
|
||||
DateTimeMatcher();
|
||||
DateTimeMatcher(const DateTimeMatcher& other);
|
||||
virtual ~DateTimeMatcher() {};
|
||||
virtual ~DateTimeMatcher() {}
|
||||
int32_t getFieldMask();
|
||||
};
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
******************************************************************************
|
||||
* Copyright (C) 1997-2008, International Business Machines
|
||||
* Copyright (C) 1997-2011, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
******************************************************************************
|
||||
* file name: nfrlist.h
|
||||
@ -39,7 +39,7 @@ public:
|
||||
NFRuleList(uint32_t capacity = 10)
|
||||
: fStuff(capacity ? (NFRule**)uprv_malloc(capacity * sizeof(NFRule*)) : NULL)
|
||||
, fCount(0)
|
||||
, fCapacity(capacity) {};
|
||||
, fCapacity(capacity) {}
|
||||
~NFRuleList() {
|
||||
if (fStuff) {
|
||||
for(uint32_t i = 0; i < fCount; ++i) {
|
||||
|
@ -75,7 +75,7 @@ The RTTI code was also removed due to lack of code coverage.
|
||||
*/
|
||||
class LocalizationInfo : public UMemory {
|
||||
protected:
|
||||
virtual ~LocalizationInfo() {};
|
||||
virtual ~LocalizationInfo() {}
|
||||
uint32_t refcount;
|
||||
|
||||
public:
|
||||
|
@ -378,13 +378,13 @@ RegexMatcher &RegexMatcher::appendReplacement(UText *dest,
|
||||
// TODO: Report errors for mal-formed \u escapes?
|
||||
// As this is, the original sequence is output, which may be OK.
|
||||
if (context.lastOffset == offset) {
|
||||
UTEXT_PREVIOUS32(replacement);
|
||||
(void)UTEXT_PREVIOUS32(replacement);
|
||||
} else if (context.lastOffset != offset-1) {
|
||||
utext_moveIndex32(replacement, offset - context.lastOffset - 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
UTEXT_NEXT32(replacement);
|
||||
(void)UTEXT_NEXT32(replacement);
|
||||
// Plain backslash escape. Just put out the escaped character.
|
||||
if (U_IS_BMP(c)) {
|
||||
UChar c16 = (UChar)c;
|
||||
@ -427,7 +427,7 @@ RegexMatcher &RegexMatcher::appendReplacement(UText *dest,
|
||||
if (u_isdigit(digitC) == FALSE) {
|
||||
break;
|
||||
}
|
||||
UTEXT_NEXT32(replacement);
|
||||
(void)UTEXT_NEXT32(replacement);
|
||||
groupNum=groupNum*10 + u_charDigitValue(digitC);
|
||||
numDigits++;
|
||||
if (numDigits >= fPattern->fMaxCaptureDigits) {
|
||||
@ -616,7 +616,7 @@ UBool RegexMatcher::find() {
|
||||
return FALSE;
|
||||
}
|
||||
UTEXT_SETNATIVEINDEX(fInputText, startPos);
|
||||
UTEXT_NEXT32(fInputText);
|
||||
(void)UTEXT_NEXT32(fInputText);
|
||||
startPos = UTEXT_GETNATIVEINDEX(fInputText);
|
||||
}
|
||||
} else {
|
||||
@ -668,7 +668,7 @@ UBool RegexMatcher::find() {
|
||||
return FALSE;
|
||||
}
|
||||
UTEXT_SETNATIVEINDEX(fInputText, startPos);
|
||||
UTEXT_NEXT32(fInputText);
|
||||
(void)UTEXT_NEXT32(fInputText);
|
||||
startPos = UTEXT_GETNATIVEINDEX(fInputText);
|
||||
// Note that it's perfectly OK for a pattern to have a zero-length
|
||||
// match at the end of a string, so we must make sure that the loop
|
||||
@ -810,7 +810,7 @@ UBool RegexMatcher::find() {
|
||||
if (((c & 0x7f) <= 0x29) && // First quickly bypass as many chars as possible
|
||||
((c<=0x0d && c>=0x0a) || c==0x85 ||c==0x2028 || c==0x2029 )) {
|
||||
if (c == 0x0d && startPos < fActiveLimit && UTEXT_CURRENT32(fInputText) == 0x0a) {
|
||||
UTEXT_NEXT32(fInputText);
|
||||
(void)UTEXT_NEXT32(fInputText);
|
||||
startPos = UTEXT_GETNATIVEINDEX(fInputText);
|
||||
}
|
||||
MatchAt(startPos, FALSE, fDeferredStatus);
|
||||
@ -3023,7 +3023,7 @@ void RegexMatcher::MatchAt(int64_t startIdx, UBool toEnd, UErrorCode &status) {
|
||||
if (UTEXT_GETNATIVEINDEX(fInputText) >= fAnchorLimit) {
|
||||
if ((c>=0x0a && c<=0x0d) || c==0x85 || c==0x2028 || c==0x2029) {
|
||||
// If not in the middle of a CR/LF sequence
|
||||
if ( !(c==0x0a && fp->fInputIdx>fAnchorStart && (UTEXT_PREVIOUS32(fInputText), UTEXT_PREVIOUS32(fInputText))==0x0d)) {
|
||||
if ( !(c==0x0a && fp->fInputIdx>fAnchorStart && ((void)UTEXT_PREVIOUS32(fInputText), UTEXT_PREVIOUS32(fInputText))==0x0d)) {
|
||||
// At new-line at end of input. Success
|
||||
fHitEnd = TRUE;
|
||||
fRequireEnd = TRUE;
|
||||
@ -3250,7 +3250,7 @@ GC_L:
|
||||
if (sets[URX_GC_LV]->contains(c)) goto GC_V;
|
||||
if (sets[URX_GC_LVT]->contains(c)) goto GC_T;
|
||||
if (sets[URX_GC_V]->contains(c)) goto GC_V;
|
||||
UTEXT_PREVIOUS32(fInputText);
|
||||
(void)UTEXT_PREVIOUS32(fInputText);
|
||||
fp->fInputIdx = UTEXT_GETNATIVEINDEX(fInputText);
|
||||
goto GC_Extend;
|
||||
|
||||
@ -3260,7 +3260,7 @@ GC_V:
|
||||
fp->fInputIdx = UTEXT_GETNATIVEINDEX(fInputText);
|
||||
if (sets[URX_GC_V]->contains(c)) goto GC_V;
|
||||
if (sets[URX_GC_T]->contains(c)) goto GC_T;
|
||||
UTEXT_PREVIOUS32(fInputText);
|
||||
(void)UTEXT_PREVIOUS32(fInputText);
|
||||
fp->fInputIdx = UTEXT_GETNATIVEINDEX(fInputText);
|
||||
goto GC_Extend;
|
||||
|
||||
@ -3269,7 +3269,7 @@ GC_T:
|
||||
c = UTEXT_NEXT32(fInputText);
|
||||
fp->fInputIdx = UTEXT_GETNATIVEINDEX(fInputText);
|
||||
if (sets[URX_GC_T]->contains(c)) goto GC_T;
|
||||
UTEXT_PREVIOUS32(fInputText);
|
||||
(void)UTEXT_PREVIOUS32(fInputText);
|
||||
fp->fInputIdx = UTEXT_GETNATIVEINDEX(fInputText);
|
||||
goto GC_Extend;
|
||||
|
||||
@ -3283,7 +3283,7 @@ GC_Extend:
|
||||
if (sets[URX_GC_EXTEND]->contains(c) == FALSE) {
|
||||
break;
|
||||
}
|
||||
UTEXT_NEXT32(fInputText);
|
||||
(void)UTEXT_NEXT32(fInputText);
|
||||
fp->fInputIdx = UTEXT_GETNATIVEINDEX(fInputText);
|
||||
}
|
||||
goto GC_Done;
|
||||
@ -3581,7 +3581,7 @@ GC_Done:
|
||||
// In the case of a CR/LF, we need to advance over both.
|
||||
UChar32 nextc = UTEXT_CURRENT32(fInputText);
|
||||
if (nextc == 0x0a) {
|
||||
UTEXT_NEXT32(fInputText);
|
||||
(void)UTEXT_NEXT32(fInputText);
|
||||
fp->fInputIdx = UTEXT_GETNATIVEINDEX(fInputText);
|
||||
}
|
||||
}
|
||||
@ -4098,7 +4098,7 @@ GC_Done:
|
||||
(*lbStartIdx)--;
|
||||
} else {
|
||||
UTEXT_SETNATIVEINDEX(fInputText, *lbStartIdx);
|
||||
UTEXT_PREVIOUS32(fInputText);
|
||||
(void)UTEXT_PREVIOUS32(fInputText);
|
||||
*lbStartIdx = UTEXT_GETNATIVEINDEX(fInputText);
|
||||
}
|
||||
}
|
||||
@ -4174,7 +4174,7 @@ GC_Done:
|
||||
(*lbStartIdx)--;
|
||||
} else {
|
||||
UTEXT_SETNATIVEINDEX(fInputText, *lbStartIdx);
|
||||
UTEXT_PREVIOUS32(fInputText);
|
||||
(void)UTEXT_PREVIOUS32(fInputText);
|
||||
*lbStartIdx = UTEXT_GETNATIVEINDEX(fInputText);
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ private:
|
||||
};
|
||||
|
||||
TimeZoneFormatImpl::TimeZoneFormatImpl(const Locale& locale, UErrorCode& status)
|
||||
: fLocale(locale), fTimeZoneNames(NULL), fTimeZoneGenericNames(NULL), fLock(NULL) {
|
||||
: fLock(NULL),fLocale(locale), fTimeZoneNames(NULL), fTimeZoneGenericNames(NULL) {
|
||||
|
||||
const char* region = fLocale.getCountry();
|
||||
int32_t regionLen = uprv_strlen(region);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
********************************************************************************
|
||||
* Copyright (C) 1997-2010, International Business Machines
|
||||
* Copyright (C) 1997-2011, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
********************************************************************************
|
||||
*
|
||||
@ -600,7 +600,7 @@ public:
|
||||
* big decimal formatting.
|
||||
* @internal
|
||||
*/
|
||||
DigitList *getDigitList() const { return fDecimalNum;};
|
||||
DigitList *getDigitList() const { return fDecimalNum;}
|
||||
|
||||
/**
|
||||
* Adopt, and set value from, a DigitList
|
||||
|
@ -142,7 +142,7 @@ public:
|
||||
* @return TRUE if the objects are different.
|
||||
* @stable ICU 2.4
|
||||
*/
|
||||
inline UBool operator!=(const RegexPattern& that) const {return ! operator ==(that);};
|
||||
inline UBool operator!=(const RegexPattern& that) const {return ! operator ==(that);}
|
||||
|
||||
/**
|
||||
* Assignment operator. After assignment, this RegexPattern will behave identically
|
||||
|
Loading…
Reference in New Issue
Block a user