Bug 1226928 - remove Wshadow warning in ScopedNSSTypes, r=keeler draft
authorFranziskus Kiefer <franziskuskiefer@gmail.com>
Fri, 11 Mar 2016 12:18:13 +0100
changeset 339999 3d71925e9db2876ec74e40c4caf68a82125ba2e9
parent 339998 07dc0bdd7e6ee8068268d132825536d80c0d08f0
child 340000 ff10e4c5fd8dff37cb70ac9cac6027c40347b5b1
push id12869
push userjhao@mozilla.com
push dateMon, 14 Mar 2016 18:25:17 +0000
reviewerskeeler
bugs1226928
milestone48.0a1
Bug 1226928 - remove Wshadow warning in ScopedNSSTypes, r=keeler
security/manager/ssl/ScopedNSSTypes.h
--- a/security/manager/ssl/ScopedNSSTypes.h
+++ b/security/manager/ssl/ScopedNSSTypes.h
@@ -144,73 +144,73 @@ MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLAT
  *   rv = digest.End(SEC_OID_SHA1, digestContext);
  *   NS_ENSURE_SUCCESS(rv, rv)
  */
 class Digest
 {
 public:
   Digest()
   {
-    item.type = siBuffer;
-    item.data = buf;
-    item.len = 0;
+    mItem.type = siBuffer;
+    mItem.data = mItemBuf;
+    mItem.len = 0;
   }
 
   nsresult DigestBuf(SECOidTag hashAlg, const uint8_t * buf, uint32_t len)
   {
     if (len > static_cast<uint32_t>(std::numeric_limits<int32_t>::max())) {
       return NS_ERROR_INVALID_ARG;
     }
     nsresult rv = SetLength(hashAlg);
     NS_ENSURE_SUCCESS(rv, rv);
-    return MapSECStatus(PK11_HashBuf(hashAlg, item.data, buf,
+    return MapSECStatus(PK11_HashBuf(hashAlg, mItem.data, buf,
                                      static_cast<int32_t>(len)));
   }
 
   nsresult End(SECOidTag hashAlg, ScopedPK11Context & context)
   {
     nsresult rv = SetLength(hashAlg);
     NS_ENSURE_SUCCESS(rv, rv);
     uint32_t len;
-    rv = MapSECStatus(PK11_DigestFinal(context, item.data, &len, item.len));
+    rv = MapSECStatus(PK11_DigestFinal(context, mItem.data, &len, mItem.len));
     NS_ENSURE_SUCCESS(rv, rv);
     context = nullptr;
-    NS_ENSURE_TRUE(len == item.len, NS_ERROR_UNEXPECTED);
+    NS_ENSURE_TRUE(len == mItem.len, NS_ERROR_UNEXPECTED);
     return NS_OK;
   }
 
-  const SECItem & get() const { return item; }
+  const SECItem & get() const { return mItem; }
 
 private:
   nsresult SetLength(SECOidTag hashType)
   {
 #ifdef _MSC_VER
 #pragma warning(push)
     // C4061: enumerator 'symbol' in switch of enum 'symbol' is not
     // explicitly handled.
 #pragma warning(disable:4061)
 #endif
     switch (hashType)
     {
-      case SEC_OID_SHA1:   item.len = SHA1_LENGTH;   break;
-      case SEC_OID_SHA256: item.len = SHA256_LENGTH; break;
-      case SEC_OID_SHA384: item.len = SHA384_LENGTH; break;
-      case SEC_OID_SHA512: item.len = SHA512_LENGTH; break;
+      case SEC_OID_SHA1:   mItem.len = SHA1_LENGTH;   break;
+      case SEC_OID_SHA256: mItem.len = SHA256_LENGTH; break;
+      case SEC_OID_SHA384: mItem.len = SHA384_LENGTH; break;
+      case SEC_OID_SHA512: mItem.len = SHA512_LENGTH; break;
       default:
         return NS_ERROR_INVALID_ARG;
     }
 #ifdef _MSC_VER
 #pragma warning(pop)
 #endif
 
     return NS_OK;
   }
 
-  uint8_t buf[HASH_LENGTH_MAX];
-  SECItem item;
+  uint8_t mItemBuf[HASH_LENGTH_MAX];
+  SECItem mItem;
 };
 
 // Deprecated: use the equivalent UniquePtr templates instead.
 MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPK11SlotInfo,
                                           PK11SlotInfo,
                                           PK11_FreeSlot)
 MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPK11SymKey,
                                           PK11SymKey,