Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Unified Diff: courgette/disassembler_elf_32.cc

Issue 1543643002: Switch to standard integer types in courgette/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « courgette/disassembler_elf_32.h ('k') | courgette/disassembler_elf_32_arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/disassembler_elf_32.cc
diff --git a/courgette/disassembler_elf_32.cc b/courgette/disassembler_elf_32.cc
index be420d4179f319be5893e21c03eedef4bcfc82cf..c6139a88390dc6e43f153f553c8d14a55e94e2cb 100644
--- a/courgette/disassembler_elf_32.cc
+++ b/courgette/disassembler_elf_32.cc
@@ -4,11 +4,13 @@
#include "courgette/disassembler_elf_32.h"
+#include <stddef.h>
+#include <stdint.h>
+
#include <algorithm>
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/memory/scoped_vector.h"
@@ -182,7 +184,7 @@ CheckBool DisassemblerElf32::RVAToFileOffset(Elf32_Addr addr,
RVA DisassemblerElf32::FileOffsetToRVA(size_t offset) const {
// File offsets can be 64 bit values, but we are dealing with 32
// bit executables and so only need to support 32bit file sizes.
- uint32 offset32 = (uint32)offset;
+ uint32_t offset32 = (uint32_t)offset;
for (int i = 0; i < SectionHeaderCount(); i++) {
@@ -240,7 +242,7 @@ CheckBool DisassemblerElf32::RVAsToOffsets(ScopedVector<TypedRVA>* rvas) {
CheckBool DisassemblerElf32::ParseFile(AssemblyProgram* program) {
// Walk all the bytes in the file, whether or not in a section.
- uint32 file_offset = 0;
+ uint32_t file_offset = 0;
std::vector<size_t> abs_offsets;
@@ -370,8 +372,7 @@ CheckBool DisassemblerElf32::ParseProgbitsSection(
if (*current_abs_offset != end_abs_offset &&
file_offset == **current_abs_offset) {
-
- const uint8* p = OffsetToPointer(file_offset);
+ const uint8_t* p = OffsetToPointer(file_offset);
RVA target_rva = Read32LittleEndian(p);
if (!program->EmitAbs32(program->FindOrMakeAbs32Label(target_rva)))
@@ -383,8 +384,7 @@ CheckBool DisassemblerElf32::ParseProgbitsSection(
if (*current_rel != end_rel &&
file_offset == (**current_rel)->get_offset()) {
-
- uint32 relative_target = (**current_rel)->relative_target();
+ uint32_t relative_target = (**current_rel)->relative_target();
// This cast is for 64 bit systems, and is only safe because we
// are working on 32 bit executables.
RVA target_rva = (RVA)(origin + (file_offset - origin_offset) +
« no previous file with comments | « courgette/disassembler_elf_32.h ('k') | courgette/disassembler_elf_32_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698