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; |