Bug 857076: fix various build warnings in security/manager/ssl/src/, r=bsmith

--HG--
extra : rebase_source : 3287d494065dfeb5b178c6801b83ac400ca6ef06
This commit is contained in:
Nathan Froyd 2013-06-24 00:57:51 -07:00
parent e244c8f406
commit 37897413c5
7 changed files with 14 additions and 7 deletions

View File

@ -13,6 +13,7 @@
#include "nsIStreamListener.h"
#include "nsIX509CertDB.h"
#include "mozilla/Casting.h"
#include "mozilla/Services.h"
#include "nsCRT.h"
@ -92,7 +93,7 @@ PSMContentDownloader::OnStartRequest(nsIRequest* request, nsISupports* context)
mBufferOffset = 0;
mBufferSize = 0;
mByteData = (char*) nsMemory::Alloc(contentLength);
mByteData = (char*) nsMemory::Alloc(SafeCast<size_t>(contentLength));
if (!mByteData)
return NS_ERROR_OUT_OF_MEMORY;

View File

@ -807,10 +807,11 @@ BlockServerCertChangeForSpdy(nsNSSSocketInfo *infoObject,
return SECSuccess;
// If GetNegotiatedNPN() failed we will assume spdy for safety's safe
if (NS_FAILED(rv))
if (NS_FAILED(rv)) {
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG,
("BlockServerCertChangeForSpdy failed GetNegotiatedNPN() call."
" Assuming spdy.\n"));
}
// Check to see if the cert has actually changed
ScopedCERTCertificate c(cert2->GetCert());

View File

@ -259,6 +259,7 @@ nsresult nsCMSMessage::CommonVerifySignature(unsigned char* aDigestData, uint32_
nsigners = NSS_CMSSignedData_SignerInfoCount(sigd);
PR_ASSERT(nsigners > 0);
NS_ENSURE_TRUE(nsigners > 0, NS_ERROR_UNEXPECTED);
si = NSS_CMSSignedData_GetSignerInfo(sigd, 0);
// See bug 324474. We want to make sure the signing cert is

View File

@ -11,6 +11,7 @@
#include "nsIObserver.h"
#include "nsNSSShutDown.h"
#include "PSMRunnable.h"
#include "mozilla/DebugOnly.h"
using namespace mozilla;
using namespace mozilla::psm;
@ -235,7 +236,7 @@ void nsKeygenThread::Run(void)
}
if (notifyObserver) {
nsresult rv = NS_DispatchToMainThread(notifyObserver);
DebugOnly<nsresult> rv = NS_DispatchToMainThread(notifyObserver);
NS_ASSERTION(NS_SUCCEEDED(rv),
"failed to dispatch keygen thread observer to main thread");
}

View File

@ -7,6 +7,7 @@
#include "nsNSSComponent.h"
#include "nsNSSIOLayer.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/Telemetry.h"
#include "prlog.h"
@ -424,7 +425,7 @@ void nsNSSSocketInfo::GetPreviousCert(nsIX509Cert** _result)
#ifndef NSS_NO_LIBPKIX
RefPtr<PreviousCertRunnable> runnable(new PreviousCertRunnable(mCallbacks));
nsresult rv = runnable->DispatchToMainThreadAndWait();
DebugOnly<nsresult> rv = runnable->DispatchToMainThreadAndWait();
NS_ASSERTION(NS_SUCCEEDED(rv), "runnable->DispatchToMainThreadAndWait() failed");
runnable->mPreviousCert.forget(_result);
#endif
@ -470,7 +471,8 @@ nsNSSSocketInfo::SetCertVerificationResult(PRErrorCode errorCode,
}
if (mPlaintextBytesRead && !errorCode) {
Telemetry::Accumulate(Telemetry::SSL_BYTES_BEFORE_CERT_CALLBACK, mPlaintextBytesRead);
Telemetry::Accumulate(Telemetry::SSL_BYTES_BEFORE_CERT_CALLBACK,
SafeCast<uint32_t>(mPlaintextBytesRead));
}
mCertVerificationState = after_cert_verification;

View File

@ -138,7 +138,7 @@ nsPKCS12Blob::ImportFromFileHelper(nsIFile *file,
nsPKCS12Blob::RetryReason &aWantRetry)
{
nsNSSShutDownPreventionLock locker;
nsresult rv;
nsresult rv = NS_OK;
SECStatus srv = SECSuccess;
SEC_PKCS12DecoderContext *dcx = nullptr;
SECItem unicodePw;

View File

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "pk11func.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/RefPtr.h"
#include "nsCOMPtr.h"
#include "PSMRunnable.h"
@ -129,7 +130,7 @@ void nsProtectedAuthThread::Run(void)
}
if (notifyObserver) {
nsresult rv = NS_DispatchToMainThread(notifyObserver);
DebugOnly<nsresult> rv = NS_DispatchToMainThread(notifyObserver);
NS_ASSERTION(NS_SUCCEEDED(rv),
"failed to dispatch protected auth observer to main thread");
}