qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/3] dyngen: fix some warnings about unused function


From: Mark McLoughlin
Subject: [Qemu-devel] [PATCH 2/3] dyngen: fix some warnings about unused functions
Date: Thu, 13 Nov 2008 16:42:05 +0000

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 <address@hidden>
---
 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]