assert(expp->nd_symb == SET);
expp->nd_class = Set;
+ expp->nd_type = error_type;
/* First determine the type of the set
*/
expp->nd_set)) {
retval = 0;
}
- if (nd->nd_left) expp->nd_class = Xset;
nd = nd->nd_right;
}
if (left->nd_type == error_type) {
/* Just check parameters as if they were value parameters
*/
- expp->nd_type = error_type;
while (expp->nd_right) {
getarg(&expp, 0, 0, edf);
}
{
/* Check a call that must have a result
*/
- int retval = 1;
- if (!ChkCall(expp)) retval = 0;
+ if (! ChkCall(expp)) return 0;
+
if (expp->nd_type == 0) {
node_error(expp, "function call expected");
expp->nd_type = error_type;
- retval = 0;
+ return 0;
}
- return retval;
+ return 1;
}
int
/* First, get the name of the function or procedure
*/
- expp->nd_type = error_type;
if (ChkDesignator(left)) {
if (IsCast(left)) {
/* It was a type cast.
return tp;
}
-STATIC int
-Boolean(operator)
-{
- return operator == OR || operator == AND;
-}
+#define Boolean(operator) (operator == OR || operator == AND)
STATIC int
AllowedTypes(operator)
/* Check a binary operation.
*/
register struct node *left, *right;
- struct type *tpl, *tpr;
+ register struct type *tpl, *tpr;
int allowed;
int retval;
assert(left->nd_class == Def);
+ expp->nd_type = error_type;
switch(edf->df_value.df_stdname) {
case S_ABS:
if (!(left = getarg(&arg, T_NUMERIC, 0, edf))) return 0;
MkCoercion(&(arg->nd_left), d2);
}
else {
- expp->nd_type = error_type;
Xerror(left, "unexpected parameter type", edf);
break;
}
node_warning(expp, W_OLDFASHIONED, "NEW and DISPOSE are obsolete");
}
}
+ expp->nd_type = 0;
if (! (left = getvariable(&arg, edf))) return 0;
if (! (left->nd_type->tp_fund == T_POINTER)) {
return Xerror(left, "pointer variable expected", edf);
}
DoAssign(left, right)
- register struct node *left, *right;
+ register struct node *left;
+ struct node *right;
{
/* May we do it in this order (expression first) ???
The reference manual sais nothing about it, but the book does:
DAMN THE BOOK!
*/
register struct desig *dsr;
- register struct type *rtp, *ltp;
- struct node *rht = right;
+ register struct type *tp;
if (! (ChkExpression(right) & ChkVariable(left))) return;
- rtp = right->nd_type;
- ltp = left->nd_type;
+ tp = left->nd_type;
- if (right->nd_symb == STRING) TryToString(right, ltp);
+ if (right->nd_symb == STRING) TryToString(right, tp);
- if (! ChkAssCompat(&rht, ltp, "assignment")) {
+ if (! ChkAssCompat(&right, tp, "assignment")) {
return;
}
dsr = new_desig();
#define StackNeededFor(ds) ((ds)->dsg_kind == DSG_PLOADED \
|| (ds)->dsg_kind == DSG_INDEXED)
- CodeExpr(rht, dsr, NO_LABEL, NO_LABEL);
- if (complex(rtp)) {
+ CodeExpr(right, dsr, NO_LABEL, NO_LABEL);
+ tp = right->nd_type;
+ if (complex(tp)) {
if (StackNeededFor(dsr)) CodeAddress(dsr);
}
else {
- CodeValue(dsr, rtp);
+ CodeValue(dsr, tp);
}
- CodeMove(dsr, left, rtp);
+ CodeMove(dsr, left, tp);
free_desig(dsr);
}