aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBrendan Kehoe <brendan@lisa.cygnus.com>1997-11-01 19:50:18 +0000
committerBrendan Kehoe <brendan@gcc.gnu.org>1997-11-01 14:50:18 -0500
commitb2bb2710f3e0eebda82bd3153d9fa1a32a950e7a (patch)
tree552c84754cf24106f6d18cba13ee2e7c7c0fa3c7 /gcc
parent5a0fa1de62991de26dd6819a0e67341cf23826c0 (diff)
downloadgcc-b2bb2710f3e0eebda82bd3153d9fa1a32a950e7a.zip
gcc-b2bb2710f3e0eebda82bd3153d9fa1a32a950e7a.tar.gz
gcc-b2bb2710f3e0eebda82bd3153d9fa1a32a950e7a.tar.bz2
lex.c (FILE_NAME_NONDIRECTORY): Delete macro.
* lex.c (FILE_NAME_NONDIRECTORY): Delete macro. (file_name_nondirectory): New function, doing the same as the macro. (set_typedecl_interface_info): Use it instead of the macro. (check_newline): Likewise. (handle_cp_pragma): Likewise. * repo.c (get_base_filename): Cast result of rindex to char*. (open_repo_file): Likewise. * xref.c (open_xref_file): Likewise. * error.c (dump_char): Make its arg int, not char. bring over the changes that went in yesterday to fix irix6 native cc build problems From-SVN: r16261
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog11
-rw-r--r--gcc/cp/error.c4
-rw-r--r--gcc/cp/lex.c28
-rw-r--r--gcc/cp/repo.c6
-rw-r--r--gcc/cp/xref.c4
5 files changed, 34 insertions, 19 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8c88225..20ca7e1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,16 @@
1997-11-01 Brendan Kehoe <brendan@lisa.cygnus.com>
+ * lex.c (FILE_NAME_NONDIRECTORY): Delete macro.
+ (file_name_nondirectory): New function, doing the same as the macro.
+ (set_typedecl_interface_info): Use it instead of the macro.
+ (check_newline): Likewise.
+ (handle_cp_pragma): Likewise.
+
+ * repo.c (get_base_filename): Cast result of rindex to char*.
+ (open_repo_file): Likewise.
+ * xref.c (open_xref_file): Likewise.
+ * error.c (dump_char): Make its arg int, not char.
+
* except.c (expand_builtin_throw) [!DWARF2_UNWIND_INFO]: Replace
remaining use of saved_throw_type with a call to get_eh_type.
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 5cac565..d6c6586 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -101,7 +101,7 @@ static void dump_function_name PROTO((tree));
static void dump_expr_list PROTO((tree));
static void dump_global_iord PROTO((tree));
static void dump_readonly_or_volatile PROTO((tree, enum pad));
-static void dump_char PROTO((char));
+static void dump_char PROTO((int));
static char *aggr_variety PROTO((tree));
static tree ident_fndecl PROTO((tree));
@@ -994,7 +994,7 @@ dump_function_name (t)
static void
dump_char (c)
- char c;
+ int c;
{
switch (c)
{
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 3d17fa3..1f0e5e9 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -93,10 +93,16 @@ static void reinit_parse_for_expr PROTO((struct obstack *));
/* Given a file name X, return the nondirectory portion.
Keep in mind that X can be computed more than once. */
-#ifndef FILE_NAME_NONDIRECTORY
-#define FILE_NAME_NONDIRECTORY(X) \
- (rindex (X, '/') != 0 ? rindex (X, '/') + 1 : X)
-#endif
+char *
+file_name_nondirectory (x)
+ char *x;
+{
+ char *tmp = (char *) rindex (x, '/');
+ if (tmp)
+ return (char *) (tmp + 1);
+ else
+ return x;
+}
/* This obstack is needed to hold text. It is not safe to use
TOKEN_BUFFER because `check_newline' calls `yylex'. */
@@ -1133,7 +1139,7 @@ set_typedecl_interface_info (prev, vars)
tree type = TREE_TYPE (vars);
CLASSTYPE_INTERFACE_ONLY (type) = TREE_INT_CST_LOW (fileinfo)
- = interface_strcmp (FILE_NAME_NONDIRECTORY (DECL_SOURCE_FILE (vars)));
+ = interface_strcmp (file_name_nondirectory (DECL_SOURCE_FILE (vars)));
}
static int
@@ -1787,7 +1793,6 @@ snarf_defarg ()
int len;
char *buf;
tree arg;
- struct pending_inline *t;
reinit_parse_for_expr (&inline_text_obstack);
len = obstack_object_size (&inline_text_obstack);
@@ -1873,8 +1878,6 @@ do_pending_defargs ()
tree defarg_fn = TREE_VALUE (defarg_fns);
if (defarg_parm == NULL_TREE)
{
- tree p;
-
push_nested_class (TREE_PURPOSE (defarg_fns), 1);
pushlevel (0);
if (is_member_template (defarg_fn))
@@ -1883,6 +1886,7 @@ do_pending_defargs ()
if (TREE_CODE (defarg_fn) == FUNCTION_DECL)
{
#if 0
+ tree p;
for (p = DECL_ARGUMENTS (defarg_fn); p; p = TREE_CHAIN (p))
pushdecl (copy_node (p));
#endif
@@ -2440,7 +2444,7 @@ linenum:
{
while (ifiles->next)
ifiles = ifiles->next;
- ifiles->filename = FILE_NAME_NONDIRECTORY (input_filename);
+ ifiles->filename = file_name_nondirectory (input_filename);
}
main_input_filename = input_filename;
@@ -4610,7 +4614,7 @@ handle_cp_pragma (pname)
tree fileinfo = IDENTIFIER_CLASS_VALUE (get_time_identifier (input_filename));
char *main_filename = input_filename;
- main_filename = FILE_NAME_NONDIRECTORY (main_filename);
+ main_filename = file_name_nondirectory (main_filename);
token = real_yylex ();
@@ -4640,7 +4644,7 @@ handle_cp_pragma (pname)
main_input_filename = input_filename;
#ifdef AUTO_IMPLEMENT
- filename = FILE_NAME_NONDIRECTORY (main_input_filename);
+ filename = file_name_nondirectory (main_input_filename);
fi = get_time_identifier (filename);
fi = IDENTIFIER_CLASS_VALUE (fi);
TREE_INT_CST_LOW (fi) = 0;
@@ -4665,7 +4669,7 @@ handle_cp_pragma (pname)
tree fileinfo = IDENTIFIER_CLASS_VALUE (get_time_identifier (input_filename));
char *main_filename = main_input_filename ? main_input_filename : input_filename;
- main_filename = FILE_NAME_NONDIRECTORY (main_filename);
+ main_filename = file_name_nondirectory (main_filename);
token = real_yylex ();
if (token != END_OF_LINE)
{
diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c
index 001a943..e029f90 100644
--- a/gcc/cp/repo.c
+++ b/gcc/cp/repo.c
@@ -277,7 +277,7 @@ get_base_filename (filename)
return NULL;
}
- p = rindex (filename, '/');
+ p = (char *) rindex (filename, '/');
if (p)
return p+1;
else
@@ -294,10 +294,10 @@ open_repo_file (filename)
if (s == NULL)
return;
- p = rindex (s, '/');
+ p = (char *) rindex (s, '/');
if (! p)
p = s;
- p = rindex (p, '.');
+ p = (char *) rindex (p, '.');
if (! p)
p = s + strlen (s);
diff --git a/gcc/cp/xref.c b/gcc/cp/xref.c
index fc2d107..b579588 100644
--- a/gcc/cp/xref.c
+++ b/gcc/cp/xref.c
@@ -813,14 +813,14 @@ open_xref_file(file)
#ifdef XREF_FILE_NAME
XREF_FILE_NAME (xref_name, file);
#else
- s = rindex (file, '/');
+ s = (char *) rindex (file, '/');
if (s == NULL)
sprintf (xref_name, ".%s.gxref", file);
else
{
++s;
strcpy (xref_name, file);
- t = rindex (xref_name, '/');
+ t = (char *) rindex (xref_name, '/');
++t;
*t++ = '.';
strcpy (t, s);