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

Unified Diff: snapshot/win/pe_image_reader.cc

Issue 1527803002: Fix some VS 2015 warnings (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad.git@master
Patch Set: Suppress/fix two VS 2015 warnings 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 | « no previous file | util/util.gyp » ('j') | util/util.gyp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/win/pe_image_reader.cc
diff --git a/snapshot/win/pe_image_reader.cc b/snapshot/win/pe_image_reader.cc
index 9abf0b139d4dce25cdeaae8e2a2372d16e6d3658..f63f71230147cab2404b0113694dae797d8735f4 100644
--- a/snapshot/win/pe_image_reader.cc
+++ b/snapshot/win/pe_image_reader.cc
@@ -200,8 +200,13 @@ bool PEImageReader::VSFixedFileInfo(
WinVMAddress address;
WinVMSize size;
+ // Do two casts to make it explicit that we are intentionally both converting
Mark Mentovai 2015/12/14 23:51:30 I don’t think the comment is necessary. Weird cast
brucedawson 2015/12/15 00:00:56 Done.
+ // from pointer to int, and doing a truncation. This avoids a VC++ 2015
+ // warning.
+ const uint16_t type =
Mark Mentovai 2015/12/14 23:51:30 but I’d name it vs_file_info_type.
brucedawson 2015/12/15 00:00:56 Done.
+ static_cast<uint16_t>(reinterpret_cast<uintptr_t>(VS_FILE_INFO));
if (!resource_reader.FindResourceByID(
- reinterpret_cast<uint16_t>(VS_FILE_INFO), // RT_VERSION
+ type, // RT_VERSION
VS_VERSION_INFO,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
&address,
« no previous file with comments | « no previous file | util/util.gyp » ('j') | util/util.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698