Use fputs/fputc where appropriate.
authorChristoph Mallon <christoph.mallon@gmx.de>
Fri, 28 Nov 2008 07:31:30 +0000 (07:31 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Fri, 28 Nov 2008 07:31:30 +0000 (07:31 +0000)
[r24096]

ast.c
token.c
type.c

diff --git a/ast.c b/ast.c
index e68aa1c..c084a7f 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1008,7 +1008,7 @@ static void print_typedef(const entity_t *entity)
 {
        fputs("typedef ", out);
        print_type_ext(entity->typedefe.type, entity->base.symbol, NULL);
-       fputs(";", out);
+       fputc(';', out);
 }
 
 /**
diff --git a/token.c b/token.c
index 9c98bf0..31e2a00 100644 (file)
--- a/token.c
+++ b/token.c
@@ -109,10 +109,10 @@ void print_token_type(FILE *f, token_type_t token_type)
 
        const symbol_t *symbol = token_symbols[token_type];
        if(symbol != NULL) {
-               fprintf(f, "%s", symbol->string);
+               fputs(symbol->string, f);
        } else {
                if(token_type >= 0 && token_type < 256) {
-                       fprintf(f, "%c", token_type);
+                       fputc(token_type, f);
                        return;
                }
                fputs("unknown token", f);
@@ -159,10 +159,10 @@ void print_pp_token_type(FILE *f, int token_type)
 
        const symbol_t *symbol = pp_token_symbols[token_type];
        if (symbol != NULL) {
-               fprintf(f, "%s", symbol->string);
+               fputs(symbol->string, f);
        } else {
                if(token_type >= 0 && token_type < 256) {
-                       fprintf(f, "%c", token_type);
+                       fputc(token_type, f);
                        return;
                }
                fputs("unknown token", f);
diff --git a/type.c b/type.c
index 6640145..9be93a7 100644 (file)
--- a/type.c
+++ b/type.c
@@ -397,7 +397,7 @@ static void print_pointer_type_pre(const pointer_type_t *type)
                fputs(variable->base.base.symbol->string, out);
                fputs(") ", out);
        }
-       fputs("*", out);
+       fputc('*', out);
        print_type_qualifiers(type->base.qualifiers);
        if (type->base.qualifiers != 0)
                fputc(' ', out);
@@ -494,9 +494,9 @@ void print_enum_definition(const enum_t *enume)
               entry = entry->base.next) {
 
                print_indent();
-               fprintf(out, "%s", entry->base.symbol->string);
+               fputs(entry->base.symbol->string, out);
                if (entry->enum_value.value != NULL) {
-                       fprintf(out, " = ");
+                       fputs(" = ", out);
 
                        /* skip the implicit cast */
                        expression_t *expression = entry->enum_value.value;
@@ -505,12 +505,12 @@ void print_enum_definition(const enum_t *enume)
                        }
                        print_expression(expression);
                }
-               fprintf(out, ",\n");
+               fputs(",\n", out);
        }
 
        change_indent(-1);
        print_indent();
-       fputs("}", out);
+       fputc('}', out);
 }
 
 /**
@@ -553,7 +553,7 @@ void print_compound_definition(const compound_t *compound)
 
        change_indent(-1);
        print_indent();
-       fputs("}", out);
+       fputc('}', out);
        if (compound->modifiers & DM_TRANSPARENT_UNION) {
                fputs("__attribute__((__transparent_union__))", out);
        }