diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-09-05 11:48:44 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-09-11 09:42:19 -0400 |
commit | 1b3b6d9f2d94e659375257a5c439d250ce0075fd (patch) | |
tree | 84892d879db29f5e4f94bc0dee886eef076fb4e1 /src/lib/confmgt/structvar.c | |
parent | 4b92f4c83a27149696e148412e09ae814f96b2eb (diff) | |
download | tor-1b3b6d9f2d94e659375257a5c439d250ce0075fd.tar.gz tor-1b3b6d9f2d94e659375257a5c439d250ce0075fd.zip |
Replace low-level {var_type,struct_var}_is_*() with flag inspection
Since the flags are now stored with compatible numbering, we can
just OR them together and see whether the flag we want is in the
result.
(Net code removal!)
Diffstat (limited to 'src/lib/confmgt/structvar.c')
-rw-r--r-- | src/lib/confmgt/structvar.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/lib/confmgt/structvar.c b/src/lib/confmgt/structvar.c index 6b725f613e..cb37f540b6 100644 --- a/src/lib/confmgt/structvar.c +++ b/src/lib/confmgt/structvar.c @@ -238,26 +238,11 @@ struct_var_get_typename(const struct_member_t *member) return def ? def->name : NULL; } -bool -struct_var_is_cumulative(const struct_member_t *member) -{ - const var_type_def_t *def = get_type_def(member); - - return def ? var_type_is_cumulative(def) : false; -} - -bool -struct_var_is_settable(const struct_member_t *member) -{ - const var_type_def_t *def = get_type_def(member); - - return def ? var_type_is_settable(def) : true; -} - -bool -struct_var_is_contained(const struct_member_t *member) +/** Return all of the flags set for this struct member. */ +uint32_t +struct_var_get_flags(const struct_member_t *member) { const var_type_def_t *def = get_type_def(member); - return def ? var_type_is_contained(def) : false; + return def ? def->flags : 0; } |