mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 09:41:54 +00:00
Filter: Moved f_inst allocation to separate function
This commit is contained in:
parent
f74d19765e
commit
4212c0e7e5
@ -87,10 +87,7 @@ struct f_inst *f_new_inst_]]INST_NAME()[[(enum f_instruction_code fi_code
|
|||||||
[[m4_undivert(102)]]
|
[[m4_undivert(102)]]
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
struct f_inst *what = cfg_allocz(sizeof(struct f_inst));
|
struct f_inst *what = fi_new(fi_code);
|
||||||
what->fi_code = fi_code;
|
|
||||||
what->lineno = ifs->lino;
|
|
||||||
what->size = 1;
|
|
||||||
#define whati (&(what->i_]]INST_NAME()[[))
|
#define whati (&(what->i_]]INST_NAME()[[))
|
||||||
[[m4_undivert(103)]]
|
[[m4_undivert(103)]]
|
||||||
#undef whati
|
#undef whati
|
||||||
@ -272,6 +269,16 @@ f_instruction_name(enum f_instruction_code fi)
|
|||||||
bug("Got unknown instruction code: %d", 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 */
|
/* Instruction constructors */
|
||||||
FID_WR_PUT(3)
|
FID_WR_PUT(3)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user