mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-25 15:05:00 -07:00
Win32 Demo: OpenGL Context
This commit is contained in:
@@ -633,14 +633,6 @@ void check_parsed_files(Checker *c) {
|
||||
add_file_entity(c, td->name, e, d);
|
||||
case_end;
|
||||
|
||||
case_ast_node(ad, AliasDecl, decl);
|
||||
ast_node(n, Ident, ad->name);
|
||||
Entity *e = make_entity_alias_name(c->allocator, c->global_scope, n->token, NULL);
|
||||
DeclInfo *d = make_declaration_info(c->allocator, e->parent);
|
||||
d->type_expr = ad->type;
|
||||
add_file_entity(c, ad->name, e, d);
|
||||
case_end;
|
||||
|
||||
case_ast_node(pd, ProcDecl, decl);
|
||||
ast_node(n, Ident, pd->name);
|
||||
Token token = n->token;
|
||||
|
||||
@@ -600,10 +600,10 @@ void check_is_expressible(Checker *c, Operand *o, Type *type) {
|
||||
if (!is_type_integer(o->type) && is_type_integer(type)) {
|
||||
error(&c->error_collector, ast_node_token(o->expr), "`%s` truncated to `%s`", a, b);
|
||||
} else {
|
||||
error(&c->error_collector, ast_node_token(o->expr), "`%s` overflows `%s`", a, b);
|
||||
error(&c->error_collector, ast_node_token(o->expr), "`%s = %lld` overflows `%s`", a, o->value.value_integer, b);
|
||||
}
|
||||
} else {
|
||||
error(&c->error_collector, ast_node_token(o->expr), "Cannot convert `%s` to `%s`", a, b);
|
||||
error(&c->error_collector, ast_node_token(o->expr), "Cannot convert `%s` to `%s`", a, b);
|
||||
}
|
||||
|
||||
o->mode = Addressing_Invalid;
|
||||
@@ -867,6 +867,11 @@ b32 check_castable_to(Checker *c, Operand *operand, Type *y) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// proc <-> proc
|
||||
if (is_type_proc(xb), is_type_proc(yb)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -878,12 +878,5 @@ void check_stmt(Checker *c, AstNode *node, u32 flags) {
|
||||
add_entity(c, c->context.scope, td->name, e);
|
||||
check_type_decl(c, e, td->type, NULL);
|
||||
case_end;
|
||||
|
||||
case_ast_node(ad, AliasDecl, node);
|
||||
ast_node(name, Ident, ad->name);
|
||||
Entity *e = make_entity_alias_name(c->allocator, c->context.scope, name->token, NULL);
|
||||
add_entity(c, c->context.scope, ad->name, e);
|
||||
check_alias_decl(c, e, ad->type, NULL);
|
||||
case_end;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,6 +382,9 @@ b32 is_type_u8_slice(Type *t) {
|
||||
b32 is_type_vector(Type *t) {
|
||||
return t->kind == Type_Vector;
|
||||
}
|
||||
b32 is_type_proc(Type *t) {
|
||||
return t->kind == Type_Proc;
|
||||
}
|
||||
Type *base_vector_type(Type *t) {
|
||||
if (is_type_vector(t)) {
|
||||
return t->vector.elem;
|
||||
@@ -747,10 +750,12 @@ gbString write_type_to_string(gbString str, Type *type) {
|
||||
if (type->tuple.variable_count > 0) {
|
||||
for (isize i = 0; i < type->tuple.variable_count; i++) {
|
||||
Entity *var = type->tuple.variables[i];
|
||||
GB_ASSERT(var->kind == Entity_Variable);
|
||||
if (i > 0)
|
||||
str = gb_string_appendc(str, ", ");
|
||||
str = write_type_to_string(str, var->type);
|
||||
if (var != NULL) {
|
||||
GB_ASSERT(var->kind == Entity_Variable);
|
||||
if (i > 0)
|
||||
str = gb_string_appendc(str, ", ");
|
||||
str = write_type_to_string(str, var->type);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user