diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-03-11 00:49:44 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-03-11 00:49:44 +0000 |
commit | 8d7a2585c0c56370b9cec0d0dc9db5fa4252b6df (patch) | |
tree | e46c121978cf65e83ae4affddf04e3996e26128a /gcc/cppfiles.c | |
parent | bceb0d1fd90fff08b5f2cae24cabaf50bb9f1f42 (diff) | |
download | gcc-8d7a2585c0c56370b9cec0d0dc9db5fa4252b6df.tar.gz |
* cppfiles.c (file_cleanup, _cpp_find_include_file,
remap_filename, _cpp_read_include_file, actual_directory,
hack_vms_include_specification): Replace bcopy(), index() etc
calls. Add casts to some allocations. Make some variables
pointers to const [unsigned] char.
* cpphash.c (_cpp_install, macro_cleanup, collect_expansion,
collect_formal_parameters): Similarly.
* cppinit.c (struct pending_option, append_include_chain,
cpp_options_init, cpp_reader_init, initialize_standard_includes,
cpp_start_read, new_pending_define, handle_option): Similarly.
* cpplib.c (cpp_define, copy_comment, do_define, do_include,
do_undef, do_error, do_warning, do_pragma, do_pragma_once,
do_pragma_implementation, detect_if_not_defined,
do_ifdef, skip_if_group, cpp_get_token, parse_string,
do_assert, do_unassert): Similarly.
* cpplib.h (cpp_buffer, cpp_options): Update types. Update
function prototypes.
* mkdeps.c (deps_add_target, deps_add_dep): cast allocations.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32477 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppfiles.c')
-rw-r--r-- | gcc/cppfiles.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c index 43d9bfd505d..7b2b2407971 100644 --- a/gcc/cppfiles.c +++ b/gcc/cppfiles.c @@ -165,7 +165,7 @@ file_cleanup (pbuf, pfile) { if (pbuf->buf) { - free (pbuf->buf); + free ((PTR) pbuf->buf); pbuf->buf = 0; } if (pfile->system_include_depth) @@ -246,7 +246,7 @@ _cpp_find_include_file (pfile, fname, search_start, ihash, before) for (l = search_start; l; l = l->next) { - bcopy (l->name, name, l->nlen); + memcpy (name, l->name, l->nlen); name[l->nlen] = '/'; strcpy (&name[l->nlen+1], fname); _cpp_simplify_pathname (name); @@ -266,7 +266,7 @@ _cpp_find_include_file (pfile, fname, search_start, ihash, before) if (f >= 0) { ih->foundhere = l; - ih->name = xrealloc (name, strlen (name)+1); + ih->name = xrealloc (name, strlen (name) + 1); return f; } } @@ -445,7 +445,7 @@ remap_filename (pfile, name, loc) looking in. Thus #include <sys/types.h> will look up sys/types.h in /usr/include/header.gcc and look up types.h in /usr/include/sys/header.gcc. */ - p = rindex (name, '/'); + p = strrchr (name, '/'); if (!p) p = name; if (loc && loc->name @@ -462,7 +462,7 @@ remap_filename (pfile, name, loc) else { char * newdir = (char *) alloca (p - name + 1); - bcopy (name, newdir, p - name); + memcpy (newdir, name, p - name); newdir[p - name] = '\0'; dir = newdir; from = p + 1; @@ -614,7 +614,7 @@ _cpp_read_include_file (pfile, fd, ihash) if (length < 0) goto fail; if (length == 0) - ihash->control_macro = ""; /* never re-include */ + ihash->control_macro = (const U_CHAR *) ""; /* never re-include */ close (fd); fp->rlimit = fp->alimit = fp->buf + length; @@ -657,7 +657,7 @@ actual_directory (pfile, fname) struct file_name_list *x; dir = xstrdup (fname); - last_slash = rindex (dir, '/'); + last_slash = strrchr (dir, '/'); if (last_slash) { if (last_slash == dir) @@ -1266,20 +1266,20 @@ hack_vms_include_specification (fullname) check_filename_before_returning = 0; must_revert = 0; /* See if we can find a 1st slash. If not, there's no path information. */ - first_slash = index (fullname, '/'); + first_slash = strchr (fullname, '/'); if (first_slash == 0) return 0; /* Nothing to do!!! */ /* construct device spec if none given. */ - if (index (fullname, ':') == 0) + if (strchr (fullname, ':') == 0) { /* If fullname has a slash, take it as device spec. */ if (first_slash == fullname) { - first_slash = index (fullname+1, '/'); /* 2nd slash ? */ + first_slash = strchr (fullname + 1, '/'); /* 2nd slash ? */ if (first_slash) *first_slash = ':'; /* make device spec */ for (basename = fullname; *basename != 0; basename++) @@ -1399,7 +1399,7 @@ hack_vms_include_specification (fullname) in the "root" directory. Otherwise, we need to add directory specifications. */ - if (index (unixname, '/') == 0) + if (strchr (unixname, '/') == 0) { /* if no directories specified yet and none are following. */ if (local_ptr[-1] == '[') @@ -1414,7 +1414,7 @@ hack_vms_include_specification (fullname) { /* As long as there are still subdirectories to add, do them. */ - while (index (unixname, '/') != 0) + while (strchr (unixname, '/') != 0) { /* If this token is "." we can ignore it if it's not at the beginning of a path. */ @@ -1496,8 +1496,8 @@ hack_vms_include_specification (fullname) /* The filename did not work. Try to remove the [000000] from the name, and return it. */ - basename = index (fullname, '['); - local_ptr = index (fullname, ']') + 1; + basename = strchr (fullname, '['); + local_ptr = strchr (fullname, ']') + 1; strcpy (basename, local_ptr); /* this gets rid of it */ } |