Skip to content

Commit

Permalink
Bug 1369871: Add "const" keyword to a long* param in a pkix test func…
Browse files Browse the repository at this point in the history
…tion. 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
  • Loading branch information
dholbert committed Jun 2, 2017
1 parent 807d2da commit 13753e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion security/pkix/test/lib/pkixtestutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ CreateEncodedSerialNumber(long serialNumberValue)
// pathLenConstraint INTEGER (0..MAX) OPTIONAL }
ByteString
CreateEncodedBasicConstraints(bool isCA,
/*optional*/ long* pathLenConstraintValue,
/*optional in*/ const long* pathLenConstraintValue,
Critical critical)
{
ByteString value;
Expand Down
2 changes: 1 addition & 1 deletion security/pkix/test/lib/pkixtestutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ 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.
Expand Down

0 comments on commit 13753e6

Please sign in to comment.