bc: better handle optional args of bc_program_pushVar()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
9721f6c8b0
commit
416ce76bcd
@ -5872,25 +5872,25 @@ static BcStatus bc_program_assign(char inst)
|
||||
return s;
|
||||
}
|
||||
|
||||
#if !ENABLE_DC
|
||||
#define bc_program_pushVar(code, bgn, pop, copy) \
|
||||
bc_program_pushVar(code, bgn)
|
||||
// for bc, 'pop' and 'copy' are always false
|
||||
#endif
|
||||
static BcStatus bc_program_pushVar(char *code, size_t *bgn,
|
||||
bool pop, bool copy)
|
||||
{
|
||||
BcStatus s = BC_STATUS_SUCCESS;
|
||||
BcResult r;
|
||||
char *name = bc_program_name(code, bgn);
|
||||
#if ENABLE_DC // Exclude
|
||||
BcNum *num;
|
||||
BcVec *v;
|
||||
#else
|
||||
(void) pop, (void) copy;
|
||||
#endif
|
||||
|
||||
r.t = BC_RESULT_VAR;
|
||||
r.d.id.name = name;
|
||||
|
||||
#if ENABLE_DC
|
||||
v = bc_program_search(name, true);
|
||||
num = bc_vec_top(v);
|
||||
{
|
||||
BcVec *v = bc_program_search(name, true);
|
||||
BcNum *num = bc_vec_top(v);
|
||||
|
||||
if (pop || copy) {
|
||||
|
||||
@ -5916,6 +5916,7 @@ static BcStatus bc_program_pushVar(char *code, size_t *bgn,
|
||||
|
||||
if (!copy) bc_vec_pop(v);
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_DC
|
||||
|
||||
bc_vec_push(&G.prog.results, &r);
|
||||
|
Loading…
x
Reference in New Issue
Block a user