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

Unified Diff: base/win/pe_image.cc

Issue 1128733002: Update from https://crrev.com/328418 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « base/win/object_watcher.cc ('k') | base/win/scoped_hdc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/pe_image.cc
diff --git a/base/win/pe_image.cc b/base/win/pe_image.cc
index 19b381d6fe6da271a0c2b02e52ac528bb0928889..692b7b665072d214f07c62e5c834b03f66173871 100644
--- a/base/win/pe_image.cc
+++ b/base/win/pe_image.cc
@@ -568,12 +568,11 @@ bool PEImage::ImageAddrToOnDiskOffset(LPVOID address,
if (NULL == section_header)
return false;
-#pragma warning(suppress : 4302) // pointer truncation
- // These casts generate warnings because they are 32 bit specific.
// Don't follow the virtual RVAToAddr, use the one on the base.
- DWORD offset_within_section = reinterpret_cast<DWORD>(address) -
- reinterpret_cast<DWORD>(PEImage::RVAToAddr(
- section_header->VirtualAddress));
+ DWORD offset_within_section =
+ static_cast<DWORD>(reinterpret_cast<uintptr_t>(address)) -
+ static_cast<DWORD>(reinterpret_cast<uintptr_t>(
+ PEImage::RVAToAddr(section_header->VirtualAddress)));
*on_disk_offset = section_header->PointerToRawData + offset_within_section;
return true;
« no previous file with comments | « base/win/object_watcher.cc ('k') | base/win/scoped_hdc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698