/* easy access macros */
-#define IS_AST_OP(x) (x && x->type == EX_OP)
+#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 == '&' && \
#define IS_FOR_STMT(x) (IS_AST_OP(x) && x->opval.op == FOR)
#define IS_LEFT_OP(x) (IS_AST_OP(x) && x->opval.op == LEFT_OP)
#define IS_RIGHT_OP(x) (IS_AST_OP(x) && x->opval.op == RIGHT_OP)
-#define IS_AST_VALUE(x) (x && x->type == EX_VALUE && x->opval.val)
+#define IS_AST_VALUE(x) ((x) && (x)->type == EX_VALUE && (x)->opval.val)
#define IS_AST_LINK(x) (x->type == EX_LINK)
#define IS_AST_NOT_OPER(x) (x && IS_AST_OP(x) && x->opval.op == '!')
#define IS_ARRAY_OP(x) (IS_AST_OP(x) && x->opval.op == '[')
x->opval.op == GE_OP || \
x->opval.op == EQ_OP || \
x->opval.op == NE_OP ))
-#define IS_CAST_OP(x) (IS_AST_OP(x) && x->opval.op == CAST)
+#define IS_CAST_OP(x) (IS_AST_OP(x) && (x)->opval.op == CAST)
#define IS_TERNARY_OP(x) (IS_AST_OP(x) && x->opval.op == '?')
#define IS_COLON_OP(x) (IS_AST_OP(x) && x->opval.op == ':')
#define IS_ADDRESS_OF_OP(x) (IS_AST_OP(x) && \
x->opval.op == '&' && \
x->right == NULL )
#define IS_AST_LIT_VALUE(x) (IS_AST_VALUE(x) && \
- IS_LITERAL(x->opval.val->etype))
+ IS_LITERAL((x)->opval.val->etype))
#define IS_AST_SYM_VALUE(x) (IS_AST_VALUE(x) && x->opval.val->sym)
#define AST_LIT_VALUE(x) (floatFromVal(x->opval.val))
#define AST_SYMBOL(x) (x->opval.val->sym)
x == AND_ASSIGN || x == OR_ASSIGN || x == INC_OP || x == DEC_OP)
#define IS_DEREF_OP(x) (( x->opval.op == '*' && x->right == NULL) || x->opval.op == '.')
-typedef enum
-{
- RESULT_TYPE_NONE = 0,
- RESULT_CHECK = 0, /* TODO: replace all occurences with the appropriate type and remove me */
- RESULT_TYPE_BIT,
- RESULT_TYPE_CHAR,
- RESULT_TYPE_INT,
- RESULT_TYPE_OTHER
-} RESULT_TYPE;
-
/* forward declarations for global variables */
extern ast *staticAutos;
extern FILE *codeOutFile;
void freeStringSymbol(symbol *);
DEFSETFUNC(resetParmKey);
int astErrors(ast *);
+RESULT_TYPE getResultTypeFromType (sym_link *);
// exported variables
extern set *operKeyReset;