From 78976974e711e52c3b8fa6a80b290cf2fa4f692d Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 3 Jul 2019 00:00:11 +0200 Subject: Dynamic attributes definition split whether it is bitmask or not. --- filter/f-inst.h | 6 ++++-- filter/f-util.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'filter') diff --git a/filter/f-inst.h b/filter/f-inst.h index 2a2d050e..58a60f0f 100644 --- a/filter/f-inst.h +++ b/filter/f-inst.h @@ -80,8 +80,10 @@ static inline struct f_line *f_linearize(const struct f_inst *root) void f_dump_line(const struct f_line *, uint indent); struct filter *f_new_where(struct f_inst *); -static inline struct f_dynamic_attr f_new_dynamic_attr(u8 type, u8 bit, enum f_type f_type, uint code) /* Type as core knows it, type as filters know it, and code of dynamic attribute */ -{ return (struct f_dynamic_attr) { .type = type, .bit = bit, .f_type = f_type, .ea_code = code }; } /* f_type currently unused; will be handy for static type checking */ +static inline struct f_dynamic_attr f_new_dynamic_attr(u8 type, enum f_type f_type, uint code) /* Type as core knows it, type as filters know it, and code of dynamic attribute */ +{ return (struct f_dynamic_attr) { .type = type, .f_type = f_type, .ea_code = code }; } /* f_type currently unused; will be handy for static type checking */ +static inline struct f_dynamic_attr f_new_dynamic_attr_bit(u8 bit, enum f_type f_type, uint code) /* Type as core knows it, type as filters know it, and code of dynamic attribute */ +{ return (struct f_dynamic_attr) { .type = EAF_TYPE_BITFIELD, .bit = bit, .f_type = f_type, .ea_code = code }; } /* f_type currently unused; will be handy for static type checking */ static inline struct f_static_attr f_new_static_attr(int f_type, int code, int readonly) { return (struct f_static_attr) { .f_type = f_type, .sa_code = code, .readonly = readonly }; } struct f_inst *f_generate_complex(enum f_instruction_code fi_code, struct f_dynamic_attr da, struct f_inst *argument); diff --git a/filter/f-util.c b/filter/f-util.c index 4b580fb9..b4105aad 100644 --- a/filter/f-util.c +++ b/filter/f-util.c @@ -174,7 +174,7 @@ ca_lookup(pool *p, const char *name, int f_type) } cas = mb_allocz(&root_pool, sizeof(struct ca_storage) + strlen(name) + 1); - cas->fda = f_new_dynamic_attr(ea_type, 0, f_type, EA_CUSTOM(id)); + cas->fda = f_new_dynamic_attr(ea_type, f_type, EA_CUSTOM(id)); cas->uc = 1; strcpy(cas->name, name); -- cgit v1.2.3