Bug 785918 - Replace the usages of PR_ARRAY_SIZE with mozilla::ArrayLength; r=ehsan
☠☠ backed out by 4af7c8a2159f ☠ ☠
authorJosé Guilherme Vanz <guilherme.sft@gmail.com>
Tue, 25 Sep 2012 09:57:08 -0400
changeset 108124 5f9951a2e6dfa8a292a345d617285e7271b61b80
parent 108123 0e3887667fa01ad81cfa894c7ee3f63f0c8706de
child 108125 640ffc5bc79c7b4f43718fc0dbd8de7050e279ce
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersehsan
bugs785918
milestone18.0a1
Bug 785918 - Replace the usages of PR_ARRAY_SIZE with mozilla::ArrayLength; r=ehsan
security/manager/boot/src/nsStrictTransportSecurityService.cpp
toolkit/identity/IdentityCryptoService.cpp
--- a/security/manager/boot/src/nsStrictTransportSecurityService.cpp
+++ b/security/manager/boot/src/nsStrictTransportSecurityService.cpp
@@ -347,17 +347,17 @@ int STSPreloadCompare(const void *key, c
 // Returns the preload list entry for the given host, if it exists.
 // Only does exact host matching - the user must decide how to use the returned
 // data. May return null.
 const nsSTSPreload *
 nsStrictTransportSecurityService::GetPreloadListEntry(const char *aHost)
 {
   return (const nsSTSPreload *) bsearch(aHost,
                                         kSTSPreloadList,
-                                        PR_ARRAY_SIZE(kSTSPreloadList),
+                                        mozilla::ArrayLength(kSTSPreloadList),
                                         sizeof(nsSTSPreload),
                                         STSPreloadCompare);
 }
 
 NS_IMETHODIMP
 nsStrictTransportSecurityService::IsStsURI(nsIURI* aURI, bool* aResult)
 {
   // Should be called on the main thread (or via proxy) since the permission
--- a/toolkit/identity/IdentityCryptoService.cpp
+++ b/toolkit/identity/IdentityCryptoService.cpp
@@ -452,19 +452,19 @@ GenerateDSAKeyPair(PK11SlotInfo * slot,
   };
 
   MOZ_STATIC_ASSERT(PR_ARRAY_SIZE(P) == 1024 / PR_BITS_PER_BYTE, "bad DSA P");
   MOZ_STATIC_ASSERT(PR_ARRAY_SIZE(Q) ==  160 / PR_BITS_PER_BYTE, "bad DSA Q");
   MOZ_STATIC_ASSERT(PR_ARRAY_SIZE(G) == 1024 / PR_BITS_PER_BYTE, "bad DSA G");
 
   PQGParams pqgParams  = {
     NULL /*arena*/,
-    { siBuffer, P, PR_ARRAY_SIZE(P) },
-    { siBuffer, Q, PR_ARRAY_SIZE(Q) },
-    { siBuffer, G, PR_ARRAY_SIZE(G) }
+    { siBuffer, P, mozilla::ArrayLength(P) },
+    { siBuffer, Q, mozilla::ArrayLength(Q) },
+    { siBuffer, G, mozilla::ArrayLength(G) }
   };
 
   return GenerateKeyPair(slot, privateKey, publicKey, CKM_DSA_KEY_PAIR_GEN,
                          &pqgParams);
 }
 
 NS_IMETHODIMP
 KeyGenRunnable::Run()