namespace_tag_t namespc)
{
entity_t *entity = symbol->entity;
- for( ; entity != NULL; entity = entity->base.symbol_next) {
+ for (; entity != NULL; entity = entity->base.symbol_next) {
if (entity->base.namespc == namespc)
return entity;
}
if (new_top == top)
return;
- for(i = top; i > new_top; --i) {
+ for (i = top; i > new_top; --i) {
stack_entry_t *entry = &stack[i - 1];
entity_t *old_entity = entry->old_entity;
string_t string = { NULL, 0 };
parse_gnu_attribute_string_arg(attribute, &string);
if (string.begin != NULL) {
- for(size_t i = 0; i < 4; ++i) {
+ for (size_t i = 0; i < 4; ++i) {
if (strcmp(tls_models[i], string.begin) == 0) {
attribute->u.value = i;
return;
string_t string = { NULL, 0 };
parse_gnu_attribute_string_arg(attribute, &string);
if (string.begin != NULL) {
- for(size_t i = 0; i < 4; ++i) {
+ for (size_t i = 0; i < 4; ++i) {
if (strcmp(visibilities[i], string.begin) == 0) {
attribute->u.value = i;
return;
string_t string = { NULL, 0 };
parse_gnu_attribute_string_arg(attribute, &string);
if (string.begin != NULL) {
- for(int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 3; ++i) {
if (strcmp(visibilities[i], string.begin) == 0) {
attribute->u.value = i;
return;
string_t string = { NULL, 0 };
parse_gnu_attribute_string_arg(attribute, &string);
if (string.begin != NULL) {
- for(size_t i = 0; i < 5; ++i) {
+ for (size_t i = 0; i < 5; ++i) {
if (strcmp(interrupts[i], string.begin) == 0) {
attribute->u.value = i;
return;
goto end_error;
}
const char *name = token.v.symbol->string;
- for(i = 0; i < 4; ++i) {
+ for (i = 0; i < 4; ++i) {
if (strcmp_underscore(format_names[i], name) == 0)
break;
}
next_token();
int i;
- for(i = 0; i < GNU_AK_LAST; ++i) {
+ for (i = 0; i < GNU_AK_LAST; ++i) {
if (strcmp_underscore(gnu_attribute_names[i], name) == 0)
break;
}
{
size_t len = ARR_LEN(path->path);
- for(size_t i = 0; i < len; ++i) {
+ for (size_t i = 0; i < len; ++i) {
const type_path_entry_t *entry = & path->path[i];
type_t *type = skip_typeref(entry->type);
static bool walk_designator(type_path_t *path, const designator_t *designator,
bool used_in_offsetof)
{
- for( ; designator != NULL; designator = designator->next) {
+ for (; designator != NULL; designator = designator->next) {
type_path_entry_t *top = get_type_path_top(path);
type_t *orig_type = top->type;
} else {
compound_t *compound = type->compound.compound;
entity_t *iter = compound->members.entities;
- for( ; iter != NULL; iter = iter->base.next) {
+ for (; iter != NULL; iter = iter->base.next) {
if (iter->base.symbol == symbol) {
break;
}
parse_enum_entries(type);
parse_attributes(&attributes);
- } else if(!entity->enume.complete && !(c_mode & _GNUC)) {
+ } else if (!entity->enume.complete && !(c_mode & _GNUC)) {
errorf(HERE, "enum %Y used before definition (incomplete enumes are a GNU extension)",
symbol);
}
construct_type_t *p = last;
- while(true) {
+ while (true) {
construct_type_t *type;
switch (token.type) {
case '(': {
type_t *type, variable_t *variable)
{
construct_type_t *iter = construct_list;
- for( ; iter != NULL; iter = iter->next) {
+ for (; iter != NULL; iter = iter->next) {
switch (iter->kind) {
case CONSTRUCT_INVALID:
internal_errorf(HERE, "invalid type construction found");
{
add_anchor_token(';');
add_anchor_token(',');
- while(true) {
+ while (true) {
entity_t *entity = finished_declaration(ndeclaration, token.type == '=');
if (token.type == '=') {
function_parameter_t *last_parameter = NULL;
entity_t *parameter_declaration = entity->function.parameters.entities;
- for( ; parameter_declaration != NULL;
+ for (; parameter_declaration != NULL;
parameter_declaration = parameter_declaration->base.next) {
type_t *parameter_type = parameter_declaration->declaration.type;
if (parameter_type == NULL) {
scope_push(&function->parameters);
entity_t *parameter = function->parameters.entities;
- for( ; parameter != NULL; parameter = parameter->base.next) {
+ for (; parameter != NULL; parameter = parameter->base.next) {
if (parameter->base.parent_scope == &ndeclaration->function.parameters) {
parameter->base.parent_scope = current_scope;
}
long v = fold_constant(size);
if (v < 0) {
- errorf(source_position, "negative width in bit-field '%Y'",
- symbol);
+ errorf(source_position, "negative width in bit-field '%Y'", symbol);
} else if (v == 0) {
- errorf(source_position, "zero width for bit-field '%Y'",
- symbol);
+ errorf(source_position, "zero width for bit-field '%Y'", symbol);
} else if (bit_size > 0 && (il_size_t)v > bit_size) {
- errorf(source_position, "width of '%Y' exceeds its type",
- symbol);
+ errorf(source_position, "width of '%Y' exceeds its type", symbol);
} else {
type->bitfield.bit_size = v;
}
static entity_t *find_compound_entry(compound_t *compound, symbol_t *symbol)
{
entity_t *iter = compound->members.entities;
- for( ; iter != NULL; iter = iter->base.next) {
+ for (; iter != NULL; iter = iter->base.next) {
if (iter->kind != ENTITY_COMPOUND_MEMBER)
continue;
- if (iter->base.symbol == NULL) {
+ if (iter->base.symbol == symbol) {
+ return iter;
+ } else if (iter->base.symbol == NULL) {
type_t *type = skip_typeref(iter->declaration.type);
if (is_type_compound(type)) {
entity_t *result
}
continue;
}
-
- if (iter->base.symbol == symbol) {
- return iter;
- }
}
return NULL;
next_token();
designator_t *last_designator = result;
- while(true) {
+ while (true) {
if (token.type == '.') {
next_token();
if (token.type != T_IDENTIFIER) {
add_anchor_token(',');
if (token.type != ')') {
- while(true) {
+ while (true) {
(void)parse_assignment_expression();
if (token.type != ',')
break;
}
/* do default promotion */
- for( ; argument != NULL; argument = argument->next) {
+ for (; argument != NULL; argument = argument->next) {
type_t *type = argument->expression->base.type;
type = get_default_promoted_type(type);
assert(left != NULL);
left->base.source_position = source_position;
- while(true) {
+ while (true) {
if (token.type < 0) {
return expected_expression_error();
}
asm_clobber_t *result = NULL;
asm_clobber_t *last = NULL;
- while(token.type == T_STRING_LITERAL) {
+ while (token.type == T_STRING_LITERAL) {
asm_clobber_t *clobber = allocate_ast_zero(sizeof(clobber[0]));
clobber->clobber = parse_string_literals();
/* look over all statements again to produce no effect warnings */
if (warning.unused_value) {
statement_t *sub_statement = statement->compound.statements;
- for( ; sub_statement != NULL; sub_statement = sub_statement->base.next) {
+ for (; sub_statement != NULL; sub_statement = sub_statement->base.next) {
if (sub_statement->kind != STATEMENT_EXPRESSION)
continue;
/* don't emit a warning for the last expression in an expression