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

Unified Diff: base/win/pe_image.h

Issue 883873002: Fix truncation warning in PEImage on VS2015 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2015-logging
Patch Set: IsOrdinal cast also Created 5 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/pe_image.h
diff --git a/base/win/pe_image.h b/base/win/pe_image.h
index d93e99dc14393b1f782d3752c3bbeba2accbef71..dde1b4876648df9c3646afca18760acc1d155f9d 100644
--- a/base/win/pe_image.h
+++ b/base/win/pe_image.h
@@ -239,15 +239,11 @@ class PEImageAsData : public PEImage {
};
inline bool PEImage::IsOrdinal(LPCSTR name) {
-#pragma warning(push)
-#pragma warning(disable: 4311)
- // This cast generates a warning because it is 32 bit specific.
- return reinterpret_cast<DWORD>(name) <= 0xFFFF;
-#pragma warning(pop)
+ return reinterpret_cast<uintptr_t>(name) <= 0xFFFF;
grt (UTC plus 2) 2015/01/28 14:12:12 if you wanted intptr_t everywhere for the sake of
}
inline WORD PEImage::ToOrdinal(LPCSTR name) {
- return reinterpret_cast<WORD>(name);
+ return static_cast<WORD>(reinterpret_cast<intptr_t>(name));
}
inline HMODULE PEImage::module() const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698