Commit 9e7d1164 by Nathanael Nerode

* lex.c: Convert to ISO C.

From-SVN: r67904
parent 362efdc1
2003-06-13 Nathanael Nerode <neroden@gcc.gnu.org> 2003-06-13 Nathanael Nerode <neroden@gcc.gnu.org>
* lex.c: Convert to ISO C.
2003-05-19 Jens-Michael Hoffmann <jensmh@gmx.de> 2003-05-19 Jens-Michael Hoffmann <jensmh@gmx.de>
* init.c: removes use of PARAMS macro. Use ISO style function * init.c: removes use of PARAMS macro. Use ISO style function
declarations. (Not copyright-significant change.) declarations. (Not copyright-significant change.)
......
...@@ -40,19 +40,19 @@ Boston, MA 02111-1307, USA. */ ...@@ -40,19 +40,19 @@ Boston, MA 02111-1307, USA. */
#include "timevar.h" #include "timevar.h"
#include "diagnostic.h" #include "diagnostic.h"
static int interface_strcmp PARAMS ((const char *)); static int interface_strcmp (const char *);
static void init_cp_pragma PARAMS ((void)); static void init_cp_pragma (void);
static tree parse_strconst_pragma PARAMS ((const char *, int)); static tree parse_strconst_pragma (const char *, int);
static void handle_pragma_vtable PARAMS ((cpp_reader *)); static void handle_pragma_vtable (cpp_reader *);
static void handle_pragma_unit PARAMS ((cpp_reader *)); static void handle_pragma_unit (cpp_reader *);
static void handle_pragma_interface PARAMS ((cpp_reader *)); static void handle_pragma_interface (cpp_reader *);
static void handle_pragma_implementation PARAMS ((cpp_reader *)); static void handle_pragma_implementation (cpp_reader *);
static void handle_pragma_java_exceptions PARAMS ((cpp_reader *)); static void handle_pragma_java_exceptions (cpp_reader *);
static int is_global PARAMS ((tree)); static int is_global (tree);
static void init_operators PARAMS ((void)); static void init_operators (void);
static void copy_lang_type PARAMS ((tree)); static void copy_lang_type (tree);
/* A constraint that can be tested at compile time. */ /* A constraint that can be tested at compile time. */
#define CONSTRAINT(name, expr) extern int constraint_##name [(expr) ? 1 : -1] #define CONSTRAINT(name, expr) extern int constraint_##name [(expr) ? 1 : -1]
...@@ -94,8 +94,7 @@ static struct impl_files *impl_file_chain; ...@@ -94,8 +94,7 @@ static struct impl_files *impl_file_chain;
and whose type is the modifier list. */ and whose type is the modifier list. */
tree tree
make_pointer_declarator (cv_qualifiers, target) make_pointer_declarator (tree cv_qualifiers, tree target)
tree cv_qualifiers, target;
{ {
if (target && TREE_CODE (target) == IDENTIFIER_NODE if (target && TREE_CODE (target) == IDENTIFIER_NODE
&& ANON_AGGRNAME_P (target)) && ANON_AGGRNAME_P (target))
...@@ -114,8 +113,7 @@ make_pointer_declarator (cv_qualifiers, target) ...@@ -114,8 +113,7 @@ make_pointer_declarator (cv_qualifiers, target)
and whose type is the modifier list. */ and whose type is the modifier list. */
tree tree
make_reference_declarator (cv_qualifiers, target) make_reference_declarator (tree cv_qualifiers, tree target)
tree cv_qualifiers, target;
{ {
target = build_nt (ADDR_EXPR, target); target = build_nt (ADDR_EXPR, target);
TREE_TYPE (target) = cv_qualifiers; TREE_TYPE (target) = cv_qualifiers;
...@@ -123,8 +121,8 @@ make_reference_declarator (cv_qualifiers, target) ...@@ -123,8 +121,8 @@ make_reference_declarator (cv_qualifiers, target)
} }
tree tree
make_call_declarator (target, parms, cv_qualifiers, exception_specification) make_call_declarator (tree target, tree parms, tree cv_qualifiers,
tree target, parms, cv_qualifiers, exception_specification; tree exception_specification)
{ {
target = build_nt (CALL_EXPR, target, target = build_nt (CALL_EXPR, target,
tree_cons (parms, cv_qualifiers, NULL_TREE), tree_cons (parms, cv_qualifiers, NULL_TREE),
...@@ -136,8 +134,8 @@ make_call_declarator (target, parms, cv_qualifiers, exception_specification) ...@@ -136,8 +134,8 @@ make_call_declarator (target, parms, cv_qualifiers, exception_specification)
} }
void void
set_quals_and_spec (call_declarator, cv_qualifiers, exception_specification) set_quals_and_spec (tree call_declarator, tree cv_qualifiers,
tree call_declarator, cv_qualifiers, exception_specification; tree exception_specification)
{ {
CALL_DECLARATOR_QUALS (call_declarator) = cv_qualifiers; CALL_DECLARATOR_QUALS (call_declarator) = cv_qualifiers;
CALL_DECLARATOR_EXCEPTION_SPEC (call_declarator) = exception_specification; CALL_DECLARATOR_EXCEPTION_SPEC (call_declarator) = exception_specification;
...@@ -151,7 +149,7 @@ int interface_unknown; /* whether or not we know this class ...@@ -151,7 +149,7 @@ int interface_unknown; /* whether or not we know this class
/* Initialization before switch parsing. */ /* Initialization before switch parsing. */
int int
cxx_init_options () cxx_init_options (void)
{ {
/* Default exceptions on. */ /* Default exceptions on. */
flag_exceptions = 1; flag_exceptions = 1;
...@@ -166,7 +164,7 @@ cxx_init_options () ...@@ -166,7 +164,7 @@ cxx_init_options ()
} }
void void
cxx_finish () cxx_finish (void)
{ {
c_common_finish (); c_common_finish ();
} }
...@@ -184,7 +182,7 @@ operator_name_info_t assignment_operator_name_info[(int) LAST_CPLUS_TREE_CODE]; ...@@ -184,7 +182,7 @@ operator_name_info_t assignment_operator_name_info[(int) LAST_CPLUS_TREE_CODE];
#undef DEF_OPERATOR #undef DEF_OPERATOR
static void static void
init_operators () init_operators (void)
{ {
tree identifier; tree identifier;
char buffer[256]; char buffer[256];
...@@ -367,7 +365,7 @@ static const struct resword reswords[] = ...@@ -367,7 +365,7 @@ static const struct resword reswords[] =
}; };
void void
init_reswords () init_reswords (void)
{ {
unsigned int i; unsigned int i;
tree id; tree id;
...@@ -386,7 +384,7 @@ init_reswords () ...@@ -386,7 +384,7 @@ init_reswords ()
} }
static void static void
init_cp_pragma () init_cp_pragma (void)
{ {
c_register_pragma (0, "vtable", handle_pragma_vtable); c_register_pragma (0, "vtable", handle_pragma_vtable);
c_register_pragma (0, "unit", handle_pragma_unit); c_register_pragma (0, "unit", handle_pragma_unit);
...@@ -461,7 +459,7 @@ cxx_init (void) ...@@ -461,7 +459,7 @@ cxx_init (void)
information. */ information. */
void void
extract_interface_info () extract_interface_info (void)
{ {
struct c_fileinfo *finfo = 0; struct c_fileinfo *finfo = 0;
...@@ -483,8 +481,7 @@ extract_interface_info () ...@@ -483,8 +481,7 @@ extract_interface_info ()
INTERFACE/IMPLEMENTATION pair. Otherwise, return 0. */ INTERFACE/IMPLEMENTATION pair. Otherwise, return 0. */
static int static int
interface_strcmp (s) interface_strcmp (const char* s)
const char *s;
{ {
/* Set the interface/implementation bits for this scope. */ /* Set the interface/implementation bits for this scope. */
struct impl_files *ifiles; struct impl_files *ifiles;
...@@ -521,8 +518,7 @@ interface_strcmp (s) ...@@ -521,8 +518,7 @@ interface_strcmp (s)
} }
void void
note_got_semicolon (type) note_got_semicolon (tree type)
tree type;
{ {
if (!TYPE_P (type)) if (!TYPE_P (type))
abort (); abort ();
...@@ -531,8 +527,7 @@ note_got_semicolon (type) ...@@ -531,8 +527,7 @@ note_got_semicolon (type)
} }
void void
note_list_got_semicolon (declspecs) note_list_got_semicolon (tree declspecs)
tree declspecs;
{ {
tree link; tree link;
...@@ -549,9 +544,7 @@ note_list_got_semicolon (declspecs) ...@@ -549,9 +544,7 @@ note_list_got_semicolon (declspecs)
/* Parse a #pragma whose sole argument is a string constant. /* Parse a #pragma whose sole argument is a string constant.
If OPT is true, the argument is optional. */ If OPT is true, the argument is optional. */
static tree static tree
parse_strconst_pragma (name, opt) parse_strconst_pragma (const char* name, int opt)
const char *name;
int opt;
{ {
tree result, x; tree result, x;
enum cpp_ttype t; enum cpp_ttype t;
...@@ -573,24 +566,21 @@ parse_strconst_pragma (name, opt) ...@@ -573,24 +566,21 @@ parse_strconst_pragma (name, opt)
} }
static void static void
handle_pragma_vtable (dfile) handle_pragma_vtable (cpp_reader* dfile ATTRIBUTE_UNUSED )
cpp_reader *dfile ATTRIBUTE_UNUSED;
{ {
parse_strconst_pragma ("vtable", 0); parse_strconst_pragma ("vtable", 0);
sorry ("#pragma vtable no longer supported"); sorry ("#pragma vtable no longer supported");
} }
static void static void
handle_pragma_unit (dfile) handle_pragma_unit (cpp_reader* dfile ATTRIBUTE_UNUSED )
cpp_reader *dfile ATTRIBUTE_UNUSED;
{ {
/* Validate syntax, but don't do anything. */ /* Validate syntax, but don't do anything. */
parse_strconst_pragma ("unit", 0); parse_strconst_pragma ("unit", 0);
} }
static void static void
handle_pragma_interface (dfile) handle_pragma_interface (cpp_reader* dfile ATTRIBUTE_UNUSED )
cpp_reader *dfile ATTRIBUTE_UNUSED;
{ {
tree fname = parse_strconst_pragma ("interface", 1); tree fname = parse_strconst_pragma ("interface", 1);
struct c_fileinfo *finfo; struct c_fileinfo *finfo;
...@@ -632,8 +622,7 @@ handle_pragma_interface (dfile) ...@@ -632,8 +622,7 @@ handle_pragma_interface (dfile)
a matching #p interface for this to have any effect. */ a matching #p interface for this to have any effect. */
static void static void
handle_pragma_implementation (dfile) handle_pragma_implementation (cpp_reader* dfile ATTRIBUTE_UNUSED )
cpp_reader *dfile ATTRIBUTE_UNUSED;
{ {
tree fname = parse_strconst_pragma ("implementation", 1); tree fname = parse_strconst_pragma ("implementation", 1);
const char *main_filename; const char *main_filename;
...@@ -674,8 +663,7 @@ handle_pragma_implementation (dfile) ...@@ -674,8 +663,7 @@ handle_pragma_implementation (dfile)
/* Indicate that this file uses Java-personality exception handling. */ /* Indicate that this file uses Java-personality exception handling. */
static void static void
handle_pragma_java_exceptions (dfile) handle_pragma_java_exceptions (cpp_reader* dfile ATTRIBUTE_UNUSED )
cpp_reader *dfile ATTRIBUTE_UNUSED;
{ {
tree x; tree x;
if (c_lex (&x) != CPP_EOF) if (c_lex (&x) != CPP_EOF)
...@@ -687,8 +675,7 @@ handle_pragma_java_exceptions (dfile) ...@@ -687,8 +675,7 @@ handle_pragma_java_exceptions (dfile)
/* Return true if d is in a global scope. */ /* Return true if d is in a global scope. */
static int static int
is_global (d) is_global (tree d)
tree d;
{ {
while (1) while (1)
switch (TREE_CODE (d)) switch (TREE_CODE (d))
...@@ -740,9 +727,7 @@ unqualified_name_lookup_error (tree name) ...@@ -740,9 +727,7 @@ unqualified_name_lookup_error (tree name)
} }
tree tree
do_identifier (token, args) do_identifier (register tree token, tree args)
register tree token;
tree args;
{ {
register tree id; register tree id;
...@@ -821,9 +806,7 @@ do_identifier (token, args) ...@@ -821,9 +806,7 @@ do_identifier (token, args)
} }
tree tree
do_scoped_id (token, id) do_scoped_id (tree token, tree id)
tree token;
tree id;
{ {
timevar_push (TV_NAME_LOOKUP); timevar_push (TV_NAME_LOOKUP);
if (!id || (TREE_CODE (id) == FUNCTION_DECL if (!id || (TREE_CODE (id) == FUNCTION_DECL
...@@ -872,8 +855,7 @@ do_scoped_id (token, id) ...@@ -872,8 +855,7 @@ do_scoped_id (token, id)
} }
tree tree
identifier_typedecl_value (node) identifier_typedecl_value (tree node)
tree node;
{ {
tree t, type; tree t, type;
type = IDENTIFIER_TYPE_VALUE (node); type = IDENTIFIER_TYPE_VALUE (node);
...@@ -932,10 +914,7 @@ extern int tree_node_sizes[]; ...@@ -932,10 +914,7 @@ extern int tree_node_sizes[];
#endif #endif
tree tree
build_lang_decl (code, name, type) build_lang_decl (enum tree_code code, tree name, tree type)
enum tree_code code;
tree name;
tree type;
{ {
tree t; tree t;
...@@ -949,8 +928,7 @@ build_lang_decl (code, name, type) ...@@ -949,8 +928,7 @@ build_lang_decl (code, name, type)
and pushdecl (for functions generated by the backend). */ and pushdecl (for functions generated by the backend). */
void void
retrofit_lang_decl (t) retrofit_lang_decl (tree t)
tree t;
{ {
struct lang_decl *ld; struct lang_decl *ld;
size_t size; size_t size;
...@@ -984,8 +962,7 @@ retrofit_lang_decl (t) ...@@ -984,8 +962,7 @@ retrofit_lang_decl (t)
} }
void void
cxx_dup_lang_specific_decl (node) cxx_dup_lang_specific_decl (tree node)
tree node;
{ {
int size; int size;
struct lang_decl *ld; struct lang_decl *ld;
...@@ -1010,8 +987,7 @@ cxx_dup_lang_specific_decl (node) ...@@ -1010,8 +987,7 @@ cxx_dup_lang_specific_decl (node)
/* Copy DECL, including any language-specific parts. */ /* Copy DECL, including any language-specific parts. */
tree tree
copy_decl (decl) copy_decl (tree decl)
tree decl;
{ {
tree copy; tree copy;
...@@ -1023,8 +999,7 @@ copy_decl (decl) ...@@ -1023,8 +999,7 @@ copy_decl (decl)
/* Replace the shared language-specific parts of NODE with a new copy. */ /* Replace the shared language-specific parts of NODE with a new copy. */
static void static void
copy_lang_type (node) copy_lang_type (tree node)
tree node;
{ {
int size; int size;
struct lang_type *lt; struct lang_type *lt;
...@@ -1049,8 +1024,7 @@ copy_lang_type (node) ...@@ -1049,8 +1024,7 @@ copy_lang_type (node)
/* Copy TYPE, including any language-specific parts. */ /* Copy TYPE, including any language-specific parts. */
tree tree
copy_type (type) copy_type (tree type)
tree type;
{ {
tree copy; tree copy;
...@@ -1060,8 +1034,7 @@ copy_type (type) ...@@ -1060,8 +1034,7 @@ copy_type (type)
} }
tree tree
cxx_make_type (code) cxx_make_type (enum tree_code code)
enum tree_code code;
{ {
register tree t = make_node (code); register tree t = make_node (code);
...@@ -1113,8 +1086,7 @@ cxx_make_type (code) ...@@ -1113,8 +1086,7 @@ cxx_make_type (code)
} }
tree tree
make_aggr_type (code) make_aggr_type (enum tree_code code)
enum tree_code code;
{ {
tree t = cxx_make_type (code); tree t = cxx_make_type (code);
...@@ -1128,8 +1100,7 @@ make_aggr_type (code) ...@@ -1128,8 +1100,7 @@ make_aggr_type (code)
RID. */ RID. */
int int
cp_type_qual_from_rid (rid) cp_type_qual_from_rid (tree rid)
tree rid;
{ {
if (rid == ridpointers[(int) RID_CONST]) if (rid == ridpointers[(int) RID_CONST])
return TYPE_QUAL_CONST; return TYPE_QUAL_CONST;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment