From 4b9fa661888bb22da14e63061089c96d01ddbd23 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 8 Apr 2002 18:37:37 +0000 Subject: [PATCH] use BVC() macro (changed in BER_BVC) to initialize constant bervals --- include/lber_pvt.h | 2 ++ servers/slapd/acl.c | 28 ++++++++++++++-------------- servers/slapd/root_dse.c | 13 ++++++------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/include/lber_pvt.h b/include/lber_pvt.h index 9fdd67f2c4..6fd8eb2c6b 100644 --- a/include/lber_pvt.h +++ b/include/lber_pvt.h @@ -86,6 +86,8 @@ ber_pvt_socket_set_nonblock LDAP_P(( ber_socket_t sd, int nb )); #define ber_bvchr(bv,c) \ memchr( (bv)->bv_val, (c), (bv)->bv_len ) +#define BER_BVC(x) { sizeof( (x) ) - 1, (x) } + LDAP_END_DECL #endif diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index fb6701f773..f3433e9008 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -24,20 +24,20 @@ * speed up compares */ static struct berval - aci_bv_entry = { sizeof("entry") - 1, "entry" }, - aci_bv_br_entry = { sizeof("[entry]") - 1, "[entry]" }, - aci_bv_br_all = { sizeof("[all]") - 1, "[all]" }, - aci_bv_access_id = { sizeof("access-id") - 1, "access-id" }, - aci_bv_anonymous = { sizeof("anonymous") - 1, "anonymous" }, - aci_bv_users = { sizeof("users") - 1, "users" }, - aci_bv_self = { sizeof("self") - 1, "self" }, - aci_bv_dnattr = { sizeof("dnattr") - 1, "dnattr" }, - aci_bv_group = { sizeof("group") - 1, "group" }, - aci_bv_role = { sizeof("role") - 1, "role" }, - aci_bv_set = { sizeof("set") - 1, "set" }, - aci_bv_set_ref = { sizeof("set-ref") - 1, "set-ref"}, - aci_bv_grant = { sizeof("grant") - 1, "grant" }, - aci_bv_deny = { sizeof("deny") - 1, "deny" }; + aci_bv_entry = BER_BVC("entry"), + aci_bv_br_entry = BER_BVC("[entry]"), + aci_bv_br_all = BER_BVC("[all]"), + aci_bv_access_id = BER_BVC("access-id"), + aci_bv_anonymous = BER_BVC("anonymous"), + aci_bv_users = BER_BVC("users"), + aci_bv_self = BER_BVC("self"), + aci_bv_dnattr = BER_BVC("dnattr"), + aci_bv_group = BER_BVC("group"), + aci_bv_role = BER_BVC("role"), + aci_bv_set = BER_BVC("set"), + aci_bv_set_ref = BER_BVC("set-ref"), + aci_bv_grant = BER_BVC("grant"), + aci_bv_deny = BER_BVC("deny"); static AccessControl * acl_get( AccessControl *ac, int *count, diff --git a/servers/slapd/root_dse.c b/servers/slapd/root_dse.c index 939761e141..b52e3558b4 100644 --- a/servers/slapd/root_dse.c +++ b/servers/slapd/root_dse.c @@ -17,15 +17,14 @@ #include "slap.h" #include - -#define BVC(x) {sizeof(x)-1, x} +#include "lber_pvt.h" static struct berval supportedFeatures[] = { - BVC("1.3.6.1.4.1.4203.1.5.1"), /* all Operational Attributes ("+") */ - BVC("1.3.6.1.4.1.4203.1.5.2"), /* OCs in Attributes List */ - BVC("1.3.6.1.4.1.4203.1.5.3"), /* (&) and (|) search filters */ - BVC("1.3.6.1.4.1.4203.1.5.4"), /* Language Tag Options */ - BVC("1.3.6.1.4.1.4203.1.5.5"), /* Language Range Options */ + BER_BVC("1.3.6.1.4.1.4203.1.5.1"), /* all Operational Attributes ("+") */ + BER_BVC("1.3.6.1.4.1.4203.1.5.2"), /* OCs in Attributes List */ + BER_BVC("1.3.6.1.4.1.4203.1.5.3"), /* (&) and (|) search filters */ + BER_BVC("1.3.6.1.4.1.4203.1.5.4"), /* Language Tag Options */ + BER_BVC("1.3.6.1.4.1.4203.1.5.5"), /* Language Range Options */ {0,NULL} }; -- 2.39.5