bc: remove unnecessary union use

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2018-12-19 17:15:04 +01:00
parent dfe1dd2031
commit f36a0adf8b

View File

@ -4964,7 +4964,6 @@ static BcVec* bc_program_search(char *id, bool var)
BcId e, *ptr; BcId e, *ptr;
BcVec *v, *map; BcVec *v, *map;
size_t i; size_t i;
BcResultData data;
int new; int new;
v = var ? &G.prog.vars : &G.prog.arrs; v = var ? &G.prog.vars : &G.prog.arrs;
@ -4975,8 +4974,9 @@ static BcVec* bc_program_search(char *id, bool var)
new = bc_map_insert(map, &e, &i); // 1 if insertion was successful new = bc_map_insert(map, &e, &i); // 1 if insertion was successful
if (new) { if (new) {
bc_array_init(&data.v, var); BcVec v2;
bc_vec_push(v, &data.v); bc_array_init(&v2, var);
bc_vec_push(v, &v2);
} }
ptr = bc_vec_item(map, i); ptr = bc_vec_item(map, i);
@ -5860,7 +5860,6 @@ static BC_STATUS zbc_program_call(char *code, size_t *idx)
size_t i, nparams; size_t i, nparams;
BcFunc *func; BcFunc *func;
BcId *a; BcId *a;
BcResultData param;
BcResult *arg; BcResult *arg;
nparams = bc_program_index(code, idx); nparams = bc_program_index(code, idx);
@ -5896,11 +5895,13 @@ static BC_STATUS zbc_program_call(char *code, size_t *idx)
v = bc_program_search(a->name, a->idx); v = bc_program_search(a->name, a->idx);
if (a->idx) { if (a->idx) {
bc_num_init_DEF_SIZE(&param.n); BcNum n2;
bc_vec_push(v, &param.n); bc_num_init_DEF_SIZE(&n2);
bc_vec_push(v, &n2);
} else { } else {
bc_array_init(&param.v, true); BcVec v2;
bc_vec_push(v, &param.v); bc_array_init(&v2, true);
bc_vec_push(v, &v2);
} }
} }