]> granicus.if.org Git - icu/commitdiff
ICU-8687 warnings fix (clang)
authorSteven R. Loomis <srl@icu-project.org>
Wed, 6 Jul 2011 20:05:38 +0000 (20:05 +0000)
committerSteven R. Loomis <srl@icu-project.org>
Wed, 6 Jul 2011 20:05:38 +0000 (20:05 +0000)
X-SVN-Rev: 30285

12 files changed:
icu4c/source/common/cmemory.h
icu4c/source/common/rbbi.cpp
icu4c/source/i18n/decimfmt.cpp
icu4c/source/i18n/digitlst.h
icu4c/source/i18n/dtitvinf.cpp
icu4c/source/i18n/dtptngen_impl.h
icu4c/source/i18n/nfrlist.h
icu4c/source/i18n/rbnf.cpp
icu4c/source/i18n/rematch.cpp
icu4c/source/i18n/tzfmt.cpp
icu4c/source/i18n/unicode/fmtable.h
icu4c/source/i18n/unicode/regex.h

index d5e08a5338c46b7cb41efba0dab3e78d5f764731..68daccaf35b30373f51287fee10d507efa39b87e 100644 (file)
@@ -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;
index 5350a0e57f52d6de1f41334f861c2a7cc800edcd..7eb258a99bd18150f10dc3f96a1ac2016811ed6c 100644 (file)
@@ -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;
             }
index 1e2a9a09639ff9528d8db9a6df890490838a1553..9e05200392bf3efb57506ac905d9650ea4a64d86 100644 (file)
@@ -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;
index 18ba6609dd9e80923f4ed1ac2cc14ffdb4720432..508f1b424783cbde395c2bdd542bd347e0d22ef9 100644 (file)
@@ -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);
index f5a57dd35ab2715b6468cec9473c88ca10b60409..87130a3211b8d4b366b8f638692429c74baaa8b4 100644 (file)
@@ -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;
index 25afef8138d994f4583a7fcfcd611e2bddefcc83..acc55b187242790aacd4c331735bfdaffdef8ef6 100644 (file)
@@ -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();
 };
 
index a33731d87ca555893195dbae986a18be36a81985..282051fb0d142a0a7b1e9d7f9401455da2b770ae 100644 (file)
@@ -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) {
index 4b88869a230c13634e02755e0b0a24cf81a9803b..edd8bc9ebef267b43fdb1bf5d8d85d5b20199dc9 100644 (file)
@@ -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:
index 45523017198fad0e92db9e07e35324c458a6f416..7111d5495f0fddec6195b0da8485822eb6857bcf 100644 (file)
@@ -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);
                     }
                 }
index 5347f92e56d7beef947875e74331df24a8ceb2c3..8127b6673445e7d75fc3f3e4eb8018356ee5997b 100644 (file)
@@ -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);
index 0834037ebf4d5919a913544b1ee79567f9e70d37..9cc423a71829b72663ad4f109b37be80d7af6568 100644 (file)
@@ -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
index 95d644d6555b5fb21d534c83693762a2b3a2a118..0b1f2ee22202e6d91e942190fac971c226f209b1 100644 (file)
@@ -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