}
/* save it */
- addSymChain (sym);
+ addSymChain (&sym);
sym->cdef = 1;
allocVariables (sym);
return sym;
}
/* save it */
- addSymChain (sym);
+ addSymChain (&sym);
sym->cdef = 1;
allocVariables (sym);
return sym;
/* if the function is being called via a pointer & */
/* it has not been defined a reentrant then we cannot */
/* have parameters */
- if (func->type != EX_VALUE && !IFFUNC_ISREENT (functype) && !options.stackAuto)
+ /* PIC16 port can... */
+ if (!TARGET_IS_PIC16)
{
- werror (W_NONRENT_ARGS);
- fatalError++;
- return 1;
+ if (func->type != EX_VALUE && !IFFUNC_ISREENT (functype) && !options.stackAuto)
+ {
+ werror (W_NONRENT_ARGS);
+ fatalError++;
+ return 1;
+ }
}
/* if defined parameters ended but actual parameters */
if (noAlloc == 0)
{
/* allocate it */
- addSymChain (sym);
+ addSymChain (&sym);
allocVariables (sym);
}
sym->ival = NULL;
}
}
+ else
+ return FALSE;
/* check loop expression is of the form <sym>++ */
if (!IS_AST_OP (loopExpr))
break;
case RESULT_TYPE_CHAR:
if (IS_CHAR (tree->etype) ||
- IS_FLOAT(tree->etype))
+ IS_FLOAT(tree->etype) ||
+ IS_FIXED(tree->etype))
return tree;
newLink = newCharLink();
break;
{
switch (tree->opval.op)
{
+ case AND_OP:
+ case OR_OP:
+ return resultType;
case '=':
case '?':
case ':':
return tree;
}
LRVAL (tree) = 1;
- TTYPE (tree) = TETYPE (tree) = newCharLink ();
+ TTYPE (tree) = TETYPE (tree) = (resultTypeProp == RESULT_TYPE_BIT) ? newBoolLink() :newCharLink();
return tree;
/*------------------------------------------------------------------*/
return tree;
case GETHBIT:
- TTYPE (tree) = TETYPE (tree) = newCharLink ();
+ TTYPE (tree) = TETYPE (tree) = (resultTypeProp == RESULT_TYPE_BIT) ? newBoolLink() :newCharLink();
return tree;
case LEFT_OP:
if (IS_ADDRESS_OF_OP(tree->right)
&& IS_AST_SYM_VALUE (tree->right->left)
&& SPEC_ABSA (AST_SYMBOL (tree->right->left)->etype)) {
+
+ symbol * sym = AST_SYMBOL (tree->right->left);
+ unsigned int gptype = 0;
+ unsigned int addr = SPEC_ADDR (sym->etype);
+ if (IS_GENPTR (LTYPE (tree)) && GPTRSIZE > FPTRSIZE)
+ {
+ switch (SPEC_SCLS (sym->etype))
+ {
+ case S_CODE:
+ gptype = GPTYPE_CODE;
+ break;
+ case S_XDATA:
+ gptype = GPTYPE_FAR;
+ break;
+ case S_DATA:
+ case S_IDATA:
+ gptype = GPTYPE_NEAR;
+ break;
+ case S_PDATA:
+ gptype = GPTYPE_XSTACK;
+ break;
+ default:
+ gptype = 0;
+ }
+ addr |= gptype << (8*(GPTRSIZE - 1));
+ }
+
tree->type = EX_VALUE;
tree->opval.val =
- valCastLiteral (LTYPE (tree),
- SPEC_ADDR (AST_SYMBOL (tree->right->left)->etype));
+ valCastLiteral (LTYPE (tree), addr);
TTYPE (tree) = tree->opval.val->type;
TETYPE (tree) = getSpec (TTYPE (tree));
tree->left = NULL;
return tree;
}
LRVAL (tree) = RRVAL (tree) = 1;
- TTYPE (tree) = TETYPE (tree) = newCharLink ();
+ TTYPE (tree) = TETYPE (tree) = (resultTypeProp == RESULT_TYPE_BIT) ? newBoolLink() :newCharLink();
return tree;
/*------------------------------------------------------------------*/
case V_FLOAT:
typeofv = TYPEOF_FLOAT;
break;
+ case V_FIXED16X16:
+ typeofv = TYPEOF_FIXED16X16;
+ break;
case V_CHAR:
typeofv = TYPEOF_CHAR;
break;
case ':':
/* if they don't match we have a problem */
- if (compareType (LTYPE (tree), RTYPE (tree)) == 0)
+ if ((compareType (LTYPE (tree), RTYPE (tree)) == 0) &&
+ (compareType (RTYPE (tree), LTYPE (tree)) == 0))
{
werror (E_TYPE_MISMATCH, "conditional operator", " ");
goto errorTreeReturn;
}
/* require a function or pointer to function */
- if (!IS_FUNC (LTYPE (tree))
- && !(IS_CODEPTR (LTYPE (tree)) && IS_FUNC (LTYPE (tree)->next)))
+ if (!IS_FUNC (LTYPE (tree)) && !IS_FUNCPTR (LTYPE (tree)))
{
werrorfl (tree->filename, tree->lineno, E_FUNCTION_EXPECTED);
goto errorTreeReturn;
sym_link *functype;
parmNumber = 1;
- if (IS_CODEPTR(LTYPE(tree)))
+ if (IS_FUNCPTR (LTYPE (tree)))
functype = LTYPE (tree)->next;
else
functype = LTYPE (tree);
}
else
{
- addSymChain (name);
+ addSymChain (&name);
allocVariables (name);
}
name->lastLine = mylineno;
/* set the stack pointer */
stackPtr = -port->stack.direction * port->stack.call_overhead;
- xstackPtr = -port->stack.direction * port->stack.call_overhead;
+ xstackPtr = 0;
if (IFFUNC_ISISR (name->type))
stackPtr -= port->stack.direction * port->stack.isr_overhead;