mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-25 08:57:55 +00:00
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:
+5
-12
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user