X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=preprocessor.c;h=570182c668e7794f5036104ccb6d7535c4dcad9b;hb=f109471af0f1a95e840a66c9e136409d0973021c;hp=f56a182797b01b8d413f6c1e08a514b4eda3e49d;hpb=b45ddb0467764db97349914dfa7b35f34b9aa596;p=cparser diff --git a/preprocessor.c b/preprocessor.c index f56a182..570182c 100644 --- a/preprocessor.c +++ b/preprocessor.c @@ -85,7 +85,6 @@ static pp_definition_t *current_expansion = NULL; static inline void next_char(void); static void next_preprocessing_token(void); static void print_line_directive(const source_position_t *pos, const char *add); -static void print_spaces(void); static bool open_input(const char *filename) { @@ -184,7 +183,7 @@ static inline void next_real_char(void) if (input.bufpos >= input.bufend) { size_t s = fread(input.buf + MAX_PUTBACK, 1, sizeof(input.buf) - MAX_PUTBACK, input.file); - if(s == 0) { + if (s == 0) { CC = EOF; return; } @@ -315,7 +314,8 @@ static inline bool is_octal_digit(int chr) * Returns the value of a digit. * The only portable way to do it ... */ -static int digit_value(int digit) { +static int digit_value(int digit) +{ switch (digit) { case '0': return 0; case '1': return 1; @@ -880,7 +880,7 @@ static void skip_spaces(bool skip_newline) } } -static void eat_pp(preprocessor_token_type_t type) +static void eat_pp(int type) { (void) type; assert(pp_token.type == type); @@ -1251,7 +1251,7 @@ static void print_quoted_string(const char *const string) static void print_line_directive(const source_position_t *pos, const char *add) { - fprintf(out, "# %d ", pos->linenr); + fprintf(out, "# %u ", pos->linenr); print_quoted_string(pos->input_name); if (add != NULL) { fputc(' ', out); @@ -1264,7 +1264,7 @@ static void print_line_directive(const source_position_t *pos, const char *add) static void print_spaces(void) { - if (counted_newlines >= 8) { + if (counted_newlines >= 9) { if (input.had_non_space) { fputc('\n', out); }