diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-07-06 22:43:55 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-07-06 22:43:55 +0100 |
| commit | 2db03cb4a54eaa594ca0d3ccb6819a8d56e7efed (patch) | |
| tree | 255b286dc38003c2e7308250b73753922aec9034 /src/entity.cpp | |
| parent | eed873c6ec9ac1631fbf1285d4047596b353e9bf (diff) | |
Fix aprint* bug; NULL -> nullptr; Better error messages for overloaded functions
Diffstat (limited to 'src/entity.cpp')
| -rw-r--r-- | src/entity.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/entity.cpp b/src/entity.cpp index 1f2478c25..a9b083400 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -71,8 +71,8 @@ struct Entity { Token token; Scope * scope; Type * type; - AstNode * identifier; // Can be NULL - DeclInfo * parent_proc_decl; // NULL if in file/global scope + AstNode * identifier; // Can be nullptr + DeclInfo * parent_proc_decl; // nullptr if in file/global scope // TODO(bill): Cleanup how `using` works for entities Entity * using_parent; @@ -131,7 +131,7 @@ struct Entity { }; }; -gb_global Entity *e_context = NULL; +gb_global Entity *e_context = nullptr; bool is_entity_kind_exported(EntityKind kind) { switch (kind) { @@ -146,7 +146,7 @@ bool is_entity_kind_exported(EntityKind kind) { bool is_entity_exported(Entity *e) { // TODO(bill): Determine the actual exportation rules for imports of entities - GB_ASSERT(e != NULL); + GB_ASSERT(e != nullptr); if (!is_entity_kind_exported(e->kind)) { return false; } @@ -177,7 +177,7 @@ Entity *make_entity_variable(gbAllocator a, Scope *scope, Token token, Type *typ } Entity *make_entity_using_variable(gbAllocator a, Entity *parent, Token token, Type *type) { - GB_ASSERT(parent != NULL); + GB_ASSERT(parent != nullptr); token.pos = parent->token.pos; Entity *entity = alloc_entity(a, Entity_Variable, parent->scope, token, type); entity->using_parent = parent; @@ -265,7 +265,7 @@ Entity *make_entity_library_name(gbAllocator a, Scope *scope, Token token, Type Entity *make_entity_nil(gbAllocator a, String name, Type *type) { Token token = make_token_ident(name); - Entity *entity = alloc_entity(a, Entity_Nil, NULL, token, type); + Entity *entity = alloc_entity(a, Entity_Nil, nullptr, token, type); return entity; } @@ -280,6 +280,6 @@ Entity *make_entity_label(gbAllocator a, Scope *scope, Token token, Type *type, Entity *make_entity_dummy_variable(gbAllocator a, Scope *scope, Token token) { token.string = str_lit("_"); - return make_entity_variable(a, scope, token, NULL, false); + return make_entity_variable(a, scope, token, nullptr, false); } |