Bug 1369871: Add "const" keyword to a long* param in a pkix test function. r=keeler
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 02 Jun 2017 13:45:41 -0700
changeset 410229 3226b56675ffdb2af7790e13a5a4b927ceb0b063
parent 410228 63cc19a2300f356abf1fa03884a9ac3d4792ef57
child 410230 ac5fcb551e41400cdaad4a9659e33c1852edcd31
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler
bugs1369871
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1369871: Add "const" keyword to a long* param in a pkix test function. r=keeler The only reason this param is a pointer is so that it can be optional. It's not an outparam -- the function does not (and does not intend to) modify it -- so it should be declared as 'const' to make that clearer & to allow clients to pass in pointers to const values. MozReview-Commit-ID: HbF96YNfnSt
security/pkix/test/lib/pkixtestutil.cpp
security/pkix/test/lib/pkixtestutil.h
--- a/security/pkix/test/lib/pkixtestutil.cpp
+++ b/security/pkix/test/lib/pkixtestutil.cpp
@@ -734,17 +734,17 @@ CreateEncodedSerialNumber(long serialNum
   return Integer(serialNumberValue);
 }
 
 // BasicConstraints ::= SEQUENCE {
 //         cA                      BOOLEAN DEFAULT FALSE,
 //         pathLenConstraint       INTEGER (0..MAX) OPTIONAL }
 ByteString
 CreateEncodedBasicConstraints(bool isCA,
-                              /*optional*/ long* pathLenConstraintValue,
+                              /*optional in*/ const long* pathLenConstraintValue,
                               Critical critical)
 {
   ByteString value;
 
   if (isCA) {
     ByteString cA(Boolean(true));
     value.append(cA);
   }
--- a/security/pkix/test/lib/pkixtestutil.h
+++ b/security/pkix/test/lib/pkixtestutil.h
@@ -359,17 +359,17 @@ ByteString CreateEncodedCertificate(long
                                     const TestKeyPair& issuerKeyPair,
                                     const TestSignatureAlgorithm& signatureAlgorithm);
 
 ByteString CreateEncodedSerialNumber(long value);
 
 enum class Critical { No = 0, Yes = 1 };
 
 ByteString CreateEncodedBasicConstraints(bool isCA,
-                                         /*optional*/ long* pathLenConstraint,
+                                         /*optional in*/ const long* pathLenConstraint,
                                          Critical critical);
 
 // Creates a DER-encoded extKeyUsage extension with one EKU OID.
 ByteString CreateEncodedEKUExtension(Input eku, Critical critical);
 
 ///////////////////////////////////////////////////////////////////////////////
 // Encode OCSP responses