diff options
author | Andreas Gampe <agampe@google.com> | 2014-09-29 20:07:43 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-09-29 20:13:48 -0700 |
commit | c8ccf68b805c92674545f63e0341ba47e8d9701c (patch) | |
tree | fb360323538cb242ebf7c5c0aca27d3a0bce0abb /disassembler | |
parent | fcabfbe577c0fd40910b565beb681bd4b66f6c5d (diff) | |
download | art-c8ccf68b805c92674545f63e0341ba47e8d9701c.zip art-c8ccf68b805c92674545f63e0341ba47e8d9701c.tar.gz art-c8ccf68b805c92674545f63e0341ba47e8d9701c.tar.bz2 |
ART: Fix some -Wpedantic errors
Remove extra semicolons.
Dollar signs in C++ identifiers are an extension.
Named variadic macros are an extension.
Binary literals are a C++14 feature.
Enum re-declarations are not allowed.
Overflow.
Change-Id: I7d16b2217b2ef2959ca69de84eaecc754517714a
Diffstat (limited to 'disassembler')
-rw-r--r-- | disassembler/disassembler_arm.cc | 18 | ||||
-rw-r--r-- | disassembler/disassembler_x86.cc | 10 |
2 files changed, 14 insertions, 14 deletions
diff --git a/disassembler/disassembler_arm.cc b/disassembler/disassembler_arm.cc index 54e7761..6f8e08b 100644 --- a/disassembler/disassembler_arm.cc +++ b/disassembler/disassembler_arm.cc @@ -82,14 +82,14 @@ void DisassemblerArm::DumpCond(std::ostream& os, uint32_t cond) { void DisassemblerArm::DumpMemoryDomain(std::ostream& os, uint32_t domain) { switch (domain) { - case 0b1111: os << "sy"; break; - case 0b1110: os << "st"; break; - case 0b1011: os << "ish"; break; - case 0b1010: os << "ishst"; break; - case 0b0111: os << "nsh"; break; - case 0b0110: os << "nshst"; break; - case 0b0011: os << "osh"; break; - case 0b0010: os << "oshst"; break; + case 15U /* 0b1111 */: os << "sy"; break; + case 14U /* 0b1110 */: os << "st"; break; + case 11U /* 0b1011 */: os << "ish"; break; + case 10U /* 0b1010 */: os << "ishst"; break; + case 7U /* 0b0111 */: os << "nsh"; break; + case 6U /* 0b0110 */: os << "nshst"; break; + case 3U /* 0b0011 */: os << "osh"; break; + case 2U /* 0b0010 */: os << "oshst"; break; } } @@ -269,7 +269,7 @@ void DisassemblerArm::DumpArm(std::ostream& os, const uint8_t* instr_ptr) { uint32_t op = (instruction >> 21) & 0xf; opcode = kDataProcessingOperations[op]; bool implicit_s = ((op & ~3) == 8); // TST, TEQ, CMP, and CMN. - bool is_mov = op == 0b1101 || op == 0b1111; + bool is_mov = op == 13U /* 0b1101 */ || op == 15U /* 0b1111 */; if (is_mov) { // Show only Rd and Rm. if (s) { diff --git a/disassembler/disassembler_x86.cc b/disassembler/disassembler_x86.cc index 1d29765..195c45f 100644 --- a/disassembler/disassembler_x86.cc +++ b/disassembler/disassembler_x86.cc @@ -58,10 +58,10 @@ static const char* gReg64Names[] = { }; // 64-bit opcode REX modifier. -constexpr uint8_t REX_W = 0b1000; -constexpr uint8_t REX_R = 0b0100; -constexpr uint8_t REX_X = 0b0010; -constexpr uint8_t REX_B = 0b0001; +constexpr uint8_t REX_W = 8U /* 0b1000 */; +constexpr uint8_t REX_R = 4U /* 0b0100 */; +constexpr uint8_t REX_X = 2U /* 0b0010 */; +constexpr uint8_t REX_B = 1U /* 0b0001 */; static void DumpReg0(std::ostream& os, uint8_t rex, size_t reg, bool byte_operand, uint8_t size_override) { @@ -767,7 +767,7 @@ DISASSEMBLER_ENTRY(cmp, case 0xB1: opcode << "cmpxchg"; has_modrm = true; store = true; break; case 0xB6: opcode << "movzxb"; has_modrm = true; load = true; byte_second_operand = true; break; case 0xB7: opcode << "movzxw"; has_modrm = true; load = true; break; - case 0xBE: opcode << "movsxb"; has_modrm = true; load = true; byte_second_operand = true; rex |= (rex == 0 ? 0 : 0b1000); break; + case 0xBE: opcode << "movsxb"; has_modrm = true; load = true; byte_second_operand = true; rex |= (rex == 0 ? 0 : REX_W); break; case 0xBF: opcode << "movsxw"; has_modrm = true; load = true; break; case 0xC3: opcode << "movnti"; store = true; has_modrm = true; break; case 0xC5: |