ref: 729bca35c55764bb98afccbd790570e5c94b47ed
parent: 5d4796cb4d72a844fd0e6a002e0056e83b34b468
author: Roberto E. Vargas Caballero <[email protected]>
date: Sun Jul 1 15:22:09 EDT 2012
Added restict field to the ctype struct This field is used in the pointers in C99 mode. In this patch is also changed vol and extrn abbreviates because weren-t so much clears.
--- a/symbol.h
+++ b/symbol.h
@@ -28,12 +28,13 @@
struct ctype {
bool c_type : 1;
- bool c_extrn : 1;
+ bool c_extern : 1;
bool c_static : 1;
bool c_auto : 1;
bool c_reg : 1;
bool c_const : 1;
- bool c_vol : 1;
+ bool c_volatile : 1;
+ bool c_restrict : 1;
bool c_unsigned : 1;
struct type *base;
};
--- a/types.c
+++ b/types.c
@@ -113,21 +113,21 @@
case TYPEDEF:
if (cp->c_type)
goto duplicated;
- if (cp->c_extrn | cp->c_auto | cp->c_reg | cp->c_static)
+ if (cp->c_extern | cp->c_auto | cp->c_reg | cp->c_static)
goto two_storage;
cp->c_type = 1;
return;
case EXTERN:
- if (cp->c_extrn)
+ if (cp->c_extern)
goto duplicated;
if (cp->c_type | cp->c_auto | cp->c_reg | cp->c_static)
goto two_storage;
- cp->c_extrn = 1;
+ cp->c_extern = 1;
return;
case STATIC:
if (cp->c_static)
goto duplicated;
- if (cp->c_type | cp->c_extrn | cp->c_auto | cp->c_reg)
+ if (cp->c_type | cp->c_extern | cp->c_auto | cp->c_reg)
goto two_storage;
cp->c_static = 1;
return;
@@ -134,7 +134,7 @@
case AUTO:
if (nested_level != 0)
goto bad_file_scope_storage;
- if (cp->c_type | cp->c_extrn | cp->c_static | cp->c_reg)
+ if (cp->c_type | cp->c_extern | cp->c_static | cp->c_reg)
goto two_storage;
if (cp->c_auto)
goto duplicated;
@@ -143,7 +143,7 @@
case REGISTER:
if (nested_level != 0)
goto bad_file_scope_storage;
- if (cp->c_type | cp->c_extrn | cp->c_auto | cp->c_static)
+ if (cp->c_type | cp->c_extern | cp->c_auto | cp->c_static)
goto two_storage;
if (cp->c_reg)
goto duplicated;
@@ -155,9 +155,9 @@
cp->c_const = 1;
return;
case VOLATILE:
- if (user_opt.typeqlf_repeat && cp->c_vol)
+ if (user_opt.typeqlf_repeat && cp->c_volatile)
goto duplicated;
- cp->c_vol = 1;
+ cp->c_volatile = 1;
return;
}
bad_file_scope_storage: