void
pushTypeCastToLeaves (sym_link * type, ast * node, ast ** parentPtr)
{
- if (!node)
+ if (!node || IS_CALLOP(node))
{
/* WTF? We should never get here. */
return;
/* easy access macros */
#define IS_AST_OP(x) (x && x->type == EX_OP)
+#define IS_CALLOP(x) (IS_AST_OP(x) && x->opval.op == CALL)
#define IS_BITOR(x) (IS_AST_OP(x) && x->opval.op == '|')
#define IS_BITAND(x) (IS_AST_OP(x) && x->opval.op == '&' && \
x->left && x->right )
if (SPEC_NOUN (dest) != SPEC_NOUN (src) && !SPEC_NOUN (dest))
SPEC_NOUN (dest) = SPEC_NOUN (src);
- if (!SPEC_SCLS (dest)) /* if destination has no storage class */
+ /* if destination has no storage class */
+ if (!SPEC_SCLS (dest) || (SPEC_SCLS(dest) == S_CONSTANT && SPEC_SCLS (src)))
SPEC_SCLS (dest) = SPEC_SCLS (src);
-
+ /* special case for const */
/* copy all the specifications */
SPEC_LONG (dest) |= SPEC_LONG (src);
SPEC_SHORT (dest) |= SPEC_SHORT (src);
return (!strcmp (dest->name, src->name));
}
+void PT(sym_link *type)
+{
+ printTypeChain(type,0);
+}
/*-----------------------------------------------------------------*/
/* printTypeChain - prints the type chain in human readable form */
/*-----------------------------------------------------------------*/