From 38793ab3e32ebc7ef6b05314a71c96f1abfe5c6b Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Fri, 18 Feb 2011 21:05:13 +0000 Subject: [PATCH] Change is_error_entity() to !is_entity_valid(), which is consistent with is_type_valid(). [r28419] --- parser.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/parser.c b/parser.c index 7e44886..aea8ecf 100644 --- a/parser.c +++ b/parser.c @@ -4107,14 +4107,14 @@ static void error_redefined_as_different_kind(const source_position_t *pos, get_entity_kind_name(new_kind), &old->base.source_position); } -static bool is_error_entity(entity_t *const ent) +static bool is_entity_valid(entity_t *const ent) { if (is_declaration(ent)) { - return !is_type_valid(skip_typeref(ent->declaration.type)); + return is_type_valid(skip_typeref(ent->declaration.type)); } else if (ent->kind == ENTITY_TYPEDEF) { - return !is_type_valid(skip_typeref(ent->typedefe.type)); + return is_type_valid(skip_typeref(ent->typedefe.type)); } - return false; + return true; } static bool contains_attribute(const attribute_t *list, const attribute_t *attr) @@ -4216,7 +4216,7 @@ entity_t *record_entity(entity_t *entity, const bool is_definition) if (previous_entity->base.parent_scope == current_scope) { if (previous_entity->kind != entity->kind) { - if (!is_error_entity(previous_entity) && !is_error_entity(entity)) { + if (is_entity_valid(previous_entity) && is_entity_valid(entity)) { error_redefined_as_different_kind(pos, previous_entity, entity->kind); } @@ -10187,7 +10187,7 @@ static void parse_namespace_definition(void) if (entity != NULL && entity->kind != ENTITY_NAMESPACE && entity->base.parent_scope == current_scope) { - if (!is_error_entity(entity)) { + if (is_entity_valid(entity)) { error_redefined_as_different_kind(&token.source_position, entity, ENTITY_NAMESPACE); } -- 2.20.1