| 33 |
|
|
| 34 |
|
#define newnode() (EPNODE *)ecalloc(1, sizeof(EPNODE)) |
| 35 |
|
|
| 36 |
< |
#define isdecimal(c) (isdigit(c) || (c) == '.') |
| 36 |
> |
#define isdecimal(c) (isdigit(c) | ((c) == '.')) |
| 37 |
|
|
| 38 |
|
static double euminus(EPNODE *), eargument(EPNODE *), enumber(EPNODE *); |
| 39 |
|
static double echannel(EPNODE *); |
| 198 |
|
|
| 199 |
|
} |
| 200 |
|
|
| 201 |
< |
efree((char *)epar); |
| 201 |
> |
efree(epar); |
| 202 |
|
} |
| 203 |
|
|
| 204 |
|
/* the following used to be a switch */ |
| 303 |
|
errno = ERANGE; |
| 304 |
|
} |
| 305 |
|
#endif |
| 306 |
< |
if (errno == EDOM || errno == ERANGE) { |
| 306 |
> |
if ((errno == EDOM) | (errno == ERANGE)) { |
| 307 |
|
wputs("Illegal power\n"); |
| 308 |
|
return(0.0); |
| 309 |
|
} |
| 471 |
|
{ |
| 472 |
|
int i; |
| 473 |
|
|
| 474 |
< |
if (infile != NULL || lineno != 0) { |
| 474 |
> |
if ((infile != NULL) | (lineno != 0)) { |
| 475 |
|
if (infile != NULL) eputs(infile); |
| 476 |
|
if (lineno != 0) { |
| 477 |
|
eputs(infile != NULL ? ", line " : "line "); |
| 552 |
|
str[i++] = lnext; |
| 553 |
|
lnext = scan(); |
| 554 |
|
} |
| 555 |
< |
if (lnext == '.' && i < RMAXWORD) { |
| 555 |
> |
if ((lnext == '.') & (i < RMAXWORD)) { |
| 556 |
|
str[i++] = lnext; |
| 557 |
|
lnext = scan(); |
| 558 |
|
if (i == 1 && !isdigit(lnext)) |
| 589 |
|
EPNODE *ep1, *ep2; |
| 590 |
|
|
| 591 |
|
ep1 = getE2(); |
| 592 |
< |
while (nextc == '+' || nextc == '-') { |
| 592 |
> |
while ((nextc == '+') | (nextc == '-')) { |
| 593 |
|
ep2 = newnode(); |
| 594 |
|
ep2->type = nextc; |
| 595 |
|
scan(); |
| 596 |
|
addekid(ep2, ep1); |
| 597 |
|
addekid(ep2, getE2()); |
| 598 |
|
if (esupport&E_RCONST && |
| 599 |
< |
ep1->type == NUM && ep1->sibling->type == NUM) |
| 599 |
> |
(ep1->type == NUM) & (ep1->sibling->type == NUM)) |
| 600 |
|
ep2 = rconst(ep2); |
| 601 |
|
ep1 = ep2; |
| 602 |
|
} |
| 611 |
|
EPNODE *ep1, *ep2; |
| 612 |
|
|
| 613 |
|
ep1 = getE3(); |
| 614 |
< |
while (nextc == '*' || nextc == '/') { |
| 614 |
> |
while ((nextc == '*') | (nextc == '/')) { |
| 615 |
|
ep2 = newnode(); |
| 616 |
|
ep2->type = nextc; |
| 617 |
|
scan(); |
| 619 |
|
addekid(ep2, getE3()); |
| 620 |
|
if (esupport&E_RCONST) { |
| 621 |
|
EPNODE *ep3 = ep1->sibling; |
| 622 |
< |
if (ep1->type == NUM && ep3->type == NUM) { |
| 622 |
> |
if ((ep1->type == NUM) & (ep3->type == NUM)) { |
| 623 |
|
ep2 = rconst(ep2); |
| 624 |
|
} else if (ep3->type == NUM) { |
| 625 |
|
if (ep2->type == '/') { |
| 635 |
|
} else if (ep1->type == NUM && ep1->v.num == 0) { |
| 636 |
|
epfree(ep3); /* (0 * E3) or (0 / E3) */ |
| 637 |
|
ep1->sibling = NULL; |
| 638 |
< |
efree((char *)ep2); |
| 638 |
> |
efree(ep2); |
| 639 |
|
ep2 = ep1; |
| 640 |
|
} |
| 641 |
|
} |
| 661 |
|
addekid(ep2, getE3()); |
| 662 |
|
if (esupport&E_RCONST) { |
| 663 |
|
EPNODE *ep3 = ep1->sibling; |
| 664 |
< |
if (ep1->type == NUM && ep3->type == NUM) { |
| 664 |
> |
if ((ep1->type == NUM) & (ep3->type == NUM)) { |
| 665 |
|
ep2 = rconst(ep2); |
| 666 |
|
} else if (ep1->type == NUM && ep1->v.num == 0) { |
| 667 |
|
epfree(ep3); /* (0 ^ E3) */ |
| 668 |
|
ep1->sibling = NULL; |
| 669 |
< |
efree((char *)ep2); |
| 669 |
> |
efree(ep2); |
| 670 |
|
ep2 = ep1; |
| 671 |
< |
} else if ((ep3->type == NUM && ep3->v.num == 0) || |
| 671 |
> |
} else if ((ep3->type == NUM && ep3->v.num == 0) | |
| 672 |
|
(ep1->type == NUM && ep1->v.num == 1)) { |
| 673 |
|
epfree(ep2); /* (E4 ^ 0) or (1 ^ E3) */ |
| 674 |
|
ep2 = newnode(); |
| 675 |
|
ep2->type = NUM; |
| 676 |
|
ep2->v.num = 1; |
| 677 |
|
} else if (ep3->type == NUM && ep3->v.num == 1) { |
| 678 |
< |
efree((char *)ep3); /* (E4 ^ 1) */ |
| 678 |
> |
efree(ep3); /* (E4 ^ 1) */ |
| 679 |
|
ep1->sibling = NULL; |
| 680 |
< |
efree((char *)ep2); |
| 680 |
> |
efree(ep2); |
| 681 |
|
ep2 = ep1; |
| 682 |
|
} |
| 683 |
|
} |
| 700 |
|
} |
| 701 |
|
if (ep2->type == UMINUS) { /* don't generate -(-E5) */ |
| 702 |
|
ep1 = ep2->v.kid; |
| 703 |
< |
efree((char *)ep2); |
| 703 |
> |
efree(ep2); |
| 704 |
|
return(ep1); |
| 705 |
|
} |
| 706 |
|
ep1 = newnode(); |
| 744 |
|
} |
| 745 |
|
|
| 746 |
|
if (esupport&(E_VARIABLE|E_FUNCTION) && |
| 747 |
< |
(isalpha(nextc) || nextc == CNTXMARK)) { |
| 747 |
> |
(isalpha(nextc) | (nextc == CNTXMARK))) { |
| 748 |
|
nam = getname(); |
| 749 |
|
ep1 = NULL; |
| 750 |
|
if ((esupport&(E_VARIABLE|E_FUNCTION)) == (E_VARIABLE|E_FUNCTION) |
| 803 |
|
ep->type = NUM; |
| 804 |
|
errno = 0; |
| 805 |
|
ep->v.num = evalue(epar); |
| 806 |
< |
if (errno == EDOM || errno == ERANGE) |
| 806 |
> |
if ((errno == EDOM) | (errno == ERANGE)) |
| 807 |
|
syntax("bad constant expression"); |
| 808 |
|
epfree(epar); |
| 809 |
|
|