summaryrefslogtreecommitdiff
path: root/libelf/elf_getscn.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2021-09-06 08:00:00 +0000
committerDmitry V. Levin <ldv@altlinux.org>2021-09-09 08:01:00 +0000
commite094270980f1ca8af86a64cee0dbb6f1df670619 (patch)
tree1471f9586bb9e3d7f5448001353d47e94145a4ae /libelf/elf_getscn.c
parent02b05e183998943dd5a19ba783b8793e2ab9ab44 (diff)
downloadelfutils-e094270980f1ca8af86a64cee0dbb6f1df670619.tar.gz
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 <ldv@altlinux.org>
Diffstat (limited to 'libelf/elf_getscn.c')
-rw-r--r--libelf/elf_getscn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libelf/elf_getscn.c b/libelf/elf_getscn.c
index e1fbaaaa..be9c76f0 100644
--- a/libelf/elf_getscn.c
+++ b/libelf/elf_getscn.c
@@ -68,7 +68,7 @@ elf_getscn (Elf *elf, size_t idx)
Elf_Scn *scn0 = &runp->data[0];
if (elf->class == ELFCLASS32)
{
- scn0->shdr.e32 = (Elf32_Shdr *) calloc (1, sizeof (Elf32_Shdr));
+ scn0->shdr.e32 = calloc (1, sizeof (Elf32_Shdr));
if (scn0->shdr.e32 == NULL)
{
__libelf_seterrno (ELF_E_NOMEM);
@@ -77,7 +77,7 @@ elf_getscn (Elf *elf, size_t idx)
}
else
{
- scn0->shdr.e64 = (Elf64_Shdr *) calloc (1, sizeof (Elf64_Shdr));
+ scn0->shdr.e64 = calloc (1, sizeof (Elf64_Shdr));
if (scn0->shdr.e64 == NULL)
{
__libelf_seterrno (ELF_E_NOMEM);