- fixed a lot of 'enum type mixed with ...' warnings
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 14 Nov 2008 23:11:49 +0000 (23:11 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 14 Nov 2008 23:11:49 +0000 (23:11 +0000)
[r23673]

lang_features.h
main.c
preprocessor.c
token.c
token_t.h

index ad88c36..c024f22 100644 (file)
@@ -33,7 +33,7 @@ typedef enum lang_features_t {
 } lang_features_t;
 
 /* the current C mode/dialect */
-extern lang_features_t c_mode;
+extern unsigned int c_mode;
 
 /* the 'machine size', 16, 32 or 64 bit */
 extern unsigned int machine_size;
diff --git a/main.c b/main.c
index 8e0c7d8..b3a9065 100644 (file)
--- a/main.c
+++ b/main.c
@@ -50,6 +50,7 @@
 #define fdopen(fd, mode)         _fdopen(fd, mode)
 #define popen(cmd, mode)         _popen(cmd, mode)
 #define pclose(file)             _pclose(file)
+#define unlink(filename)         _unlink(filename)
 
 #else
 #include <unistd.h>
@@ -98,7 +99,7 @@
 #endif
 
 /** The current c mode/dialect. */
-lang_features_t c_mode = _C89 | _ANSI | _C99 | _GNUC;
+unsigned int c_mode = _C89 | _ANSI | _C99 | _GNUC;
 
 /** The 'machine size', 16, 32 or 64 bit, 32bit is the default. */
 unsigned int machine_size = 32;
@@ -680,8 +681,8 @@ int main(int argc, char **argv)
 
        /* parse rest of options */
        lang_standard_t standard        = STANDARD_DEFAULT;
-       lang_features_t features_on     = 0;
-       lang_features_t features_off    = 0;
+       unsigned        features_on     = 0;
+       unsigned        features_off    = 0;
        filetype_t      forced_filetype = FILETYPE_AUTODETECT;
        bool            help_displayed  = false;
        bool            argument_errors = false;
index 39b2bb7..2d9a1a4 100644 (file)
@@ -184,7 +184,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;
                }
@@ -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);
diff --git a/token.c b/token.c
index 3289c38..fd589e9 100644 (file)
--- a/token.c
+++ b/token.c
@@ -140,25 +140,25 @@ void print_token(FILE *f, const token_t *token)
        }
 }
 
-void print_pp_token_type(FILE *f, preprocessor_token_type_t token_type)
+void print_pp_token_type(FILE *f, int token_type)
 {
-       if(token_type == TP_EOF) {
+       if (token_type == TP_EOF) {
                fputs("end of file", f);
                return;
        }
-       if(token_type == TP_ERROR) {
+       if (token_type == TP_ERROR) {
                fputs("error", f);
                return;
        }
 
        int token_symbols_len = TP_LAST_TOKEN;
-       if(token_type < 0 || token_type >= token_symbols_len) {
+       if (token_type < 0 || token_type >= token_symbols_len) {
                fputs("invalid token", f);
                return;
        }
 
        const symbol_t *symbol = pp_token_symbols[token_type];
-       if(symbol != NULL) {
+       if (symbol != NULL) {
                fprintf(f, "%s", symbol->string);
        } else {
                if(token_type >= 0 && token_type < 256) {
index 848c3ad..ecd26bb 100644 (file)
--- a/token_t.h
+++ b/token_t.h
@@ -77,7 +77,7 @@ void exit_tokens(void);
 void print_token_type(FILE *out, token_type_t token_type);
 void print_token(FILE *out, const token_t *token);
 
-void print_pp_token_type(FILE *out, preprocessor_token_type_t type);
+void print_pp_token_type(FILE *out, int type);
 void print_pp_token(FILE *out, const token_t *token);
 
 #endif