From 1b3b6d9f2d94e659375257a5c439d250ce0075fd Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 5 Sep 2019 11:48:44 -0400 Subject: 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!) --- src/lib/confmgt/structvar.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'src/lib/confmgt/structvar.c') 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; } -- cgit v1.2.3-54-g00ecf