Whitespace fixes.
authorChristoph Mallon <christoph.mallon@gmx.de>
Fri, 4 Feb 2011 14:27:06 +0000 (14:27 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Fri, 4 Feb 2011 14:27:06 +0000 (14:27 +0000)
[r28293]

adt/bitfiddle.h
adt/xmalloc.c
ast.c
ast2firm.c
attribute.c
driver/firm_cmdline.c
driver/firm_codegen.c
parser.c
preprocessor.c
string_rep.h

index 2798319..f23d85b 100644 (file)
@@ -100,7 +100,7 @@ unsigned nlz(unsigned x) {
                        : "r" (x));
        return 31 - res;
 #else
-       x |= x >> 1;
+       x |= x >> 1;
        x |= x >> 2;
        x |= x >> 4;
        x |= x >> 8;
index 3957b2b..9654bbc 100644 (file)
@@ -79,7 +79,7 @@ void *xrealloc(void *ptr, size_t size)
 
 char *xstrdup(const char *str)
 {
-       size_t len = strlen(str) + 1;
+       size_t len = strlen(str) + 1;
        char *res = xmalloc(len);
        memcpy(res, str, len);
 
diff --git a/ast.c b/ast.c
index 66ff84f..f136126 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1633,9 +1633,9 @@ bool is_address_constant(const expression_t *expression)
        case EXPR_UNARY_CAST: {
                type_t *dest = skip_typeref(expression->base.type);
                if (!is_type_pointer(dest) && (
-                       dest->kind != TYPE_ATOMIC                                               ||
-                       !(get_atomic_type_flags(dest->atomic.akind) & ATOMIC_TYPE_FLAG_INTEGER) ||
-                       get_atomic_type_size(dest->atomic.akind) < get_atomic_type_size(get_intptr_kind())
+                               dest->kind != TYPE_ATOMIC                                               ||
+                               !(get_atomic_type_flags(dest->atomic.akind) & ATOMIC_TYPE_FLAG_INTEGER) ||
+                               get_atomic_type_size(dest->atomic.akind) < get_atomic_type_size(get_intptr_kind())
                    ))
                        return false;
 
index f92f870..47401ee 100644 (file)
@@ -4057,7 +4057,7 @@ static void advance_current_object(type_path_t *path)
 
        /* we're past the last member of the current sub-aggregate, try if we
         * can ascend in the type hierarchy and continue with another subobject */
-       size_t len = ARR_LEN(path->path);
+       size_t len = ARR_LEN(path->path);
 
        if (len > 1) {
                ascend_from_subtype(path);
index e709e61..9e82f79 100644 (file)
@@ -379,7 +379,7 @@ type_t *handle_type_attributes(const attribute_t *attributes, type_t *type)
                switch(attribute->kind) {
                case ATTRIBUTE_GNU_PACKED:
                        handle_attribute_packed(attribute, type);
-                       break;
+                       break;
                case ATTRIBUTE_GNU_CDECL:
                case ATTRIBUTE_MS_CDECL:
                        type = change_calling_convention(type, CC_CDECL);
index f3ea02d..d7e7075 100644 (file)
@@ -282,22 +282,23 @@ int firm_option(const char *opt)
 /**
  * prints the firm version number
  */
-void print_firm_version(FILE *f) {
-  const char *revision = ir_get_version_revision();
-  const char *build    = ir_get_version_build();
+void print_firm_version(FILE *f)
+{
+       const char *revision = ir_get_version_revision();
+       const char *build    = ir_get_version_build();
 
-  fprintf(f, "Firm C-Compiler using libFirm (%u.%u",
-          ir_get_version_major(), ir_get_version_minor());
-  if (revision[0] != 0) {
-       fputc(' ', f);
-    fputs(revision, f);
-  }
-   if(build[0] != 0) {
-       fputc(' ', f);
-    fputs(build, f);
-  }
-  fprintf(f, "}\n"
-                    "(C) 2005-2008 Michael Beck\n"
-             "(C) 1995-2008 University of Karlsruhe\n"
-             "Using ");
+       fprintf(f, "Firm C-Compiler using libFirm (%u.%u",
+                       ir_get_version_major(), ir_get_version_minor());
+       if (revision[0] != 0) {
+               fputc(' ', f);
+               fputs(revision, f);
+       }
+       if (build[0] != 0) {
+               fputc(' ', f);
+               fputs(build, f);
+       }
+       fprintf(f, "}\n"
+                       "(C) 2005-2008 Michael Beck\n"
+                       "(C) 1995-2008 University of Karlsruhe\n"
+                       "Using ");
 }  /* print_firm_version */
index 300a56c..ad89a96 100644 (file)
@@ -53,44 +53,45 @@ static char *generate_asm_file_name(const char *file_name) {
  * Calls the specified backend.
  * Code is written to file <file_name> ('.c' is substituted for '.asm')
  */
-void do_codegen(FILE *out, const char *file_name) {
-  FILE *close_out = NULL;
-  if (out == NULL) {
-    char *asm_file_name = generate_asm_file_name(file_name);
+void do_codegen(FILE *out, const char *file_name)
+{
+       FILE *close_out = NULL;
+       if (out == NULL) {
+               char *asm_file_name = generate_asm_file_name(file_name);
 
-    if ((out = fopen(asm_file_name, "w")) == NULL) {
-      fprintf(stderr, "Could not open output file %s\n", asm_file_name);
-      exit(1);
-    }
-    free(asm_file_name);
-    close_out = out;
-  }
+               if ((out = fopen(asm_file_name, "w")) == NULL) {
+                       fprintf(stderr, "Could not open output file %s\n", asm_file_name);
+                       exit(1);
+               }
+               free(asm_file_name);
+               close_out = out;
+       }
 
-  switch (firm_be_opt.selection) {
+       switch (firm_be_opt.selection) {
 #ifdef FIRM2C_BACKEND
-  case BE_FIRM2C: {
-       ir_timer_t *timer = ir_timer_new();
-       timer_register(timer, "Firm: C-generating backend");
-       timer_start(timer);
-    generate_code_file(out);
-    timer_stop(timer);
-    break;
-  }
+               case BE_FIRM2C: {
+                       ir_timer_t *timer = ir_timer_new();
+                       timer_register(timer, "Firm: C-generating backend");
+                       timer_start(timer);
+                       generate_code_file(out);
+                       timer_stop(timer);
+                       break;
+               }
 #endif
 
-  case BE_FIRM_BE: {
-    ir_timer_t *timer = ir_timer_new();
-    timer_register(timer, "Firm: backend");
-    timer_start(timer);
-    be_main(out, file_name);
-    timer_stop(timer);
-    break;
-  }
+               case BE_FIRM_BE: {
+                       ir_timer_t *timer = ir_timer_new();
+                       timer_register(timer, "Firm: backend");
+                       timer_start(timer);
+                       be_main(out, file_name);
+                       timer_stop(timer);
+                       break;
+               }
 
-  default:
-    fprintf(stderr, "Fatal: Unknown backend %d\n", firm_be_opt.selection);
-  } /* switch (firm_be_opt.selection) */
+               default:
+                       fprintf(stderr, "Fatal: Unknown backend %d\n", firm_be_opt.selection);
+       } /* switch (firm_be_opt.selection) */
 
-  if (close_out)
-    fclose(close_out);
+       if (close_out)
+               fclose(close_out);
 }
index 7cb5608..ce395fd 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1055,8 +1055,8 @@ static assign_error_t semantic_assign(type_t *orig_type_left,
                        return ASSIGN_WARNING_POINTER_FROM_INT;
                }
        } else if ((is_type_arithmetic(type_left) && is_type_arithmetic(type_right)) ||
-           (is_type_atomic(type_left, ATOMIC_TYPE_BOOL)
-               && is_type_pointer(type_right))) {
+                       (is_type_atomic(type_left, ATOMIC_TYPE_BOOL)
+                               && is_type_pointer(type_right))) {
                return ASSIGN_SUCCESS;
        } else if ((is_type_compound(type_left)  && is_type_compound(type_right))
                        || (is_type_builtin(type_left) && is_type_builtin(type_right))) {
@@ -1999,8 +1999,8 @@ static bool walk_designator(type_path_t *path, const designator_t *designator,
                                        long array_size = type->array.size;
                                        if (index >= array_size) {
                                                errorf(&designator->source_position,
-                                                      "designator [%E] (%d) exceeds array size %d",
-                                                      array_index, index, array_size);
+                                                      "designator [%E] (%d) exceeds array size %d",
+                                                      array_index, index, array_size);
                                        }
                                }
                        }
@@ -3930,10 +3930,10 @@ static entity_t *parse_declarator(const declaration_specifiers_t *specifiers,
                                bool in_function_scope = current_function != NULL;
 
                                if (specifiers->thread_local || (
-                                     specifiers->storage_class != STORAGE_CLASS_EXTERN &&
-                                         specifiers->storage_class != STORAGE_CLASS_NONE   &&
-                                         (in_function_scope || specifiers->storage_class != STORAGE_CLASS_STATIC)
-                                  )) {
+                                                       specifiers->storage_class != STORAGE_CLASS_EXTERN &&
+                                                       specifiers->storage_class != STORAGE_CLASS_NONE   &&
+                                                       (in_function_scope || specifiers->storage_class != STORAGE_CLASS_STATIC)
+                                               )) {
                                        errorf(&env.source_position,
                                                        "invalid storage class for function '%Y'", env.symbol);
                                }
@@ -7748,7 +7748,7 @@ end_error:;
                        result_type = pointer_type;
                } else {
                        if (is_type_valid(other_type)) {
-                               type_error_incompatible("while parsing conditional",
+                               type_error_incompatible("while parsing conditional",
                                                &expression->base.source_position, true_type, false_type);
                        }
                        result_type = type_error_type;
index 9c4dd66..804921f 100644 (file)
@@ -770,9 +770,9 @@ static void skip_spaces(bool skip_newline)
                switch (CC) {
                case ' ':
                case '\t':
-                       if(do_print_spaces)
+                       if (do_print_spaces)
                                counted_spaces++;
-                       next_char();
+                       next_char();
                        continue;
                case '/':
                        next_char();
@@ -975,9 +975,9 @@ restart:
        switch(CC) {
        case ' ':
        case '\t':
-               if(do_print_spaces)
+               if (do_print_spaces)
                        counted_spaces++;
-               next_char();
+               next_char();
                goto restart;
 
        MATCH_NEWLINE(
@@ -1396,7 +1396,7 @@ static void parse_define_directive(void)
        if (old_definition != NULL) {
                if (!pp_definitions_equal(old_definition, new_definition)) {
                        warningf(&input.position, "multiple definition of macro '%Y' (first defined %P)",
-                                symbol, &old_definition->source_position);
+                                symbol, &old_definition->source_position);
                } else {
                        /* reuse the old definition */
                        obstack_free(&pp_obstack, new_definition);
index 873563b..13a1674 100644 (file)
@@ -47,7 +47,7 @@ static inline utf32 read_utf8_char(const char **p)
 
        if ((*c & 0x80) == 0) {
                /* 1 character encoding: 0b0??????? */
-               result = *c++;
+               result = *c++;
        } else if ((*c & 0xE0) == 0xC0) {
                /* 2 character encoding: 0b110?????, 0b10?????? */
                result = *c++ & 0x1F;