diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-06-18 20:40:59 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-06-25 12:51:25 -0400 |
commit | 3a4d67cf45dc1c94a33479c852a3dd7cbd4ebc95 (patch) | |
tree | d8ef3c95f1a97465a09655cdf81484296b0c1752 /src/feature | |
parent | 2da188667d37757ae999c8ab24ed35b64e08700c (diff) | |
download | tor-3a4d67cf45dc1c94a33479c852a3dd7cbd4ebc95.tar.gz tor-3a4d67cf45dc1c94a33479c852a3dd7cbd4ebc95.zip |
Port confparse to use struct_var in place of typed_var.
This requires changes to config_var_t, causing corresponding changes
throughout its users.
Diffstat (limited to 'src/feature')
-rw-r--r-- | src/feature/dirauth/shared_random_state.c | 16 | ||||
-rw-r--r-- | src/feature/nodelist/routerset.c | 2 | ||||
-rw-r--r-- | src/feature/nodelist/routerset.h | 2 |
3 files changed, 11 insertions, 9 deletions
diff --git a/src/feature/dirauth/shared_random_state.c b/src/feature/dirauth/shared_random_state.c index b2c7acba1a..cf4a654325 100644 --- a/src/feature/dirauth/shared_random_state.c +++ b/src/feature/dirauth/shared_random_state.c @@ -52,9 +52,11 @@ static const char dstate_cur_srv_key[] = "SharedRandCurrentValue"; DUMMY_TYPECHECK_INSTANCE(sr_disk_state_t); /* These next two are duplicates or near-duplicates from config.c */ -#define VAR(name, conftype, member, initvalue) \ - { name, CONFIG_TYPE_ ## conftype, offsetof(sr_disk_state_t, member), \ - initvalue CONF_TEST_MEMBERS(sr_disk_state_t, conftype, member) } +#define VAR(varname, conftype, member, initvalue) \ + { { .name = varname, \ + .type = CONFIG_TYPE_ ## conftype, \ + .offset = offsetof(sr_disk_state_t, member), }, \ + initvalue CONF_TEST_MEMBERS(sr_disk_state_t, conftype, member) } /* As VAR, but the option name and member name are the same. */ #define V(member, conftype, initvalue) \ VAR(#member, conftype, member, initvalue) @@ -83,10 +85,10 @@ static config_var_t state_vars[] = { /* "Extra" variable in the state that receives lines we can't parse. This * lets us preserve options from versions of Tor newer than us. */ -static config_var_t state_extra_var = { - "__extra", CONFIG_TYPE_LINELIST, - offsetof(sr_disk_state_t, ExtraLines), NULL - CONF_TEST_MEMBERS(sr_disk_state_t, LINELIST, ExtraLines) +static struct_member_t state_extra_var = { + .name = "__extra", + .type = CONFIG_TYPE_LINELIST, + .offset = offsetof(sr_disk_state_t, ExtraLines), }; /* Configuration format of sr_disk_state_t. */ diff --git a/src/feature/nodelist/routerset.c b/src/feature/nodelist/routerset.c index ad42e8e101..76777847ef 100644 --- a/src/feature/nodelist/routerset.c +++ b/src/feature/nodelist/routerset.c @@ -519,7 +519,7 @@ static const var_type_fns_t routerset_type_fns = { .copy = routerset_copy }; -const var_type_def_t routerset_type_defn = { +const var_type_def_t ROUTERSET_type_defn = { .name = "RouterList", .fns = &routerset_type_fns }; diff --git a/src/feature/nodelist/routerset.h b/src/feature/nodelist/routerset.h index 9d184c9852..f3bf4a1f7c 100644 --- a/src/feature/nodelist/routerset.h +++ b/src/feature/nodelist/routerset.h @@ -45,7 +45,7 @@ void routerset_free_(routerset_t *routerset); int routerset_len(const routerset_t *set); struct var_type_def_t; -extern const struct var_type_def_t routerset_type_defn; +extern const struct var_type_def_t ROUTERSET_type_defn; #ifdef ROUTERSET_PRIVATE #include "lib/container/bitarray.h" |