Bug 1220035 - Fix -Wimplicit-fallthrough warnings in xpcom. r=mccr8

xpcom/base/nsDebugImpl.cpp:458:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/ds/nsCheapSets.h:139:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/ds/nsPersistentProperties.cpp:232:9 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/ds/nsVariant.cpp:360:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/ds/nsVariant.cpp:766:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/ds/nsVariant.cpp:1658:9 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/ds/nsVariant.cpp:1661:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/glue/nsTextFormatter.cpp:355:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/glue/nsTextFormatter.cpp:362:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/io/nsWildCard.cpp:85:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/io/nsWildCard.cpp:401:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
This commit is contained in:
Chris Peterson 2015-10-29 21:31:32 -07:00
parent 3b1f584fc6
commit e3e95816d8
6 changed files with 13 additions and 10 deletions

View File

@ -433,6 +433,7 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr,
nsTraceRefcnt::WalkTheStack(stderr); nsTraceRefcnt::WalkTheStack(stderr);
#endif // !defined(MOZILLA_XPCOMRT_API) #endif // !defined(MOZILLA_XPCOMRT_API)
// Fall through to abort // Fall through to abort
MOZ_FALLTHROUGH;
case NS_ASSERT_ABORT: case NS_ASSERT_ABORT:
Abort(buf.buffer); Abort(buf.buffer);
@ -607,4 +608,3 @@ NS_ABORT_OOM(size_t aSize)
#endif #endif
MOZ_CRASH(); MOZ_CRASH();
} }

View File

@ -135,7 +135,8 @@ nsCheapSet<EntryType>::Put(const KeyType aVal)
mUnion.table = table; mUnion.table = table;
mState = MANY; mState = MANY;
} }
// Fall through. MOZ_FALLTHROUGH;
case MANY: case MANY:
mUnion.table->PutEntry(aVal); mUnion.table->PutEntry(aVal);
return NS_OK; return NS_OK;

View File

@ -227,7 +227,7 @@ nsPropertiesParser::ParseValueCharacter(char16_t aChar, const char16_t* aCur,
aTokenStart = aCur + 1; aTokenStart = aCur + 1;
break; break;
} }
// no break MOZ_FALLTHROUGH;
case '\r': case '\r':
// we're done! We have a key and value // we're done! We have a key and value

View File

@ -356,7 +356,8 @@ CloneArray(uint16_t aInType, const nsIID* aInIID,
if (aOutIID) { if (aOutIID) {
*aOutIID = *aInIID; *aOutIID = *aInIID;
} }
// fall through... MOZ_FALLTHROUGH;
case nsIDataType::VTYPE_INTERFACE: { case nsIDataType::VTYPE_INTERFACE: {
memcpy(*aOutValue, aInValue, allocSize); memcpy(*aOutValue, aInValue, allocSize);
@ -759,7 +760,7 @@ nsDiscriminatedUnion::ToString(nsACString& aOutString) const
case nsIDataType::VTYPE_WSTRING_SIZE_IS: case nsIDataType::VTYPE_WSTRING_SIZE_IS:
case nsIDataType::VTYPE_WCHAR: case nsIDataType::VTYPE_WCHAR:
NS_ERROR("ToString being called for a string type - screwy logic!"); NS_ERROR("ToString being called for a string type - screwy logic!");
// fall through... MOZ_FALLTHROUGH;
// XXX We might want stringified versions of these... ??? // XXX We might want stringified versions of these... ???
@ -1654,10 +1655,12 @@ nsDiscriminatedUnion::Traverse(nsCycleCollectionTraversalCallback& aCb) const
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(aCb, "mData[i]"); NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(aCb, "mData[i]");
aCb.NoteXPCOMChild(*p); aCb.NoteXPCOMChild(*p);
} }
break;
} }
default: default:
break; break;
} }
break;
default: default:
break; break;
} }

View File

@ -351,14 +351,14 @@ cvt_f(SprintfState* aState, double aDouble, int aWidth, int aPrec,
break; break;
case 'E': case 'E':
exp = 'E'; exp = 'E';
// no break MOZ_FALLTHROUGH;
case 'e': case 'e':
numdigits = aPrec + 1; numdigits = aPrec + 1;
mode = 2; mode = 2;
break; break;
case 'G': case 'G':
exp = 'E'; exp = 'E';
// no break MOZ_FALLTHROUGH;
case 'g': case 'g':
if (aPrec == 0) { if (aPrec == 0) {
aPrec = 1; aPrec = 1;

View File

@ -81,7 +81,7 @@ _valid_subexp(const T* aExpr, T aStop1, T aStop2)
return INVALID_SXP; return INVALID_SXP;
} }
++tld; ++tld;
/* fall through */ MOZ_FALLTHROUGH;
case '*': case '*':
case '?': case '?':
case '$': case '$':
@ -397,7 +397,7 @@ _shexp_match(const T* aStr, const T* aExpr, bool aCaseInsensitive,
return ABORTED; return ABORTED;
case '\\': case '\\':
++y; ++y;
/* fall through */ MOZ_FALLTHROUGH;
default: default:
if (aCaseInsensitive) { if (aCaseInsensitive) {
if (::upper(aStr[x]) != ::upper(aExpr[y])) { if (::upper(aStr[x]) != ::upper(aExpr[y])) {
@ -414,7 +414,6 @@ _shexp_match(const T* aStr, const T* aExpr, bool aCaseInsensitive,
return (aStr[x] ? NOMATCH : MATCH); return (aStr[x] ? NOMATCH : MATCH);
} }
template<class T> template<class T>
static int static int
ns_WildCardMatch(const T* aStr, const T* aXp, bool aCaseInsensitive) ns_WildCardMatch(const T* aStr, const T* aXp, bool aCaseInsensitive)