Bug 1216414 - Fix -Wimplicit-fallthrough and -Wshadow warnings in uriloader. r=mayhemer

uriloader/exthandler/nsExternalHelperAppService.cpp:1870:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
uriloader/exthandler/nsExternalHelperAppService.cpp:2188:26 [-Wshadow] declaration of 'channel' shadows a previous local
uriloader/prefetch/nsOfflineCacheUpdate.cpp:748:22 [-Wshadow] declaration of 'rv' shadows a previous local
This commit is contained in:
Chris Peterson 2015-10-19 20:28:34 -07:00
parent 2eaf342ffb
commit a79463dada
2 changed files with 7 additions and 10 deletions

View File

@ -1865,7 +1865,7 @@ void nsExternalAppHandler::SendStatusChange(ErrorType type, nsresult rv, nsIRequ
break;
}
#endif
// fall through
MOZ_FALLTHROUGH;
default:
// Generic read/write/launch error message.
@ -1882,9 +1882,11 @@ void nsExternalAppHandler::SendStatusChange(ErrorType type, nsresult rv, nsIRequ
}
break;
}
MOZ_LOG(nsExternalHelperAppService::mLog, LogLevel::Error,
("Error: %s, type=%i, listener=0x%p, transfer=0x%p, rv=0x%08X\n",
NS_LossyConvertUTF16toASCII(msgId).get(), type, mDialogProgressListener.get(), mTransfer.get(), rv));
MOZ_LOG(nsExternalHelperAppService::mLog, LogLevel::Error,
(" path='%s'\n", NS_ConvertUTF16toUTF8(path).get()));
@ -2184,13 +2186,10 @@ nsresult nsExternalAppHandler::CreateTransfer()
// Now let's add the download to history
nsCOMPtr<nsIDownloadHistory> dh(do_GetService(NS_DOWNLOADHISTORY_CONTRACTID));
if (dh) {
nsCOMPtr<nsIURI> referrer;
nsCOMPtr<nsIChannel> channel = do_QueryInterface(mRequest);
if (channel) {
NS_GetReferrerFromChannel(channel, getter_AddRefs(referrer));
}
if (channel && !NS_UsePrivateBrowsing(channel)) {
nsCOMPtr<nsIURI> referrer;
NS_GetReferrerFromChannel(channel, getter_AddRefs(referrer));
dh->AddDownload(mSourceUrl, referrer, mTimeDownloadStarted, target);
}
}

View File

@ -499,7 +499,6 @@ nsOfflineCacheUpdateItem::OnStopRequest(nsIRequest *aRequest,
return NS_OK;
}
//-----------------------------------------------------------------------------
// nsOfflineCacheUpdateItem::nsIRunnable
//-----------------------------------------------------------------------------
@ -752,7 +751,7 @@ nsOfflineManifestItem::ReadManifest(nsIInputStream *aInputStream,
for (iter = begin; iter != end; iter++) {
if (*iter == '\r' || *iter == '\n') {
nsresult rv = manifest->HandleManifestLine(begin, iter);
rv = manifest->HandleManifestLine(begin, iter);
if (NS_FAILED(rv)) {
LOG(("HandleManifestLine failed with 0x%08x", rv));
@ -924,7 +923,6 @@ nsOfflineManifestItem::HandleManifestLine(const nsCString::const_iterator &aBegi
if (NS_FAILED(rv))
break;
nsCOMPtr<nsIURI> fallbackURI;
rv = NS_NewURI(getter_AddRefs(fallbackURI), fallbackSpec, nullptr, mURI);
if (NS_FAILED(rv))