aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-03-11 00:49:44 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-03-11 00:49:44 +0000
commit7ceb3598d8bd3cb6c00f1ebe08d468f5e8bbdbf1 (patch)
treee46c121978cf65e83ae4affddf04e3996e26128a /gcc/cpphash.c
parentfca9f642280728a9a473e755571b76219a368aea (diff)
downloadgcc-7ceb3598d8bd3cb6c00f1ebe08d468f5e8bbdbf1.zip
gcc-7ceb3598d8bd3cb6c00f1ebe08d468f5e8bbdbf1.tar.gz
gcc-7ceb3598d8bd3cb6c00f1ebe08d468f5e8bbdbf1.tar.bz2
cppfiles.c (file_cleanup, [...]): Replace bcopy(), index() etc calls.
* 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. From-SVN: r32477
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r--gcc/cpphash.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 51c5de0..e81b221 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -237,7 +237,7 @@ _cpp_install (pfile, name, len, type, value)
hp->length = len;
hp->value.cpval = value;
hp->name = ((U_CHAR *) hp) + sizeof (HASHNODE);
- bcopy (name, hp->name, len);
+ memcpy (hp->name, name, len);
hp->name[len] = 0;
return hp;
}
@@ -251,7 +251,7 @@ macro_cleanup (pbuf, pfile)
if (macro->type == T_DISABLED)
macro->type = T_MACRO;
if (macro->type != T_MACRO || pbuf->buf != macro->value.defn->expansion)
- free (pbuf->buf);
+ free ((PTR) pbuf->buf);
return 0;
}
@@ -493,7 +493,7 @@ collect_expansion (pfile, arglist)
if (last_token == START)
{
/* Empty macro definition. */
- exp = xstrdup ("\r \r ");
+ exp = (U_CHAR *) xstrdup ("\r \r ");
len = 1;
}
else
@@ -506,7 +506,8 @@ collect_expansion (pfile, arglist)
CPP_NUL_TERMINATE (pfile);
len = CPP_WRITTEN (pfile) - start + 1;
- exp = xmalloc (len + 4); /* space for no-concat markers at either end */
+ /* space for no-concat markers at either end */
+ exp = (U_CHAR *) xmalloc (len + 4);
exp[0] = '\r';
exp[1] = ' ';
exp[len + 1] = '\r';
@@ -580,7 +581,7 @@ collect_formal_parameters (pfile)
tok = pfile->token_buffer + old_written;
len = CPP_PWRITTEN (pfile) - tok;
if (namebuf
- && (name = strstr (namebuf, tok))
+ && (name = (U_CHAR *) strstr (namebuf, tok))
&& name[len] == ','
&& (name == namebuf || name[-1] == ','))
{
@@ -591,7 +592,7 @@ collect_formal_parameters (pfile)
&& !strncmp (tok, "__VA_ARGS__", sizeof "__VA_ARGS__" - 1))
cpp_pedwarn (pfile,
"C99 does not permit use of `__VA_ARGS__' as a macro argument name");
- namebuf = xrealloc (namebuf, argslen + len + 1);
+ namebuf = (U_CHAR *) xrealloc (namebuf, argslen + len + 1);
name = &namebuf[argslen - 1];
argslen += len + 1;
@@ -604,7 +605,7 @@ collect_formal_parameters (pfile)
case CPP_COMMA:
argc++;
- argv = xrealloc (argv, (argc + 1)*sizeof(struct arg));
+ argv = (struct arg *) xrealloc (argv, (argc + 1)*sizeof(struct arg));
argv[argc].len = 0;
break;
@@ -637,7 +638,7 @@ collect_formal_parameters (pfile)
cpp_pedwarn (pfile, "C89 does not permit varargs macros");
len = sizeof "__VA_ARGS__" - 1;
- namebuf = xrealloc (namebuf, argslen + len + 1);
+ namebuf = (U_CHAR *) xrealloc (namebuf, argslen + len + 1);
name = &namebuf[argslen - 1];
argslen += len;
memcpy (name, "__VA_ARGS__", len);