diff options
author | Stef Walter <stef@thewalter.net> | 2013-07-17 12:55:57 +0200 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2013-07-18 13:04:37 +0200 |
commit | e403f7b33ac35e961c72ed1b6335bbe3084e4642 (patch) | |
tree | bb9e89ab69bae17d3ab28c3a61729ad65435407c /trust | |
parent | 52a84b84a924a9f1cd8090b0a47b9f7d00ca69f3 (diff) |
Declare static variables const where it makes sense
https://bugzilla.redhat.com/show_bug.cgi?id=985337
Diffstat (limited to 'trust')
-rw-r--r-- | trust/builder.c | 38 | ||||
-rw-r--r-- | trust/extract-info.c | 2 | ||||
-rw-r--r-- | trust/extract-openssl.c | 2 | ||||
-rw-r--r-- | trust/module.c | 4 |
4 files changed, 23 insertions, 23 deletions
diff --git a/trust/builder.c b/trust/builder.c index fdaae34..038fc88 100644 --- a/trust/builder.c +++ b/trust/builder.c @@ -822,9 +822,9 @@ data_populate (p11_builder *builder, p11_index *index, CK_ATTRIBUTE *data) { - static CK_ATTRIBUTE value = { CKA_VALUE, "", 0 }; - static CK_ATTRIBUTE application = { CKA_APPLICATION, "", 0 }; - static CK_ATTRIBUTE object_id = { CKA_OBJECT_ID, "", 0 }; + static const CK_ATTRIBUTE value = { CKA_VALUE, "", 0 }; + static const CK_ATTRIBUTE application = { CKA_APPLICATION, "", 0 }; + static const CK_ATTRIBUTE object_id = { CKA_OBJECT_ID, "", 0 }; CK_ATTRIBUTE *attrs; attrs = common_populate (builder, index, data); @@ -1661,14 +1661,14 @@ replace_compat_for_cert (p11_builder *builder, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs) { - static CK_OBJECT_CLASS certificate = CKO_CERTIFICATE; - static CK_CERTIFICATE_TYPE x509 = CKC_X_509; + static const CK_OBJECT_CLASS certificate = CKO_CERTIFICATE; + static const CK_CERTIFICATE_TYPE x509 = CKC_X_509; CK_ATTRIBUTE *value; CK_ATTRIBUTE match[] = { { CKA_VALUE, }, - { CKA_CLASS, &certificate, sizeof (certificate) }, - { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, + { CKA_CLASS, (void *)&certificate, sizeof (certificate) }, + { CKA_CERTIFICATE_TYPE, (void *)&x509, sizeof (x509) }, { CKA_INVALID } }; @@ -1762,32 +1762,32 @@ p11_builder_changed (void *bilder, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs) { - static CK_OBJECT_CLASS certificate = CKO_CERTIFICATE; - static CK_OBJECT_CLASS extension = CKO_X_CERTIFICATE_EXTENSION; - static CK_CERTIFICATE_TYPE x509 = CKC_X_509; + static const CK_OBJECT_CLASS certificate = CKO_CERTIFICATE; + static const CK_OBJECT_CLASS extension = CKO_X_CERTIFICATE_EXTENSION; + static const CK_CERTIFICATE_TYPE x509 = CKC_X_509; - static CK_ATTRIBUTE match_cert[] = { - { CKA_CLASS, &certificate, sizeof (certificate) }, - { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, + static const CK_ATTRIBUTE match_cert[] = { + { CKA_CLASS, (void *)&certificate, sizeof (certificate) }, + { CKA_CERTIFICATE_TYPE, (void *)&x509, sizeof (x509) }, { CKA_INVALID } }; - static CK_ATTRIBUTE match_eku[] = { - { CKA_CLASS, &extension, sizeof (extension) }, + static const CK_ATTRIBUTE match_eku[] = { + { CKA_CLASS, (void *)&extension, sizeof (extension) }, { CKA_OBJECT_ID, (void *)P11_OID_EXTENDED_KEY_USAGE, sizeof (P11_OID_EXTENDED_KEY_USAGE) }, { CKA_INVALID } }; - static CK_ATTRIBUTE match_ku[] = { - { CKA_CLASS, &extension, sizeof (extension) }, + static const CK_ATTRIBUTE match_ku[] = { + { CKA_CLASS, (void *)&extension, sizeof (extension) }, { CKA_OBJECT_ID, (void *)P11_OID_KEY_USAGE, sizeof (P11_OID_KEY_USAGE) }, { CKA_INVALID } }; - static CK_ATTRIBUTE match_bc[] = { - { CKA_CLASS, &extension, sizeof (extension) }, + static const CK_ATTRIBUTE match_bc[] = { + { CKA_CLASS, (void *)&extension, sizeof (extension) }, { CKA_OBJECT_ID, (void *)P11_OID_BASIC_CONSTRAINTS, sizeof (P11_OID_BASIC_CONSTRAINTS) }, { CKA_INVALID } diff --git a/trust/extract-info.c b/trust/extract-info.c index 63fd03e..8468abb 100644 --- a/trust/extract-info.c +++ b/trust/extract-info.c @@ -315,7 +315,7 @@ extract_info (P11KitIter *iter, CK_ATTRIBUTE *attr; CK_RV rv; - static CK_ATTRIBUTE attr_types[] = { + static const CK_ATTRIBUTE attr_types[] = { { CKA_ID, }, { CKA_CLASS, }, { CKA_CERTIFICATE_TYPE, }, diff --git a/trust/extract-openssl.c b/trust/extract-openssl.c index b503b67..c2d37f3 100644 --- a/trust/extract-openssl.c +++ b/trust/extract-openssl.c @@ -79,7 +79,7 @@ known_usages (p11_array *oids) char *string; int i; - const char *strings[] = { + static const char *strings[] = { P11_OID_SERVER_AUTH_STR, P11_OID_CLIENT_AUTH_STR, P11_OID_CODE_SIGNING_STR, diff --git a/trust/module.c b/trust/module.c index 25a72b7..5ebe1ff 100644 --- a/trust/module.c +++ b/trust/module.c @@ -333,9 +333,9 @@ sys_C_Finalize (CK_VOID_PTR reserved) static CK_RV sys_C_Initialize (CK_VOID_PTR init_args) { - static CK_C_INITIALIZE_ARGS def_args = + static const CK_C_INITIALIZE_ARGS def_args = { NULL, NULL, NULL, NULL, CKF_OS_LOCKING_OK, NULL, }; - CK_C_INITIALIZE_ARGS *args = NULL; + const CK_C_INITIALIZE_ARGS *args = NULL; int supplied_ok; CK_RV rv; |