diff options
author | Justin Blanchard <uncombedcoconut@gmail.com> | 2014-08-18 11:01:15 -0400 |
---|---|---|
committer | Rich Salz <rsalz@akamai.com> | 2014-08-18 11:49:16 -0400 |
commit | f756fb430eb8f5f70696f174460eb90740b318f7 (patch) | |
tree | ce3c86c0c6717e30193a3ba15d176e390d322707 /crypto/asn1 | |
parent | defe438d472bbef4d2bc5e4893560bc4eae43760 (diff) | |
download | openssl-f756fb430eb8f5f70696f174460eb90740b318f7.zip openssl-f756fb430eb8f5f70696f174460eb90740b318f7.tar.gz openssl-f756fb430eb8f5f70696f174460eb90740b318f7.tar.bz2 |
RT1815: More const'ness improvements
Add a dozen more const declarations where appropriate.
These are from Justin; while adding his patch, I noticed
ASN1_BIT_STRING_check could be fixed, too.
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/a_bitstr.c | 6 | ||||
-rw-r--r-- | crypto/asn1/asn1.h | 6 | ||||
-rw-r--r-- | crypto/asn1/charmap.pl | 2 | ||||
-rw-r--r-- | crypto/asn1/tasn_prn.c | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c index 3417996..0cb899f 100644 --- a/crypto/asn1/a_bitstr.c +++ b/crypto/asn1/a_bitstr.c @@ -212,7 +212,7 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) return(1); } -int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n) +int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n) { int w,v; @@ -229,8 +229,8 @@ int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n) * which is not specified in 'flags', 1 otherwise. * 'len' is the length of 'flags'. */ -int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, - unsigned char *flags, int flags_len) +int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, + const unsigned char *flags, int flags_len) { int i, ok; /* Check if there is one bit set at all. */ diff --git a/crypto/asn1/asn1.h b/crypto/asn1/asn1.h index d6342d0..925fdba 100644 --- a/crypto/asn1/asn1.h +++ b/crypto/asn1/asn1.h @@ -819,9 +819,9 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,const unsigned char **p int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length ); int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); -int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); -int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, - unsigned char *flags, int flags_len); +int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n); +int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, + const unsigned char *flags, int flags_len); #ifndef OPENSSL_NO_BIO int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, diff --git a/crypto/asn1/charmap.pl b/crypto/asn1/charmap.pl index 25ebf2c..878504f 100644 --- a/crypto/asn1/charmap.pl +++ b/crypto/asn1/charmap.pl @@ -71,7 +71,7 @@ print <<EOF; * Mask of various character properties */ -static unsigned char char_type[] = { +static const unsigned char char_type[] = { EOF for($i = 0; $i < 128; $i++) { diff --git a/crypto/asn1/tasn_prn.c b/crypto/asn1/tasn_prn.c index 542a091..424d395 100644 --- a/crypto/asn1/tasn_prn.c +++ b/crypto/asn1/tasn_prn.c @@ -401,8 +401,8 @@ static int asn1_print_fsname(BIO *out, int indent, const char *fname, const char *sname, const ASN1_PCTX *pctx) { - static char spaces[] = " "; - const int nspaces = sizeof(spaces) - 1; + static const char spaces[] = " "; + static const int nspaces = sizeof(spaces) - 1; #if 0 if (!sname && !fname) |