ref: 3fe7aa67651c02c0d54098b6c32c1db012e56170
parent: 711bace8774f91a3254ae7ef98166a2b2906f353
author: Roberto E. Vargas Caballero <[email protected]>
date: Sun Jul 29 05:38:29 EDT 2012
Changed user options to shorter forms Previous one were too much verbose.
--- a/cc.h
+++ b/cc.h
@@ -7,14 +7,13 @@
struct user_opt {
- unsigned char implicit_int;
+ unsigned char implicit;
unsigned char c99;
- unsigned char useless_typename;
- unsigned char typeqlf_repeat;
+ unsigned char useless;
+ unsigned char repeat;
};
-
-extern struct user_opt user_opt;
+extern struct user_opt options;
extern void warning(const char *fmt, ...);
extern void error(const char *fmt, ...);
--- a/decl.c
+++ b/decl.c
@@ -133,7 +133,7 @@
declarator();
new = decl_type(tp);
if (!new->type) {
- warning_error(user_opt.implicit_int,
+ warning_error(options.implicit,
"type defaults to 'int' in declaration of '%s'",
yytext);
} else if (new->type == FTN && yytoken == '{') {
@@ -159,7 +159,7 @@
warning("data definition has no type or storage class");
}
if (yytoken == ';') {
- warning_error(user_opt.useless_typename,
+ warning_error(options.useless,
"useless type name in empty declaration");
} else if (listdcl(tp)) { /* in case of not being a function */
expect(';');
@@ -171,4 +171,5 @@
void type_name()
{
+
}
--- a/main.c
+++ b/main.c
@@ -6,7 +6,7 @@
#include "syntax.h"
extern void open_file(const char *file);
-struct user_opt user_opt;
+struct user_opt options;
--- a/types.c
+++ b/types.c
@@ -169,12 +169,12 @@
cp->c_reg = 1;
return;
case CONST:
- if (user_opt.typeqlf_repeat && cp->c_reg)
+ if (options.repeat && cp->c_reg)
goto duplicated;
cp->c_const = 1;
return;
case VOLATILE:
- if (user_opt.typeqlf_repeat && cp->c_volatile)
+ if (options.repeat && cp->c_volatile)
goto duplicated;
cp->c_volatile = 1;
return;