summaryrefslogtreecommitdiff
path: root/ar.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 /ar.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 'ar.c')
-rw-r--r--ar.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ar.c b/ar.c
index 956432e..9487146 100644
--- a/ar.c
+++ b/ar.c
@@ -216,7 +216,7 @@ ar_glob_match (int desc UNUSED, char *mem, int truncated UNUSED,
if (fnmatch (state->pattern, mem, FNM_PATHNAME|FNM_PERIOD) == 0)
{
/* We have a match. Add it to the chain. */
- struct nameseq *new = (struct nameseq *) xmalloc (state->size);
+ struct nameseq *new = xmalloc (state->size);
new->name = concat (state->arname, mem, ")");
new->next = state->chain;
state->chain = new;
@@ -276,8 +276,8 @@ ar_glob (char *arname, char *member_pattern, unsigned int size)
/* Scan the archive for matches.
ar_glob_match will accumulate them in STATE.chain. */
i = strlen (arname);
- state.arname = (char *) alloca (i + 2);
- bcopy (arname, state.arname, i);
+ state.arname = alloca (i + 2);
+ memcpy (state.arname, arname, i);
state.arname[i] = '(';
state.arname[i + 1] = '\0';
state.pattern = member_pattern;
@@ -290,13 +290,13 @@ ar_glob (char *arname, char *member_pattern, unsigned int size)
return 0;
/* Now put the names into a vector for sorting. */
- names = (char **) alloca (state.n * sizeof (char *));
+ names = alloca (state.n * sizeof (char *));
i = 0;
for (n = state.chain; n != 0; n = n->next)
names[i++] = n->name;
/* Sort them alphabetically. */
- qsort ((char *) names, i, sizeof (*names), alpha_compare);
+ qsort (names, i, sizeof (*names), alpha_compare);
/* Put them back into the chain in the sorted order. */
i = 0;