Bug 1236324 - Annotate intentional switch fallthroughs to suppress -Wimplicit-fallthrough warnings in toolkit/components/places/. r=mak

toolkit/components/places/Database.cpp:182:5: [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsAnnotationService.cpp:215:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsAnnotationService.cpp:227:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsAnnotationService.cpp:297:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsAnnotationService.cpp:309:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsNavHistoryResult.cpp:2420:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsNavHistoryResult.cpp:2446:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
toolkit/components/places/nsNavHistoryResult.cpp:2878:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
This commit is contained in:
Chris Peterson 2015-11-22 13:59:54 -08:00
parent 3f27125386
commit 170785f0a5
3 changed files with 10 additions and 3 deletions

View File

@ -177,7 +177,7 @@ SetJournalMode(nsCOMPtr<mozIStorageConnection>& aDBConn,
nsAutoCString journalMode;
switch (aJournalMode) {
default:
MOZ_ASSERT(false, "Trying to set an unknown journal mode.");
MOZ_FALLTHROUGH_ASSERT("Trying to set an unknown journal mode.");
// Fall through to the default DELETE journal.
case JOURNAL_DELETE:
journalMode.AssignLiteral("delete");

View File

@ -211,6 +211,7 @@ nsAnnotationService::SetPageAnnotation(nsIURI* aURI,
return NS_OK;
}
// Fall through int64_t case otherwise.
MOZ_FALLTHROUGH;
}
case nsIDataType::VTYPE_INT64:
case nsIDataType::VTYPE_UINT64: {
@ -223,6 +224,7 @@ nsAnnotationService::SetPageAnnotation(nsIURI* aURI,
return NS_OK;
}
// Fall through double case otherwise.
MOZ_FALLTHROUGH;
}
case nsIDataType::VTYPE_FLOAT:
case nsIDataType::VTYPE_DOUBLE: {
@ -293,6 +295,7 @@ nsAnnotationService::SetItemAnnotation(int64_t aItemId,
return NS_OK;
}
// Fall through int64_t case otherwise.
MOZ_FALLTHROUGH;
}
case nsIDataType::VTYPE_INT64:
case nsIDataType::VTYPE_UINT64: {
@ -305,6 +308,7 @@ nsAnnotationService::SetItemAnnotation(int64_t aItemId,
return NS_OK;
}
// Fall through double case otherwise.
MOZ_FALLTHROUGH;
}
case nsIDataType::VTYPE_FLOAT:
case nsIDataType::VTYPE_DOUBLE: {

View File

@ -2416,6 +2416,7 @@ nsNavHistoryQueryResultNode::OnVisit(nsIURI* aURI, int64_t aVisitId,
// Fall through to check the time, if the time is not present it will
// still match.
MOZ_FALLTHROUGH;
}
case QUERYUPDATE_TIME: {
@ -2440,8 +2441,9 @@ nsNavHistoryQueryResultNode::OnVisit(nsIURI* aURI, int64_t aVisitId,
if (aTime > endTime)
return NS_OK; // after our time range
}
// Now we know that our visit satisfies the time range, fallback to the
// QUERYUPDATE_SIMPLE case.
// Now we know that our visit satisfies the time range, fall through to
// the QUERYUPDATE_SIMPLE case below.
MOZ_FALLTHROUGH;
}
case QUERYUPDATE_SIMPLE: {
@ -2876,6 +2878,7 @@ nsNavHistoryQueryResultNode::OnItemChanged(int64_t aItemId,
// folders titles.
if (mOptions->ResultType() != nsINavHistoryQueryOptions::RESULTS_AS_TAG_QUERY)
return NS_OK;
MOZ_FALLTHROUGH;
default:
(void)Refresh();
}