diff options
author | Mike Frysinger <vapier@gentoo.org> | 2017-03-03 13:31:54 -0800 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2018-06-07 10:05:49 -0400 |
commit | 6d18d3218193e1d34e8a7efb075465babc50d7a2 (patch) | |
tree | 6315c38ccd8ab9b64e7653fa8acc57be3e7bab0b | |
parent | dumpelf: constify misc pointers (diff) | |
download | pax-utils-6d18d3218193e1d34e8a7efb075465babc50d7a2.tar.gz pax-utils-6d18d3218193e1d34e8a7efb075465babc50d7a2.tar.bz2 pax-utils-6d18d3218193e1d34e8a7efb075465babc50d7a2.zip |
paxelf: constify misc pointers
Mark internal pointers as const that we don't modify anywhere.
-rw-r--r-- | paxelf.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -616,7 +616,7 @@ free_elf_and_return: #define READELF_HEADER(B) \ if (elf->elf_class == ELFCLASS ## B) { \ char invalid; \ - Elf ## B ## _Ehdr *ehdr = EHDR ## B (elf->ehdr); \ + const Elf ## B ## _Ehdr *ehdr = EHDR ## B (elf->ehdr); \ Elf ## B ## _Off size; \ /* verify program header */ \ invalid = 0; \ @@ -794,9 +794,9 @@ const void *elf_findsecbyname(elfobj *elf, const char *name) #define FINDSEC(B) \ if (elf->elf_class == ELFCLASS ## B) { \ - Elf ## B ## _Ehdr *ehdr = EHDR ## B (elf->ehdr); \ - Elf ## B ## _Shdr *shdr = SHDR ## B (elf->shdr); \ - Elf ## B ## _Shdr *strtbl; \ + const Elf ## B ## _Ehdr *ehdr = EHDR ## B (elf->ehdr); \ + const Elf ## B ## _Shdr *shdr = SHDR ## B (elf->shdr); \ + const Elf ## B ## _Shdr *strtbl; \ Elf ## B ## _Off offset; \ uint16_t shstrndx = EGET(ehdr->e_shstrndx); \ uint16_t shnum = EGET(ehdr->e_shnum); \ |