aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2021-01-27 19:33:49 +1100
committerAlexey Kardashevskiy <aik@ozlabs.ru>2021-02-12 13:41:47 +1100
commit26d8ba170355c951e53c08c357121d96bdb54076 (patch)
tree837809aefc4d61889aa803904585f4040ab2d4d4 /include
parent0549fa7d08dc9865e25b2af1a46f8ccbe46fd312 (diff)
downloadSLOF-26d8ba170355c951e53c08c357121d96bdb54076.zip
SLOF-26d8ba170355c951e53c08c357121d96bdb54076.tar.gz
SLOF-26d8ba170355c951e53c08c357121d96bdb54076.tar.bz2
elf: Compile with -Wextra
-Wextra enables a bunch of rather useful checks which this fixes. This changes the return value for the case when no ELF headers were found to avoid (ugly-ish) cast of -1 to unsigned. Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> --- Changes: v2: * cast the return value to (int) * added missing (long)
Diffstat (limited to 'include')
-rw-r--r--include/libelf.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/libelf.h b/include/libelf.h
index 48ff4d7..29a4d04 100644
--- a/include/libelf.h
+++ b/include/libelf.h
@@ -96,9 +96,9 @@ void elf_relocate64(void *file_addr, signed long offset);
int elf_forth_claim(void *addr, long size);
-long elf_get_file_size(const void *buffer, const long buffer_size);
-long elf_get_file_size32(const void *buffer, const long buffer_size);
-long elf_get_file_size64(const void *buffer, const long buffer_size);
+long elf_get_file_size(const void *buffer, const unsigned long buffer_size);
+long elf_get_file_size32(const void *buffer, const unsigned long buffer_size);
+long elf_get_file_size64(const void *buffer, const unsigned long buffer_size);
#ifdef __BIG_ENDIAN__
#define elf64_to_cpu(x, ehdr) ((ehdr)->ei_data == ELFDATA2MSB ? (x) : bswap_64(x))