diff options
author | Maria Matejka <mq@ucw.cz> | 2019-02-15 13:53:17 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2019-02-20 22:30:55 +0100 |
commit | 0b39b1cbb70c6f37a30a3130e1c308ddd0ba36de (patch) | |
tree | 3eae8f33016a86cda9577620b27a8301f2b1d5cb /sysdep/unix/main.c | |
parent | 132529ce8908661fd2baa0758c335006fb039ef0 (diff) |
Conf: Symbol implementation converted from void pointers to union
... and consted some declarations.
Diffstat (limited to 'sysdep/unix/main.c')
-rw-r--r-- | sysdep/unix/main.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 0fdd5b34..b0d764fa 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -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 |