diff options
author | Jim Meyering <jim@meyering.net> | 2003-09-28 08:23:28 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-09-28 08:23:28 +0000 |
commit | 3d56cf5c1db2ca76101b63f0f70c0562eb0a0efd (patch) | |
tree | 130c6937502b0805afc88d1e0962948433481fe8 | |
parent | b19d106cdbe19272770d61fb65bd7d0099287d75 (diff) | |
download | coreutils-3d56cf5c1db2ca76101b63f0f70c0562eb0a0efd.tar.xz |
Remove unnecessary casts of alloca, since now it's guaranteed to be (void *).
-rw-r--r-- | src/cp.c | 9 | ||||
-rw-r--r-- | src/ln.c | 6 |
2 files changed, 7 insertions, 8 deletions
@@ -285,7 +285,7 @@ re_protect (const char *const_dst_path, int src_offset, char *src_path; /* The source name in `dst_path'. */ uid_t myeuid = geteuid (); - dst_path = (char *) alloca (strlen (const_dst_path) + 1); + dst_path = alloca (strlen (const_dst_path) + 1); strcpy (dst_path, const_dst_path); src_path = dst_path + src_offset; @@ -383,13 +383,13 @@ make_path_private (const char *const_dirpath, int src_offset, int mode, char *dst_dirname; /* Leading path of `dirpath'. */ size_t dirlen; /* Length of leading path of `dirpath'. */ - dirpath = (char *) alloca (strlen (const_dirpath) + 1); + dirpath = alloca (strlen (const_dirpath) + 1); strcpy (dirpath, const_dirpath); src = dirpath + src_offset; dirlen = dir_len (dirpath); - dst_dirname = (char *) alloca (dirlen + 1); + dst_dirname = alloca (dirlen + 1); memcpy (dst_dirname, dirpath, dirlen); dst_dirname[dirlen] = '\0'; @@ -691,8 +691,7 @@ do_copy (int n_files, char **file, const char *target_directory, char *source_base; ASSIGN_BASENAME_STRDUPA (source_base, source); - new_dest = (char *) alloca (strlen (dest) - + strlen (source_base) + 1); + new_dest = alloca (strlen (dest) + strlen (source_base) + 1); stpcpy (stpcpy (new_dest, dest), source_base); } else @@ -75,12 +75,12 @@ int symlink (); char *tmp_source; \ size_t buf_len = strlen (source) + 1; \ \ - tmp_source = (char *) alloca (buf_len); \ + tmp_source = alloca (buf_len); \ memcpy (tmp_source, (source), buf_len); \ strip_trailing_slashes (tmp_source); \ source_base = base_name (tmp_source); \ \ - (new_dest) = (char *) alloca (strlen ((dest)) + 1 \ + (new_dest) = alloca (strlen ((dest)) + 1 \ + strlen (source_base) + 1); \ stpcpy (stpcpy (stpcpy ((new_dest), (dest)), "/"), source_base);\ } \ @@ -266,7 +266,7 @@ do_link (const char *source, const char *dest) if (tmp_backup == NULL) xalloc_die (); buf_len = strlen (tmp_backup) + 1; - dest_backup = (char *) alloca (buf_len); + dest_backup = alloca (buf_len); memcpy (dest_backup, tmp_backup, buf_len); free (tmp_backup); if (rename (dest, dest_backup)) |