Update code from OSX merge to be consistent with the rest of the code

Remove some dead code whilst I was here too :P
This commit is contained in:
Ginger Bill
2017-02-01 20:59:14 +00:00
parent c6133587d1
commit 205f4664f8
15 changed files with 162 additions and 249 deletions
+5 -12
View File
@@ -225,9 +225,6 @@ i64 check_distance_between_types(Checker *c, Operand *operand, Type *type) {
return -1;
}
#ifndef _MAX
#define _MAX(x, y) ((x) > (y) ? (x) : (y))
#endif
bool check_is_assignable_to_with_score(Checker *c, Operand *operand, Type *type, i64 *score_) {
i64 score = 0;
@@ -235,8 +232,7 @@ bool check_is_assignable_to_with_score(Checker *c, Operand *operand, Type *type,
bool ok = distance >= 0;
if (ok) {
// TODO(bill): A decent score function
// score = max(1000000 - distance*distance, 0);
score = _MAX(1000000 - distance*distance, 0);
score = gb_max(1000000 - distance*distance, 0);
}
if (score_) *score_ = score;
return ok;
@@ -1008,10 +1004,6 @@ void check_identifier(Checker *c, Operand *o, AstNode *n, Type *named_type, Type
o->mode = Addressing_Value;
break;
case Entity_ImplicitValue:
o->mode = Addressing_Value;
break;
default:
compiler_error("Compiler error: Unknown EntityKind");
break;
@@ -2567,9 +2559,6 @@ Entity *check_selector(Checker *c, Operand *operand, AstNode *node, Type *type_h
case Entity_Nil:
operand->mode = Addressing_Value;
break;
case Entity_ImplicitValue:
operand->mode = Addressing_Value;
break;
}
operand->type = entity->type;
@@ -5105,6 +5094,10 @@ gbString write_expr_to_string(gbString str, AstNode *node) {
str = string_append_token(str, *i);
case_end;
case_ast_node(i, Implicit, node);
str = string_append_token(str, *i);
case_end;
case_ast_node(bl, BasicLit, node);
str = string_append_token(str, *bl);
case_end;