aboutsummaryrefslogtreecommitdiffstats
path: root/elff
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2010-09-22 14:19:28 +0200
committerDavid 'Digit' Turner <digit@android.com>2010-09-22 14:19:28 +0200
commit4e024bb4f5c8aa8b07459f7fbd65c35122127fd1 (patch)
treeccd5835eef17757d3e1c069e391c415c0135023d /elff
parent1d9873b37d2478554d9d678cd410bd3638c8dab3 (diff)
downloadexternal_qemu-4e024bb4f5c8aa8b07459f7fbd65c35122127fd1.zip
external_qemu-4e024bb4f5c8aa8b07459f7fbd65c35122127fd1.tar.gz
external_qemu-4e024bb4f5c8aa8b07459f7fbd65c35122127fd1.tar.bz2
Remove compiler warnings when building the emulator.
This forces -Wall during the build. Note that this patch doesn't remove all warnings, but most of the remaining ones are from upstream anyway. Change-Id: I8808d8495e99866e156ce5780d2e3c305eab491f
Diffstat (limited to 'elff')
-rw-r--r--elff/dwarf_defs.h4
-rw-r--r--elff/dwarf_die.cc2
-rw-r--r--elff/dwarf_die.h4
-rw-r--r--elff/dwarf_utils.cc8
-rw-r--r--elff/elf_alloc.h2
-rw-r--r--elff/elf_defs.h8
-rw-r--r--elff/elf_file.cc14
7 files changed, 25 insertions, 17 deletions
diff --git a/elff/dwarf_defs.h b/elff/dwarf_defs.h
index 567df6a..04573e2 100644
--- a/elff/dwarf_defs.h
+++ b/elff/dwarf_defs.h
@@ -717,9 +717,9 @@ class DwarfAbbrDieArray {
* hopping, that all Dwarf_Abbr_DIEs for the CU will fit into it.
*/
DwarfAbbrDieArray()
- : count_(0),
+ : array_(&small_array_[0]),
array_size_(ELFF_ARRAY_SIZE(small_array_)),
- array_(&small_array_[0]) {
+ count_(0) {
}
/* Destructs DwarfAbbrDieArray instance. */
diff --git a/elff/dwarf_die.cc b/elff/dwarf_die.cc
index 2085e31..0f58cbe 100644
--- a/elff/dwarf_die.cc
+++ b/elff/dwarf_die.cc
@@ -212,7 +212,7 @@ void DIEObject::dump(bool only_this) const {
Elf_Xword low, high;
while (elf_file()->get_range<Elf_Xword>(off, &low, &high) &&
(low != 0 || high != 0)) {
- printf(" %08I64X - %08I64X\n",
+ printf(" %08" FMT_I64 "X - %08" FMT_I64 "X\n",
low, high);
off += 16;
}
diff --git a/elff/dwarf_die.h b/elff/dwarf_die.h
index 21dea37..ca2eeeb 100644
--- a/elff/dwarf_die.h
+++ b/elff/dwarf_die.h
@@ -39,8 +39,8 @@ class DIEObject : public DwarfAllocBase {
: die_(die),
parent_cu_(parent_cu),
parent_die_(parent_die),
- prev_sibling_(NULL),
- last_child_(NULL) {
+ last_child_(NULL),
+ prev_sibling_(NULL) {
}
/* Destructs DIEObject intance. */
diff --git a/elff/dwarf_utils.cc b/elff/dwarf_utils.cc
index 56c05a3..1d84b66 100644
--- a/elff/dwarf_utils.cc
+++ b/elff/dwarf_utils.cc
@@ -275,12 +275,12 @@ dump_value(const Dwarf_Value* attr_value) {
break;
case DWARF_VALUE_U64:
- printf("XWORD) = %I64u (x%I64X)\n", attr_value->u64,
+ printf("XWORD) = %" FMT_I64 "u (x%" FMT_I64 "X)\n", attr_value->u64,
attr_value->u64);
break;
case DWARF_VALUE_S64:
- printf("SXWORD) = %I64d (x%I64X)\n", attr_value->s64,
+ printf("SXWORD) = %" FMT_I64 "d (x%" FMT_I64 "X)\n", attr_value->s64,
attr_value->s64);
break;
@@ -293,11 +293,11 @@ dump_value(const Dwarf_Value* attr_value) {
break;
case DWARF_VALUE_PTR64:
- printf("PTR64) = x%08I64X\n", attr_value->ptr64);
+ printf("PTR64) = x%08" FMT_I64 "X\n", attr_value->ptr64);
break;
case DWARF_VALUE_BLOCK:
- printf("BLOCK) = [%I64u]:", attr_value->block.block_size);
+ printf("BLOCK) = [%u]:", attr_value->block.block_size);
for (Elf_Xword i = 0; i < attr_value->block.block_size; i++) {
Elf_Byte prnt = *((const Elf_Byte*)attr_value->block.block_ptr + i);
printf(" x%02X", prnt);
diff --git a/elff/elf_alloc.h b/elff/elf_alloc.h
index d76dcdb..648a1e9 100644
--- a/elff/elf_alloc.h
+++ b/elff/elf_alloc.h
@@ -152,7 +152,7 @@ class DwarfAllocBase {
* attempts to instantiate objects of derived classes using this version
* of operator 'new'.
*/
- void* operator new(size_t size) {
+ void* operator new(size_t size) throw() {
return NULL;
}
};
diff --git a/elff/elf_defs.h b/elff/elf_defs.h
index 39fd1b1..1eca81b 100644
--- a/elff/elf_defs.h
+++ b/elff/elf_defs.h
@@ -132,4 +132,12 @@ is_little_endian_cpu(void) {
return get_byte(&tmp, 0) == 0xFF;
}
+/* Use in printf() statements to dump 64-bit values
+ */
+#ifdef _WIN32
+# define FMT_I64 "I64"
+#else
+# define FMT_I64 "ll"
+#endif
+
#endif // ELFF_ELF_DEFS_H_
diff --git a/elff/elf_file.cc b/elff/elf_file.cc
index 39aa371..5a6392c 100644
--- a/elff/elf_file.cc
+++ b/elff/elf_file.cc
@@ -35,16 +35,16 @@ static const DwarfParseContext parse_rt_context = { parse_rt_tags };
//=============================================================================
ElfFile::ElfFile()
- : sec_table_(NULL),
+ : fixed_base_address_(0),
+ elf_handle_((MapFile*)-1),
elf_file_path_(NULL),
+ allocator_(NULL),
+ sec_table_(NULL),
sec_count_(0),
- cu_count_(0),
+ sec_entry_size_(0),
last_cu_(NULL),
- allocator_(NULL),
- fixed_base_address_(0),
- is_exec_(0),
- elf_handle_((MapFile*)-1),
- sec_entry_size_(0) {
+ cu_count_(0),
+ is_exec_(0) {
}
ElfFile::~ElfFile() {