static type_t *make_global_typedef(const char *name, type_t *type)
{
- symbol_t *symbol = symbol_table_insert(name);
+ symbol_t *const symbol = symbol_table_insert(name);
declaration_t *declaration = allocate_ast_zero(sizeof(declaration[0]));
declaration->namespc = NAMESPACE_NORMAL;
return initializer_from_expression(type, expression);
}
- /* does the expression match the currently looked at object to initalize */
+ /* does the expression match the currently looked at object to initialize */
if(expression != NULL) {
initializer_t *result = initializer_from_expression(type, expression);
if(result != NULL)
sub = parse_sub_initializer_elem(iter_type);
if(sub == NULL) {
- /* TODO error, do nicer cleanup*/
+ /* TODO error, do nicer cleanup */
parse_error("member initializer didn't match");
DEL_ARR_F(elems);
return NULL;
return;
type_t *type = skip_typeref(orig_type);
- /* Array as last part of a paramter type is just syntactic sugar. Turn it
+ /* Array as last part of a parameter type is just syntactic sugar. Turn it
* into a pointer. ยง 6.7.5.3 (7) */
if (is_type_array(type)) {
const array_type_t *arr_type = &type->array;
return false;
if(array1->size != NULL && array2->size != NULL) {
- /* TODO: check if size expression evaulate to the same value
+ /* TODO: check if size expression evaluate to the same value
* if they are constant */
}
{
unsigned qualifiers = type->base.qualifiers;
- while(1) {
+ while(true) {
switch(type->kind) {
case TYPE_TYPEDEF: {
qualifiers |= type->base.qualifiers;