diff options
| author | Dmitry V. Levin <[email protected]> | 2021-09-06 08:00:00 +0000 |
|---|---|---|
| committer | Dmitry V. Levin <[email protected]> | 2021-09-09 08:01:00 +0000 |
| commit | e094270980f1ca8af86a64cee0dbb6f1df670619 (patch) | |
| tree | 1471f9586bb9e3d7f5448001353d47e94145a4ae /src/strip.c | |
| parent | 02b05e183998943dd5a19ba783b8793e2ab9ab44 (diff) | |
Remove redundant casts of memory allocating functions returning void *
Return values of functions returning "void *", e.g. calloc, malloc,
realloc, xcalloc, xmalloc, and xrealloc, do not need explicit casts.
Signed-off-by: Dmitry V. Levin <[email protected]>
Diffstat (limited to 'src/strip.c')
| -rw-r--r-- | src/strip.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/strip.c b/src/strip.c index 961b9db5..d5b753d7 100644 --- a/src/strip.c +++ b/src/strip.c @@ -1062,7 +1062,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, the debug file if the file would not contain any information. */ size_t debug_fname_len = strlen (debug_fname); - tmp_debug_fname = (char *) xmalloc (debug_fname_len + sizeof (".XXXXXX")); + tmp_debug_fname = xmalloc (debug_fname_len + sizeof (".XXXXXX")); strcpy (mempcpy (tmp_debug_fname, debug_fname, debug_fname_len), ".XXXXXX"); @@ -1196,8 +1196,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, table. Maybe some weird tool created an ELF file without one. The other one is used for the debug link section. */ if ((shnum + 2) * sizeof (struct shdr_info) > MAX_STACK_ALLOC) - shdr_info = (struct shdr_info *) xcalloc (shnum + 2, - sizeof (struct shdr_info)); + shdr_info = xcalloc (shnum + 2, sizeof (struct shdr_info)); else { shdr_info = (struct shdr_info *) alloca ((shnum + 2) @@ -1980,8 +1979,8 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, } shdr_info[cnt].newsymidx - = (Elf32_Word *) xcalloc (shdr_info[cnt].data->d_size - / elsize, sizeof (Elf32_Word)); + = xcalloc (shdr_info[cnt].data->d_size / elsize, + sizeof (Elf32_Word)); bool last_was_local = true; size_t destidx; |
