summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2006-04-09 22:09:24 +0000
committerPaul Smith <psmith@gnu.org>2006-04-09 22:09:24 +0000
commitc25294ad3ba1252a0d77bf63a27758a0eee4259e (patch)
tree3a3bed68bb3377d1a2a28ef8e1a56a269bc7b675 /file.c
parentf222b19158a91b121af29a6a8eb5d74aa591078a (diff)
downloadgunmake-c25294ad3ba1252a0d77bf63a27758a0eee4259e.tar.gz
Another round of cleanups:
- Add more warnings. - Rename variables that mask out-scope vars with the same name. - Remove all casts of return values from xmalloc, xrealloc, and alloca. - Remove casts of the first argument to xrealloc. - Convert all bcopy/bzero/bcmp invocations to use memcp/memmove/memset/memcmp.
Diffstat (limited to 'file.c')
-rw-r--r--file.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/file.c b/file.c
index 90dd123..b2f95e8 100644
--- a/file.c
+++ b/file.c
@@ -78,7 +78,7 @@ lookup_file (char *name)
register struct file *f;
struct file file_key;
#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
- register char *lname, *ln;
+ char *lname, *ln;
#endif
assert (*name != '\0');
@@ -90,8 +90,8 @@ lookup_file (char *name)
# ifndef WANT_CASE_SENSITIVE_TARGETS
if (*name != '.')
{
- register char *n;
- lname = (char *) malloc (strlen (name) + 1);
+ char *n;
+ lname = xmalloc (strlen (name) + 1);
for (n = name, ln = lname; *n != '\0'; ++n, ++ln)
*ln = isupper ((unsigned char)*n) ? tolower ((unsigned char)*n) : *n;
*ln = '\0';
@@ -147,8 +147,8 @@ enter_file (char *name)
#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
if (*name != '.')
{
- register char *n;
- lname = (char *) malloc (strlen (name) + 1);
+ char *n;
+ lname = xmalloc (strlen (name) + 1);
for (n = name, ln = lname; *n != '\0'; ++n, ++ln)
{
if (isupper ((unsigned char)*n))
@@ -176,8 +176,8 @@ enter_file (char *name)
return f;
}
- new = (struct file *) xmalloc (sizeof (struct file));
- bzero ((char *) new, sizeof (struct file));
+ new = xmalloc (sizeof (struct file));
+ memset (new, '\0', sizeof (struct file));
new->name = new->hname = name;
new->update_status = -1;
@@ -539,7 +539,7 @@ expand_deps (struct file *f)
will always be empty. */
if (d->stem[0] == '\0')
/* This needs memmove() in ISO C. */
- bcopy (percent+1, percent, strlen (percent));
+ memmove (percent, percent+1, strlen (percent));
else
{
char *o = patsubst_expand (buffer, d->stem, pattern,
@@ -1030,7 +1030,7 @@ build_target_list (char *value)
p = &value[off];
}
- bcopy (f->name, p, l);
+ memcpy (p, f->name, l);
p += l;
*(p++) = ' ';
}