Bug 753238 bustage fix: fix uninitialized variable use, and clang build error (error: non-constant-expression cannot be narrowed from type 'int' to 'unsigned int' in initializer list [-Wc++11-narrowing]), irc-r=jlebar
authorGavin Sharp <gavin@gavinsharp.com>
Sat, 07 Jul 2012 23:07:26 -0700
changeset 101338 1751d97cc9e4f1e71ed98e8d7564714aa160ff14
parent 101337 9533b40ff28b292e772572c932915300dd7d1c79
child 101357 221f1a184f678d18579473688ef94a37c43df048
child 101367 b794372c1ad2a1691b98245f009e58da44e24a7c
child 101459 11aa96777b29cabf272fbdfee1eaef16883a231b
push id1729
push userlsblakk@mozilla.com
push dateMon, 16 Jul 2012 20:02:43 +0000
treeherdermozilla-aurora@f4e75e148951 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs753238
milestone16.0a1
Bug 753238 bustage fix: fix uninitialized variable use, and clang build error (error: non-constant-expression cannot be narrowed from type 'int' to 'unsigned int' in initializer list [-Wc++11-narrowing]), irc-r=jlebar
toolkit/identity/IdentityCryptoService.cpp
--- a/toolkit/identity/IdentityCryptoService.cpp
+++ b/toolkit/identity/IdentityCryptoService.cpp
@@ -214,17 +214,17 @@ public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIIDENTITYCRYPTOSERVICE
 
   IdentityCryptoService() { }
   nsresult Init()
   {
     nsresult rv;
     nsCOMPtr<nsISupports> dummyUsedToEnsureNSSIsInitialized
-      = do_GetService("@mozilla.org/psm;1");
+      = do_GetService("@mozilla.org/psm;1", &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return NS_OK;
   }
 
 private:
   IdentityCryptoService(const KeyPair &) MOZ_DELETE;
   void operator=(const IdentityCryptoService &) MOZ_DELETE;
@@ -539,17 +539,17 @@ SignRunnable::Run()
         mRv = PRErrorCode_to_nsresult(PR_GetError());
       } else if (!SECITEM_AllocItem(NULL, &sig, sigLength)) {
         mRv = PRErrorCode_to_nsresult(PR_GetError());
       } else {
         PRUint8 hash[32]; // big enough for SHA-1 or SHA-256
         SECOidTag hashAlg = mPrivateKey->keyType == dsaKey ? SEC_OID_SHA1
                                                            : SEC_OID_SHA256;
         SECItem hashItem = { siBuffer, hash,
-                             hashAlg == SEC_OID_SHA1 ? 20 : 32 };
+                             hashAlg == SEC_OID_SHA1 ? 20u : 32u };
 
         mRv = MapSECStatus(PK11_HashBuf(hashAlg, hash,
                     const_cast<PRUint8*>(reinterpret_cast<const PRUint8 *>(
                                             mTextToSign.get())),
                                       mTextToSign.Length()));
         if (NS_SUCCEEDED(mRv)) {
           mRv = MapSECStatus(PK11_Sign(mPrivateKey, &sig, &hashItem));
         }