From a8a63732c4f3ee7af0543a1790f9076363205213 Mon Sep 17 00:00:00 2001 From: Brendan Kehoe Date: Mon, 3 Nov 1997 23:20:24 +0000 Subject: [PATCH] repo.c (rindex): Add decl unconditionally. * repo.c (rindex): Add decl unconditionally. (get_base_filename, open_repo_file): Don't cast rindex. * xref.c (rindex): Add decl unconditionally. (index): Remove unused decl. (open_xref_file): Don't cast rindex. fix potential problems with 64-bit compilers and casting an int up to a char* From-SVN: r16306 --- gcc/cp/ChangeLog | 8 ++++++++ gcc/cp/repo.c | 12 ++++++------ gcc/cp/xref.c | 9 ++++----- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c1ea91b68d3..06808f5ec75 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +1997-11-03 Brendan Kehoe + + * repo.c (rindex): Add decl unconditionally. + (get_base_filename, open_repo_file): Don't cast rindex. + * xref.c (rindex): Add decl unconditionally. + (index): Remove unused decl. + (open_xref_file): Don't cast rindex. + Sun Nov 2 15:04:12 1997 Jason Merrill * class.c (build_vbase_path): Propagate the result type properly. diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c index e029f90acea..d18730ccb1c 100644 --- a/gcc/cp/repo.c +++ b/gcc/cp/repo.c @@ -34,15 +34,15 @@ Boston, MA 02111-1307, USA. */ #ifdef HAVE_STRING_H #include -#else -extern char * rindex (); #endif #ifdef HAVE_STDLIB_H #include #else extern char * getenv (); #endif -extern char * getpwd PROTO((void)); + +extern char *rindex (); +extern char *getpwd PROTO((void)); static tree repo_get_id PROTO((tree)); static char *save_string PROTO((char *, int)); @@ -277,7 +277,7 @@ get_base_filename (filename) return NULL; } - p = (char *) rindex (filename, '/'); + p = rindex (filename, '/'); if (p) return p+1; else @@ -294,10 +294,10 @@ open_repo_file (filename) if (s == NULL) return; - p = (char *) rindex (s, '/'); + p = rindex (s, '/'); if (! p) p = s; - p = (char *) rindex (p, '.'); + p = rindex (p, '.'); if (! p) p = s + strlen (s); diff --git a/gcc/cp/xref.c b/gcc/cp/xref.c index b579588a7ff..6269f17602e 100644 --- a/gcc/cp/xref.c +++ b/gcc/cp/xref.c @@ -40,11 +40,10 @@ extern char *getpwd PROTO((void)); #ifdef HAVE_STRING_H #include -#else -extern char *index (); -extern char *rindex (); #endif +extern char *rindex (); + /* The character(s) used to join a directory specification (obtained with getwd or equivalent) with a non-absolute file name. */ @@ -813,14 +812,14 @@ open_xref_file(file) #ifdef XREF_FILE_NAME XREF_FILE_NAME (xref_name, file); #else - s = (char *) rindex (file, '/'); + s = rindex (file, '/'); if (s == NULL) sprintf (xref_name, ".%s.gxref", file); else { ++s; strcpy (xref_name, file); - t = (char *) rindex (xref_name, '/'); + t = rindex (xref_name, '/'); ++t; *t++ = '.'; strcpy (t, s); -- 2.30.2