1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Conf: Symbol implementation converted from void pointers to union

... and consted some declarations.
This commit is contained in:
Maria Matejka
2019-02-15 13:53:17 +01:00
parent 132529ce89
commit 0b39b1cbb7
18 changed files with 149 additions and 121 deletions

View File

@@ -94,11 +94,9 @@ drop_gid(gid_t gid)
static inline void
add_num_const(char *name, int val)
{
struct symbol *s = cf_get_symbol(name);
s->class = SYM_CONSTANT | T_INT;
s->def = cfg_allocz(sizeof(struct f_val));
SYM_TYPE(s) = T_INT;
SYM_VAL(s).i = val;
struct f_val *v = cfg_alloc(sizeof(struct f_val));
*v = (struct f_val) { .type = T_INT, .val.i = val };
cf_define_symbol(cf_get_symbol(name), SYM_CONSTANT | T_INT, val, v);
}
/* the code of read_iproute_table() is based on