From 1341f3bcd17644c9528ac7129f0a5bf289218178 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Sat, 30 Nov 2002 04:41:53 +0000 Subject: [PATCH] ICU-2000 Fix some compiler warnings X-SVN-Rev: 10411 --- icu4c/source/common/rbbi.cpp | 8 ++++---- icu4c/source/common/rbbidata.cpp | 11 +++++------ icu4c/source/common/rbbinode.cpp | 6 +++--- icu4c/source/common/rbbirb.cpp | 3 ++- icu4c/source/common/rbbiscan.cpp | 14 ++++++++------ icu4c/source/common/rbbisetb.cpp | 2 +- icu4c/source/common/rbbistbl.cpp | 18 +++++++++--------- icu4c/source/common/ubrk.cpp | 4 ++-- icu4c/source/common/ucnv_bld.c | 2 +- icu4c/source/common/ucnv_io.c | 2 +- icu4c/source/common/udata.c | 2 +- icu4c/source/common/unicode/unifunct.h | 2 +- icu4c/source/common/unicode/uniset.h | 2 +- icu4c/source/common/uprops.c | 2 +- icu4c/source/common/ustrtrns.c | 4 ++-- 15 files changed, 42 insertions(+), 40 deletions(-) diff --git a/icu4c/source/common/rbbi.cpp b/icu4c/source/common/rbbi.cpp index 5e04288daa0..de6fc271be1 100644 --- a/icu4c/source/common/rbbi.cpp +++ b/icu4c/source/common/rbbi.cpp @@ -49,7 +49,7 @@ RuleBasedBreakIterator::fgClassID = 0; RuleBasedBreakIterator::RuleBasedBreakIterator(RBBIDataHeader* data, UErrorCode &status) { init(); - if (U_FAILURE(status)) {return;}; + if (U_FAILURE(status)) {return;} fData = new RBBIDataWrapper(data, status); if(fData == 0) { status = U_MEMORY_ALLOCATION_ERROR; @@ -66,7 +66,7 @@ RuleBasedBreakIterator::RuleBasedBreakIterator(RBBIDataHeader* data, UErrorCode RuleBasedBreakIterator::RuleBasedBreakIterator(UDataMemory* udm, UErrorCode &status) { init(); - if (U_FAILURE(status)) {return;}; + if (U_FAILURE(status)) {return;} fData = new RBBIDataWrapper(udm, status); if(fData == 0) { status = U_MEMORY_ALLOCATION_ERROR; @@ -86,7 +86,7 @@ RuleBasedBreakIterator::RuleBasedBreakIterator( const UnicodeString &rules, UErrorCode &status) { init(); - if (U_FAILURE(status)) {return;}; + if (U_FAILURE(status)) {return;} RuleBasedBreakIterator *bi = (RuleBasedBreakIterator *) RBBIRuleBuilder::createRuleBasedBreakIterator(rules, parseError, status); // Note: This is a bit awkward. The RBBI ruleBuilder has a factory method that @@ -284,7 +284,7 @@ RuleBasedBreakIterator::getText() const { if (nonConstThis->fText == NULL) { // TODO: do this in a way that does not do a default conversion! nonConstThis->fText = new StringCharacterIterator(""); - }; + } return *nonConstThis->fText; } diff --git a/icu4c/source/common/rbbidata.cpp b/icu4c/source/common/rbbidata.cpp index 45f82e163bb..bd9b10c5d28 100644 --- a/icu4c/source/common/rbbidata.cpp +++ b/icu4c/source/common/rbbidata.cpp @@ -145,8 +145,7 @@ UBool RBBIDataWrapper::operator ==(const RBBIDataWrapper &other) const { int32_t RBBIDataWrapper::hashCode() { return fHeader->fFTableLen; -; -}; +} @@ -161,13 +160,13 @@ void RBBIDataWrapper::removeReference() { if (umtx_atomic_dec(&fRefCount) == 0) { delete this; } -}; +} RBBIDataWrapper *RBBIDataWrapper::addReference() { umtx_atomic_inc(&fRefCount); return this; -}; +} @@ -196,7 +195,7 @@ void RBBIDataWrapper::printData() { RBBIDebugPrintf(" Forward State Transition Table\n"); RBBIDebugPrintf("State | Acc LA Tag"); - for (c=0; cfCatCount; c++) {RBBIDebugPrintf("%3d ", c);}; + for (c=0; cfCatCount; c++) {RBBIDebugPrintf("%3d ", c);} RBBIDebugPrintf("\n------|---------------"); for (c=0;cfCatCount; c++) {RBBIDebugPrintf("----");} RBBIDebugPrintf("\n"); @@ -206,7 +205,7 @@ void RBBIDataWrapper::printData() { RBBIDebugPrintf("%4d | %3d %3d %3d ", s, row->fAccepting, row->fLookAhead, row->fTag); for (c=0; cfCatCount; c++) { RBBIDebugPrintf("%3d ", row->fNextState[c]); - }; + } RBBIDebugPrintf("\n"); } diff --git a/icu4c/source/common/rbbinode.cpp b/icu4c/source/common/rbbinode.cpp index 1d69b940c09..93d14182a7d 100644 --- a/icu4c/source/common/rbbinode.cpp +++ b/icu4c/source/common/rbbinode.cpp @@ -65,7 +65,7 @@ RBBINode::RBBINode(NodeType t) : UMemory() { else if (t==opStart) {fPrecedence = precStart;} else if (t==opLParen) {fPrecedence = precLParen;} -}; +} RBBINode::RBBINode(const RBBINode &other) : UMemory(other) { @@ -85,7 +85,7 @@ RBBINode::RBBINode(const RBBINode &other) : UMemory(other) { fFirstPosSet = new UVector(status); // TODO - get a real status from somewhere fLastPosSet = new UVector(status); fFollowPos = new UVector(status); -}; +} //------------------------------------------------------------------------- @@ -154,7 +154,7 @@ RBBINode *RBBINode::cloneTree() { } } return n; -}; +} diff --git a/icu4c/source/common/rbbirb.cpp b/icu4c/source/common/rbbirb.cpp index b8018a30980..88b74d7fef0 100644 --- a/icu4c/source/common/rbbirb.cpp +++ b/icu4c/source/common/rbbirb.cpp @@ -105,7 +105,8 @@ RBBIRuleBuilder::~RBBIRuleBuilder() { // which is also the format needed by the RBBI runtime engine. // //---------------------------------------------------------------------------------------- -static int32_t align8(int32_t i) {return (i+7) & 0xfffffff8;}; +static int32_t align8(int32_t i) {return (i+7) & 0xfffffff8;} + RBBIDataHeader *RBBIRuleBuilder::flattenData() { if (U_FAILURE(*fStatus)) { return NULL; diff --git a/icu4c/source/common/rbbiscan.cpp b/icu4c/source/common/rbbiscan.cpp index cccd5e97c26..00c8f7eced8 100644 --- a/icu4c/source/common/rbbiscan.cpp +++ b/icu4c/source/common/rbbiscan.cpp @@ -78,7 +78,7 @@ static void U_EXPORT2 U_CALLCONV RBBISetTable_deleter(void *p) { // Note: px->val is owned by the linked list "fSetsListHead" in scanner. // Don't delete the value nodes here. uprv_free(px); -}; +} U_CDECL_END @@ -462,7 +462,9 @@ UBool RBBIRuleScanner::doParseActions(EParseAction action) case doStartVariableName: n = pushNewNode(RBBINode::varRef); - if (U_FAILURE(*fRB->fStatus)) {break;}; + if (U_FAILURE(*fRB->fStatus)) { + break; + } n->fFirstPos = fScanIndex; break; @@ -511,7 +513,7 @@ UBool RBBIRuleScanner::doParseActions(EParseAction action) break; } return returnVal; -}; +} @@ -988,7 +990,7 @@ void RBBIRuleScanner::parse() { void RBBIRuleScanner::printNodeStack(const char *title) { int i; RBBIDebugPrintf("%s. Dumping node stack...\n", title); - for (i=fNodeStackPtr; i>0; i--) {fNodeStack[i]->printTree();}; + for (i=fNodeStackPtr; i>0; i--) {fNodeStack[i]->printTree();} } @@ -1013,7 +1015,7 @@ RBBINode *RBBIRuleScanner::pushNewNode(RBBINode::NodeType t) { *fRB->fStatus = U_MEMORY_ALLOCATION_ERROR; } return fNodeStack[fNodeStackPtr]; -}; +} @@ -1082,7 +1084,7 @@ void RBBIRuleScanner::scanSet() { findSetFor(n->fText, n, uset); } -}; +} U_NAMESPACE_END diff --git a/icu4c/source/common/rbbisetb.cpp b/icu4c/source/common/rbbisetb.cpp index 7d3342c3d92..cc0da963a37 100644 --- a/icu4c/source/common/rbbisetb.cpp +++ b/icu4c/source/common/rbbisetb.cpp @@ -382,7 +382,7 @@ void RBBISetBuilder::printRangeGroups() { lastPrintedGroupNum = groupNum; RBBIDebugPrintf("%2i ", groupNum); - if (rlRange->fNum & 0x4000) { RBBIDebugPrintf(" ");}; + if (rlRange->fNum & 0x4000) { RBBIDebugPrintf(" ");} for (i=0; ifIncludesSets->size(); i++) { RBBINode *usetNode = (RBBINode *)rlRange->fIncludesSets->elementAt(i); diff --git a/icu4c/source/common/rbbistbl.cpp b/icu4c/source/common/rbbistbl.cpp index 7f981ba156a..14aa1e57b8b 100644 --- a/icu4c/source/common/rbbistbl.cpp +++ b/icu4c/source/common/rbbistbl.cpp @@ -31,7 +31,7 @@ U_CDECL_BEGIN static void U_EXPORT2 U_CALLCONV RBBISymbolTableEntry_deleter(void *p) { RBBISymbolTableEntry *px = (RBBISymbolTableEntry *)p; delete px; -}; +} U_CDECL_END @@ -49,14 +49,14 @@ RBBISymbolTable::RBBISymbolTable(RBBIRuleScanner *rs, const UnicodeString &rules fHashTable = uhash_open(uhash_hashUnicodeString, uhash_compareUnicodeString, &status); uhash_setValueDeleter(fHashTable, RBBISymbolTableEntry_deleter); -}; +} RBBISymbolTable::~RBBISymbolTable() { uhash_close(fHashTable); -}; +} // @@ -98,7 +98,7 @@ const UnicodeString *RBBISymbolTable::lookup(const UnicodeString& s) const This->fCachedSetLookup = NULL; } return retString; -}; +} @@ -122,7 +122,7 @@ const UnicodeFunctor *RBBISymbolTable::lookupMatcher(UChar32 ch) const This->fCachedSetLookup = 0; } return retVal; -}; +} // // RBBISymbolTable::parseReference This function from the abstract symbol table interface @@ -172,7 +172,7 @@ RBBINode *RBBISymbolTable::lookupNode(const UnicodeString &key) const{ retNode = el->val; } return retNode; -}; +} // @@ -197,11 +197,11 @@ void RBBISymbolTable::addEntry (const UnicodeString &key, RBBINode * if (e == NULL) { err = U_MEMORY_ALLOCATION_ERROR; return; - }; + } e->key = key; e->val = val; uhash_put( fHashTable, &e->key, e, &err); -}; +} RBBISymbolTableEntry::RBBISymbolTableEntry() : UMemory(), key(), val(NULL) {} @@ -217,7 +217,7 @@ RBBISymbolTableEntry::~RBBISymbolTableEntry() { delete val; // Note: the key UnicodeString is destructed by virtue of being in the object by value. -}; +} // diff --git a/icu4c/source/common/ubrk.cpp b/icu4c/source/common/ubrk.cpp index a0920c33b0f..8cfb93c20d0 100644 --- a/icu4c/source/common/ubrk.cpp +++ b/icu4c/source/common/ubrk.cpp @@ -256,13 +256,13 @@ U_CAPI UBool U_EXPORT2 ubrk_isBoundary(UBreakIterator *bi, int32_t offset) { return ((BreakIterator *)bi)->isBoundary(offset); -}; +} U_CAPI int32_t U_EXPORT2 ubrk_getRuleStatus(UBreakIterator *bi) { return ((RuleBasedBreakIterator *)bi)->getRuleStatus(); -}; +} #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ diff --git a/icu4c/source/common/ucnv_bld.c b/icu4c/source/common/ucnv_bld.c index c12827e7b0e..08a71cddf95 100644 --- a/icu4c/source/common/ucnv_bld.c +++ b/icu4c/source/common/ucnv_bld.c @@ -231,7 +231,7 @@ ucnv_copyPlatformString(char *platformString, UConverterPlatform pltfrm) return 4; case UCNV_UNKNOWN: break; - }; + } /* default to empty string */ *platformString = 0; diff --git a/icu4c/source/common/ucnv_io.c b/icu4c/source/common/ucnv_io.c index 937d4f7f906..0240df6ec46 100644 --- a/icu4c/source/common/ucnv_io.c +++ b/icu4c/source/common/ucnv_io.c @@ -275,7 +275,7 @@ haveAliasData(UErrorCode *pErrorCode) { return TRUE; } -U_INLINE static UBool +static U_INLINE UBool isAlias(const char *alias, UErrorCode *pErrorCode) { if(alias==NULL) { *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR; diff --git a/icu4c/source/common/udata.c b/icu4c/source/common/udata.c index a09cf9f40fd..7db32ba56be 100644 --- a/icu4c/source/common/udata.c +++ b/icu4c/source/common/udata.c @@ -1103,7 +1103,7 @@ doOpenChoice(const char *path, const char *type, const char *name, if (!(isICUData && pCommonData && extendICUData(pCommonData, &errorCode))) { break; } - }; + } /* data not found */ if(U_SUCCESS(*pErrorCode)) { diff --git a/icu4c/source/common/unicode/unifunct.h b/icu4c/source/common/unicode/unifunct.h index b29fac9755d..40c6d74753b 100644 --- a/icu4c/source/common/unicode/unifunct.h +++ b/icu4c/source/common/unicode/unifunct.h @@ -97,7 +97,7 @@ class U_COMMON_API UnicodeFunctor : public UObject { * class have the same class ID. Objects of other classes have * different class IDs. */ - virtual UClassID getDynamicClassID(void) const { return getStaticClassID(); }; + virtual UClassID getDynamicClassID(void) const { return getStaticClassID(); } /** * Set the data object associated with this functor. The data diff --git a/icu4c/source/common/unicode/uniset.h b/icu4c/source/common/unicode/uniset.h index d187c478df3..4d92e53ba21 100644 --- a/icu4c/source/common/unicode/uniset.h +++ b/icu4c/source/common/unicode/uniset.h @@ -1012,7 +1012,7 @@ public: * class have the same class ID. Objects of other classes have * different class IDs. */ - virtual UClassID getDynamicClassID(void) const { return getStaticClassID(); }; + virtual UClassID getDynamicClassID(void) const { return getStaticClassID(); } private: diff --git a/icu4c/source/common/uprops.c b/icu4c/source/common/uprops.c index 7ab1ea69340..93d071d4260 100644 --- a/icu4c/source/common/uprops.c +++ b/icu4c/source/common/uprops.c @@ -229,7 +229,7 @@ u_hasBinaryProperty(UChar32 c, UProperty which) { default: /* not a known binary property */ return FALSE; - }; + } } U_CAPI UBool U_EXPORT2 diff --git a/icu4c/source/common/ustrtrns.c b/icu4c/source/common/ustrtrns.c index df6da4263cc..623993dfbe6 100644 --- a/icu4c/source/common/ustrtrns.c +++ b/icu4c/source/common/ustrtrns.c @@ -32,7 +32,7 @@ #include "ustr_imp.h" -U_INLINE static UBool +static U_INLINE UBool u_growAnyBufferFromStatic(void *context, void **pBuffer, int32_t *pCapacity, int32_t reqCapacity, int32_t length, int32_t size) { @@ -292,7 +292,7 @@ u_strFromUTF8(UChar *dest, return dest; } -U_INLINE static uint8_t * +static U_INLINE uint8_t * _appendUTF8(uint8_t *pDest, UChar32 c) { /* c<=0x7f is handled by the caller, here it is 0x80<=c<=0x10ffff */ if((c)<=0x7ff) {