fix gcc build errors

This commit is contained in:
Josh Wolfe 2016-04-23 00:26:29 -07:00
parent 66163692ad
commit 4a7911e3eb
2 changed files with 3 additions and 4 deletions

View File

@ -3089,12 +3089,10 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import,
return resolved_type; return resolved_type;
} }
bool is_int = false;
bool is_float = false;
if (resolved_type->id == TypeTableEntryIdInt || if (resolved_type->id == TypeTableEntryIdInt ||
resolved_type->id == TypeTableEntryIdNumLitInt) resolved_type->id == TypeTableEntryIdNumLitInt)
{ {
is_int = true; // int
} else if ((resolved_type->id == TypeTableEntryIdFloat || } else if ((resolved_type->id == TypeTableEntryIdFloat ||
resolved_type->id == TypeTableEntryIdNumLitFloat) && resolved_type->id == TypeTableEntryIdNumLitFloat) &&
(bin_op_type == BinOpTypeAdd || (bin_op_type == BinOpTypeAdd ||
@ -3103,7 +3101,7 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import,
bin_op_type == BinOpTypeDiv || bin_op_type == BinOpTypeDiv ||
bin_op_type == BinOpTypeMod)) bin_op_type == BinOpTypeMod))
{ {
is_float = true; // float
} else { } else {
add_node_error(g, node, buf_sprintf("invalid operands to binary expression: '%s' and '%s'", add_node_error(g, node, buf_sprintf("invalid operands to binary expression: '%s' and '%s'",
buf_ptr(&lhs_type->name), buf_ptr(&rhs_type->name))); buf_ptr(&lhs_type->name), buf_ptr(&rhs_type->name)));

View File

@ -1124,6 +1124,7 @@ static bool eval_expr(EvalFn *ef, AstNode *node, ConstExprValue *out) {
case NodeTypeTypeDecl: case NodeTypeTypeDecl:
zig_unreachable(); zig_unreachable();
} }
zig_unreachable();
} }
static bool eval_fn_args(EvalFnRoot *efr, FnTableEntry *fn, ConstExprValue *args, ConstExprValue *out_val) { static bool eval_fn_args(EvalFnRoot *efr, FnTableEntry *fn, ConstExprValue *args, ConstExprValue *out_val) {