authorgravatar for thejoshwolfe@gmail.comJosh Wolfe <thejoshwolfe@gmail.com> 2016-04-23 00:26:29-07:00
committergravatar for thejoshwolfe@gmail.comJosh Wolfe <thejoshwolfe@gmail.com> 2016-04-23 00:26:29-07:00
log4a7911e3eb40e590de930a07413d6254554d2de7
tree0878bb001bb47becb60a9b98ffc3d6adc53d80b4
parent66163692ad35048e0bab5861e371067b63ee0f88

fix gcc build errors


2 files changed, 3 insertions(+), 4 deletions(-)

src/analyze.cpp+2-4
...@@ -3089,12 +3089,10 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import,...@@ -3089,12 +3089,10 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import,
3089 return resolved_type;3089 return resolved_type;
3090 }3090 }
30913091
3092 bool is_int = false;
3093 bool is_float = false;
3094 if (resolved_type->id == TypeTableEntryIdInt ||3092 if (resolved_type->id == TypeTableEntryIdInt ||
3095 resolved_type->id == TypeTableEntryIdNumLitInt)3093 resolved_type->id == TypeTableEntryIdNumLitInt)
3096 {3094 {
3097 is_int = true;3095 // int
3098 } else if ((resolved_type->id == TypeTableEntryIdFloat ||3096 } else if ((resolved_type->id == TypeTableEntryIdFloat ||
3099 resolved_type->id == TypeTableEntryIdNumLitFloat) &&3097 resolved_type->id == TypeTableEntryIdNumLitFloat) &&
3100 (bin_op_type == BinOpTypeAdd ||3098 (bin_op_type == BinOpTypeAdd ||
...@@ -3103,7 +3101,7 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import,...@@ -3103,7 +3101,7 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import,
3103 bin_op_type == BinOpTypeDiv ||3101 bin_op_type == BinOpTypeDiv ||
3104 bin_op_type == BinOpTypeMod))3102 bin_op_type == BinOpTypeMod))
3105 {3103 {
3106 is_float = true;3104 // float
3107 } else {3105 } else {
3108 add_node_error(g, node, buf_sprintf("invalid operands to binary expression: '%s' and '%s'",3106 add_node_error(g, node, buf_sprintf("invalid operands to binary expression: '%s' and '%s'",
3109 buf_ptr(&lhs_type->name), buf_ptr(&rhs_type->name)));3107 buf_ptr(&lhs_type->name), buf_ptr(&rhs_type->name)));
src/eval.cpp+1
...@@ -1124,6 +1124,7 @@ static bool eval_expr(EvalFn *ef, AstNode *node, ConstExprValue *out) {...@@ -1124,6 +1124,7 @@ static bool eval_expr(EvalFn *ef, AstNode *node, ConstExprValue *out) {
1124 case NodeTypeTypeDecl:1124 case NodeTypeTypeDecl:
1125 zig_unreachable();1125 zig_unreachable();
1126 }1126 }
1127 zig_unreachable();
1127}1128}
11281129
1129static bool eval_fn_args(EvalFnRoot *efr, FnTableEntry *fn, ConstExprValue *args, ConstExprValue *out_val) {1130static bool eval_fn_args(EvalFnRoot *efr, FnTableEntry *fn, ConstExprValue *args, ConstExprValue *out_val) {