]> gcc.gnu.org Git - gcc.git/commitdiff
lex.c (FILE_NAME_NONDIRECTORY): Delete macro.
authorBrendan Kehoe <brendan@lisa.cygnus.com>
Sat, 1 Nov 1997 19:50:18 +0000 (19:50 +0000)
committerBrendan Kehoe <brendan@gcc.gnu.org>
Sat, 1 Nov 1997 19:50:18 +0000 (14:50 -0500)
        * 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

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/cp/lex.c
gcc/cp/repo.c
gcc/cp/xref.c

index 8c88225e6e9d20a9af44e8010e00bbacad625e00..20ca7e1df91b26ed5b7e1520c04189f22755accf 100644 (file)
@@ -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.
 
index 5cac56510d6417c4ca595c438fdd9de4e8683a1c..d6c6586b9ddccf7ad7fd8c16880e0fe35c8554b9 100644 (file)
@@ -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)
     {
index 3d17fa35634516fd3c0f4db42af1c0a9c030b6eb..1f0e5e91a4e83c4ea8bdd10f08dcee217a6a995a 100644 (file)
@@ -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)
        {
index 001a94309651b586f84c4772c268c45d3eaa8970..e029f90acea8d35aecab2a445a0f66fdc04d74d5 100644 (file)
@@ -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);
 
index fc2d1078ac2f021e87f631811aaa10575a8467b9..b579588a7ffeed9dbe8a1d8032acdab129f1c861 100644 (file)
@@ -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);
This page took 0.086659 seconds and 5 git commands to generate.