aboutsummaryrefslogtreecommitdiff
path: root/gcc/protoize.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2003-08-14 06:04:46 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2003-08-14 06:04:46 +0000
commit9e46226d997030a197aaff707ce2cd678a6bd0c4 (patch)
tree180f85591962090333544eae1a66e261519685b5 /gcc/protoize.c
parentc5d190371ba33d6b23cd39876baa3d999267614a (diff)
downloadgcc-9e46226d997030a197aaff707ce2cd678a6bd0c4.zip
gcc-9e46226d997030a197aaff707ce2cd678a6bd0c4.tar.gz
gcc-9e46226d997030a197aaff707ce2cd678a6bd0c4.tar.bz2
* protoize.c (substr): Delete, callers changed to `strstr'.
From-SVN: r70430
Diffstat (limited to 'gcc/protoize.c')
-rw-r--r--gcc/protoize.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/gcc/protoize.c b/gcc/protoize.c
index 58be683..0dd91e2 100644
--- a/gcc/protoize.c
+++ b/gcc/protoize.c
@@ -79,7 +79,6 @@ extern void fancy_abort (void) ATTRIBUTE_NORETURN;
static void notice (const char *, ...) ATTRIBUTE_PRINTF_1;
static char *savestring (const char *, unsigned int);
static char *dupnstr (const char *, size_t);
-static const char *substr (const char *, const char * const);
static int safe_read (int, void *, int);
static void safe_write (int, void *, int, const char *);
static void save_pointers (void);
@@ -548,28 +547,6 @@ dupnstr (const char *s, size_t n)
ret_val[n] = '\0';
return ret_val;
}
-
-/* Return a pointer to the first occurrence of s2 within s1 or NULL if s2
- does not occur within s1. Assume neither s1 nor s2 are null pointers. */
-
-static const char *
-substr (const char *s1, const char *const s2)
-{
- for (; *s1 ; s1++)
- {
- const char *p1;
- const char *p2;
- int c;
-
- for (p1 = s1, p2 = s2; (c = *p2); p1++, p2++)
- if (*p1 != c)
- goto outer;
- return s1;
-outer:
- ;
- }
- return 0;
-}
/* Read LEN bytes at PTR from descriptor DESC, for file FILENAME,
retrying if necessary. Return the actual number of bytes read. */
@@ -2516,7 +2493,7 @@ find_extern_def (const def_dec_info *head, const def_dec_info *user)
char *p;
strcpy (needed, user->ansi_decl);
- p = (NONCONST char *) substr (needed, user->hash_entry->symbol)
+ p = strstr (needed, user->hash_entry->symbol)
+ strlen (user->hash_entry->symbol) + 2;
/* Avoid having ??? in the string. */
*p++ = '?';
@@ -2875,7 +2852,7 @@ other_variable_style_function (const char *ansi_header)
/* See if we have a stdarg function, or a function which has stdarg style
parameters or a stdarg style return type. */
- return substr (ansi_header, "...") != 0;
+ return strstr (ansi_header, "...") != 0;
#else /* !defined (UNPROTOIZE) */
@@ -2889,7 +2866,7 @@ other_variable_style_function (const char *ansi_header)
{
const char *candidate;
- if ((candidate = substr (p, varargs_style_indicator)) == 0)
+ if ((candidate = strstr (p, varargs_style_indicator)) == 0)
return 0;
else
if (!is_id_char (candidate[-1]) && !is_id_char (candidate[len]))