Browse Source

frontend/define.c, ntharg(), #1/15 drop `struct pnode *ptry', use `args' instead

pre-master-46
rlar 11 years ago
parent
commit
f91f8c2a09
  1. 18
      src/frontend/define.c

18
src/frontend/define.c

@ -407,28 +407,24 @@ trcopy(struct pnode *tree, char *args, struct pnode *nn)
static struct pnode * static struct pnode *
ntharg(int num, struct pnode *args) ntharg(int num, struct pnode *args)
{ {
struct pnode *ptry;
ptry = args;
if (num > 1) if (num > 1)
while (--num > 0) { while (--num > 0) {
if (ptry && ptry->pn_op &&
(ptry->pn_op->op_num != PT_OP_COMMA)) {
if (args && args->pn_op &&
(args->pn_op->op_num != PT_OP_COMMA)) {
if (num == 1) if (num == 1)
break; break;
else else
return (NULL); return (NULL);
} }
if (!ptry)
if (!args)
return NULL; return NULL;
ptry = ptry->pn_right;
args = args->pn_right;
} }
if (ptry && ptry->pn_op && (ptry->pn_op->op_num == PT_OP_COMMA))
ptry = ptry->pn_left;
if (args && args->pn_op && (args->pn_op->op_num == PT_OP_COMMA))
args = args->pn_left;
return (ptry);
return args;
} }

Loading…
Cancel
Save