0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 01:31:55 +00:00

Filter: Moved f_inst allocation to separate function

This commit is contained in:
Maria Matejka 2019-07-01 12:49:02 +02:00
parent f74d19765e
commit 4212c0e7e5

View File

@ -87,10 +87,7 @@ struct f_inst *f_new_inst_]]INST_NAME()[[(enum f_instruction_code fi_code
[[m4_undivert(102)]]
)
{
struct f_inst *what = cfg_allocz(sizeof(struct f_inst));
what->fi_code = fi_code;
what->lineno = ifs->lino;
what->size = 1;
struct f_inst *what = fi_new(fi_code);
#define whati (&(what->i_]]INST_NAME()[[))
[[m4_undivert(103)]]
#undef whati
@ -272,6 +269,16 @@ f_instruction_name(enum f_instruction_code fi)
bug("Got unknown instruction code: %d", fi);
}
static inline struct f_inst *
fi_new(enum f_instruction_code fi_code)
{
struct f_inst *what = cfg_allocz(sizeof(struct f_inst));
what->lineno = ifs->lino;
what->size = 1;
what->fi_code = fi_code;
return what;
}
/* Instruction constructors */
FID_WR_PUT(3)