summaryrefslogtreecommitdiff
path: root/filter/f-inst.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-03-25 19:51:35 +0100
committerMaria Matejka <mq@ucw.cz>2022-05-04 15:37:41 +0200
commitbc17fee1bfdbd330f5a4377bf40f6de0681afa5c (patch)
treead1a32b216cdb28d13f4cfbae1cf8c711c5d556c /filter/f-inst.h
parentd4bcef0e0bfee911d403c0cf830de3e3007eeb38 (diff)
Filter: Bitfield eattrs reading / writing moved to filter code
Before this change, fetch-update-write and bitmasking was hardcoded in attribute access code cased by the attribute type. Several filter instructions are used to do it instead. As this is certainly going to be a little bit slower than before, the switch block in attribute access code should be completely removed in near future, helping with both performance and code cleanliness. The user interface should have stayed intact.
Diffstat (limited to 'filter/f-inst.h')
-rw-r--r--filter/f-inst.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/filter/f-inst.h b/filter/f-inst.h
index df45f88e..9265ecec 100644
--- a/filter/f-inst.h
+++ b/filter/f-inst.h
@@ -89,8 +89,8 @@ void f_add_lines(const struct f_line_item *what, struct filter_iterator *fit);
struct filter *f_new_where(struct f_inst *);
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_dynamic_attr f_new_dynamic_attr_bit(u8 bit, 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_INT, .bit = bit, .f_type = T_INT, .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);