- fixed some typos
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 6 Dec 2007 22:40:31 +0000 (22:40 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 6 Dec 2007 22:40:31 +0000 (22:40 +0000)
- small code shaping

[r18632]

parser.c
type.c

index d64e2f0..534a061 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -942,7 +942,7 @@ static expression_t *parse_assignment_expression(void)
 
 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;
@@ -1184,7 +1184,7 @@ static initializer_t *parse_sub_initializer(type_t *type,
                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)
@@ -1285,7 +1285,7 @@ static initializer_t *parse_sub_initializer(type_t *type,
 
                        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;
@@ -1975,7 +1975,7 @@ static void semantic_parameter(declaration_t *declaration)
                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;
diff --git a/type.c b/type.c
index 4346a8a..157021c 100644 (file)
--- a/type.c
+++ b/type.c
@@ -595,7 +595,7 @@ static bool array_types_compatible(const array_type_t *array1,
                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 */
        }
 
@@ -659,7 +659,7 @@ type_t *skip_typeref(type_t *type)
 {
        unsigned qualifiers = type->base.qualifiers;
 
-       while(1) {
+       while(true) {
                switch(type->kind) {
                case TYPE_TYPEDEF: {
                        qualifiers |= type->base.qualifiers;