aboutsummaryrefslogtreecommitdiff
path: root/crypto/property
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2021-06-04 13:19:23 +1000
committerPauli <pauli@openssl.org>2021-06-05 20:39:26 +1000
commitfa95fc1eb5eb7e84523f09248c0ce7f771cfdf58 (patch)
tree1d047e1c3fc25aee11a56d1412e8d2582386be03 /crypto/property
parent6a5f97a671de6d4d9f0cd6f6fc23ad89ca4ad69f (diff)
downloadopenssl-fa95fc1eb5eb7e84523f09248c0ce7f771cfdf58.zip
openssl-fa95fc1eb5eb7e84523f09248c0ce7f771cfdf58.tar.gz
openssl-fa95fc1eb5eb7e84523f09248c0ce7f771cfdf58.tar.bz2
Rename `n` field to `num_properties` in property definition structure.
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15614)
Diffstat (limited to 'crypto/property')
-rw-r--r--crypto/property/property_local.h2
-rw-r--r--crypto/property/property_parse.c22
-rw-r--r--crypto/property/property_query.c2
3 files changed, 13 insertions, 13 deletions
diff --git a/crypto/property/property_local.h b/crypto/property/property_local.h
index db1b0a5..5bb48a6 100644
--- a/crypto/property/property_local.h
+++ b/crypto/property/property_local.h
@@ -29,7 +29,7 @@ struct ossl_property_definition_st {
};
struct ossl_property_list_st {
- int n;
+ int num_properties;
unsigned int has_optional : 1;
OSSL_PROPERTY_DEFINITION properties[1];
};
diff --git a/crypto/property/property_parse.c b/crypto/property/property_parse.c
index 149e195..abfbbdf 100644
--- a/crypto/property/property_parse.c
+++ b/crypto/property/property_parse.c
@@ -295,7 +295,7 @@ stack_to_property_list(STACK_OF(OSSL_PROPERTY_DEFINITION) *sk)
r->properties[i] = *sk_OSSL_PROPERTY_DEFINITION_value(sk, i);
r->has_optional |= r->properties[i].optional;
}
- r->n = n;
+ r->num_properties = n;
}
return r;
}
@@ -469,12 +469,12 @@ int ossl_property_match_count(const OSSL_PROPERTY_LIST *query,
int i = 0, j = 0, matches = 0;
OSSL_PROPERTY_OPER oper;
- while (i < query->n) {
+ while (i < query->num_properties) {
if ((oper = q[i].oper) == OSSL_PROPERTY_OVERRIDE) {
i++;
continue;
}
- if (j < defn->n) {
+ if (j < defn->num_properties) {
if (q[i].name_idx > d[j].name_idx) { /* skip defn, not in query */
j++;
continue;
@@ -536,7 +536,7 @@ OSSL_PROPERTY_LIST *ossl_property_merge(const OSSL_PROPERTY_LIST *a,
const OSSL_PROPERTY_DEFINITION *copy;
OSSL_PROPERTY_LIST *r;
int i, j, n;
- const int t = a->n + b->n;
+ const int t = a->num_properties + b->num_properties;
r = OPENSSL_malloc(sizeof(*r)
+ (t == 0 ? 0 : t - 1) * sizeof(r->properties[0]));
@@ -544,10 +544,10 @@ OSSL_PROPERTY_LIST *ossl_property_merge(const OSSL_PROPERTY_LIST *a,
return NULL;
r->has_optional = 0;
- for (i = j = n = 0; i < a->n || j < b->n; n++) {
- if (i >= a->n) {
+ for (i = j = n = 0; i < a->num_properties || j < b->num_properties; n++) {
+ if (i >= a->num_properties) {
copy = &bp[j++];
- } else if (j >= b->n) {
+ } else if (j >= b->num_properties) {
copy = &ap[i++];
} else if (ap[i].name_idx <= bp[j].name_idx) {
if (ap[i].name_idx == bp[j].name_idx)
@@ -559,7 +559,7 @@ OSSL_PROPERTY_LIST *ossl_property_merge(const OSSL_PROPERTY_LIST *a,
memcpy(r->properties + n, copy, sizeof(r->properties[0]));
r->has_optional |= copy->optional;
}
- r->n = n;
+ r->num_properties = n;
if (n != t)
r = OPENSSL_realloc(r, sizeof(*r) + (n - 1) * sizeof(r->properties[0]));
return r;
@@ -672,9 +672,9 @@ size_t ossl_property_list_to_string(OSSL_LIB_CTX *ctx,
*buf = '\0';
return 1;
}
- if (list->n != 0)
- prop = &list->properties[list->n - 1];
- for (i = 0; i < list->n; i++, prop--) {
+ if (list->num_properties != 0)
+ prop = &list->properties[list->num_properties - 1];
+ for (i = 0; i < list->num_properties; i++, prop--) {
/* Skip invalid names */
if (prop->name_idx == 0)
continue;
diff --git a/crypto/property/property_query.c b/crypto/property/property_query.c
index dfcb034..6f870d3 100644
--- a/crypto/property/property_query.c
+++ b/crypto/property/property_query.c
@@ -22,7 +22,7 @@ ossl_property_find_property(const OSSL_PROPERTY_LIST *list,
|| (name_idx = ossl_property_name(libctx, name, 0)) == 0)
return NULL;
- for (i = 0; i < list->n; i++)
+ for (i = 0; i < list->num_properties; i++)
if (list->properties[i].name_idx == name_idx)
return &list->properties[i];
return NULL;