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/dirauth/shared_random_state.c | |
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/dirauth/shared_random_state.c')
-rw-r--r-- | src/feature/dirauth/shared_random_state.c | 16 |
1 files changed, 9 insertions, 7 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. */ |