From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0fHn-00024P-Op for qemu-devel@nongnu.org; Thu, 13 Nov 2008 11:43:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0fHl-00023M-UV for qemu-devel@nongnu.org; Thu, 13 Nov 2008 11:43:15 -0500 Received: from [199.232.76.173] (port=38120 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0fHl-00023C-Gn for qemu-devel@nongnu.org; Thu, 13 Nov 2008 11:43:13 -0500 Received: from mail04.svc.cra.dublin.eircom.net ([159.134.118.20]:41432) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1L0fHl-00086O-K9 for qemu-devel@nongnu.org; Thu, 13 Nov 2008 11:43:13 -0500 From: Mark McLoughlin Date: Thu, 13 Nov 2008 16:42:05 +0000 Message-Id: <1226594526-1855-2-git-send-email-markmc@redhat.com> In-Reply-To: <1226594526-1855-1-git-send-email-markmc@redhat.com> References: <> <1226594526-1855-1-git-send-email-markmc@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 2/3] dyngen: fix some warnings about unused functions Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Mark McLoughlin , qemu-devel@nongnu.org Warnings were: dyngen.c:292: error: ‘pstrcpy’ defined but not used Only used with CONFIG_FORMAT_COFF dyngen.c:319: error: ‘swab32ss’ defined but not used With ELF_USES_RELOCA, either swab32ss() or swab64ss() will be used depending on ELF_CLASS. Easier to just mark them both as unused. dyngen.c:334: error: ‘get16’ defined but not used dyngen.c:343: error: ‘get32’ defined but not used dyngen.c:352: error: ‘put16’ defined but not used dyngen.c:359: error: ‘put32’ defined but not used Maybe be used for some host arches; easiest to mark them as unused. dyngen.c:425: error: ‘elf_swap_phdr’ defined but not used This one is completely unused; just delete. Signed-off-by: Mark McLoughlin --- dyngen.c | 28 ++++++++++------------------ 1 files changed, 10 insertions(+), 18 deletions(-) diff --git a/dyngen.c b/dyngen.c index 68f23ad..c55a115 100644 --- a/dyngen.c +++ b/dyngen.c @@ -32,6 +32,8 @@ #include "config-host.h" +#define ATTRIBUTE_UNUSED __attribute__((unused)) + /* NOTE: we test CONFIG_WIN32 instead of _WIN32 to enabled cross compilation */ #if defined(CONFIG_WIN32) @@ -288,6 +290,7 @@ static int strstart(const char *str, const char *val, const char **ptr) return 1; } +#ifdef CONFIG_FORMAT_COFF static void pstrcpy(char *buf, int buf_size, const char *str) { int c; @@ -304,6 +307,7 @@ static void pstrcpy(char *buf, int buf_size, const char *str) } *q = '\0'; } +#endif /* CONFIG_FORMAT_COFF */ static void swab16s(uint16_t *p) { @@ -315,7 +319,7 @@ static void swab32s(uint32_t *p) *p = bswap32(*p); } -static void swab32ss(int32_t *p) +static void ATTRIBUTE_UNUSED swab32ss(int32_t *p) { *p = bswap32(*p); } @@ -325,12 +329,12 @@ static void swab64s(uint64_t *p) *p = bswap64(*p); } -static void swab64ss(int64_t *p) +static void ATTRIBUTE_UNUSED swab64ss(int64_t *p) { *p = bswap64(*p); } -static uint16_t get16(uint16_t *p) +static uint16_t ATTRIBUTE_UNUSED get16(uint16_t *p) { uint16_t val; val = *p; @@ -339,7 +343,7 @@ static uint16_t get16(uint16_t *p) return val; } -static uint32_t get32(uint32_t *p) +static uint32_t ATTRIBUTE_UNUSED get32(uint32_t *p) { uint32_t val; val = *p; @@ -348,14 +352,14 @@ static uint32_t get32(uint32_t *p) return val; } -static void put16(uint16_t *p, uint16_t val) +static void ATTRIBUTE_UNUSED put16(uint16_t *p, uint16_t val) { if (do_swap) val = bswap16(val); *p = val; } -static void put32(uint32_t *p, uint32_t val) +static void ATTRIBUTE_UNUSED put32(uint32_t *p, uint32_t val) { if (do_swap) val = bswap32(val); @@ -421,18 +425,6 @@ static void elf_swap_shdr(struct elf_shdr *h) swabls(&h-> sh_entsize); /* Entry size if section holds table */ } -static void elf_swap_phdr(struct elf_phdr *h) -{ - swab32s(&h->p_type); /* Segment type */ - swabls(&h->p_offset); /* Segment file offset */ - swabls(&h->p_vaddr); /* Segment virtual address */ - swabls(&h->p_paddr); /* Segment physical address */ - swabls(&h->p_filesz); /* Segment size in file */ - swabls(&h->p_memsz); /* Segment size in memory */ - swab32s(&h->p_flags); /* Segment flags */ - swabls(&h->p_align); /* Segment alignment */ -} - static void elf_swap_rel(ELF_RELOC *rel) { swabls(&rel->r_offset); -- 1.5.4.3