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

Unified Diff: courgette/disassembler_elf_32.cc

Issue 613893002: Fix more MSVC warnings, courgette/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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
Index: courgette/disassembler_elf_32.cc
diff --git a/courgette/disassembler_elf_32.cc b/courgette/disassembler_elf_32.cc
index bfd1ef4acdcbad747095928b07e7f906a2149c60..ff2b9e03b611cc42717aa96a2e7525023696a242 100644
--- a/courgette/disassembler_elf_32.cc
+++ b/courgette/disassembler_elf_32.cc
@@ -405,16 +405,12 @@ CheckBool DisassemblerElf32::ParseSimpleRegion(
size_t start_file_offset,
size_t end_file_offset,
AssemblyProgram* program) {
-
- const uint8* start = OffsetToPointer(start_file_offset);
- const uint8* end = OffsetToPointer(end_file_offset);
Peter Kasting 2014/09/30 00:08:01 There's no real gain to converting the offsets to
-
// Callers don't guarantee start < end
- if (start >= end) return true;
+ if (start_file_offset >= end_file_offset) return true;
- const ptrdiff_t len = end - start; // Works because vars are byte pointers
+ const size_t len = end_file_offset - start_file_offset;
Peter Kasting 2014/09/30 00:08:01 Since we know end > start, storing this as a size_
- if (!program->EmitBytesInstruction(start, len))
+ if (!program->EmitBytesInstruction(OffsetToPointer(start_file_offset), len))
return false;
return true;

Powered by Google App Engine
This is Rietveld 408576698